Is this a PostBack Problem?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid containing a drop-down-list. The datagrid contains
Edit,Update,Cancel buttons and respective events. Whenever I make a change
to one particular field (a drop-down-list in column3), as soon as I click
UPDATE the original value which existed at load-time replaces the value I
chose. Is this a postback problem, and if so how would I resolve this?

Thanks.
 
Hi MrMike,

This probably is a post back problem.
Add a check in the Page Load event like this:
if( !IsPostBack )
{
...call databind etc....
}

HTH,
Rakesh Rajan
 
Rakesh, If I modify the Page_Load event for "If Is Postback Then..." no data
appears on the form. If I modify the Page_Load for "If Not Is Postback
Then..." then data initially appears on the form but once I click EDIT the
data goes away.

Should the logic go somewhere else, like in the UpdateCommand event or
something? Thanks!
 
Back
Top