By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

Is this a PostBack Problem?

P: n/a
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.
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

"MrMike" wrote:
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.

Jul 21 '05 #2

P: n/a
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!

"Rakesh Rajan" wrote:
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

"MrMike" wrote:
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.

Jul 21 '05 #3

P: n/a
Hi MrMike,

Sorry I didn't explain everything earlier.

Bind the datagrid as I said in the check for PostBack.

In the command events, then set the appropriate index properly and then call
DataBind again.
This MSDN walkthrough will help you out
http://www.msdn.microsoft.com/librar...dWriteData.asp

Let me know if I could be of more help.

HTH,
Rakesh Rajan

"MrMike" wrote:
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!

"Rakesh Rajan" wrote:
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

"MrMike" wrote:
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.

Jul 21 '05 #4

P: n/a
Thank you very much Rakesh. I'm headed in the right direction now.

"Rakesh Rajan" wrote:
Hi MrMike,

Sorry I didn't explain everything earlier.

Bind the datagrid as I said in the check for PostBack.

In the command events, then set the appropriate index properly and then call
DataBind again.
This MSDN walkthrough will help you out:
http://www.msdn.microsoft.com/librar...dWriteData.asp

Let me know if I could be of more help.

HTH,
Rakesh Rajan

"MrMike" wrote:
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!

"Rakesh Rajan" wrote:
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

"MrMike" wrote:

> 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.

Jul 21 '05 #5

P: n/a
Glad to hear that Mike :)

"MrMike" wrote:
Thank you very much Rakesh. I'm headed in the right direction now.

"Rakesh Rajan" wrote:
Hi MrMike,

Sorry I didn't explain everything earlier.

Bind the datagrid as I said in the check for PostBack.

In the command events, then set the appropriate index properly and then call
DataBind again.
This MSDN walkthrough will help you out:
http://www.msdn.microsoft.com/librar...dWriteData.asp

Let me know if I could be of more help.

HTH,
Rakesh Rajan

"MrMike" wrote:
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!

"Rakesh Rajan" wrote:

> 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
>
> "MrMike" wrote:
>
> > 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.

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.