471,354 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Dropdownlist probs in ASP.NET

Hi all,

I am doing this in a web page...

I have a dropdownlist that autopostback. This sets me a filter criteria for
items to display in a datalist.

In the datalist, I have edit capabilities, which opens a text box.

When I click Update for the datalist (edit), then for some reason, the
dropdownlist gets run again before the updatecommand for the datalist. This
is resetting the value in my datalist edit text box to what it was before my
edit.

How can I stop that?

Thanks.

Best regards,
Dave Colliver.
http://www.DerbyFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Feb 1 '06 #1
4 1843
"David" <da*****************@revilloc.REMOVETHIS.com> wrote in message
news:O8**************@TK2MSFTNGP15.phx.gbl...
How can I stop that?


I never found a way to prevent that in v1.x, so I would invariably design
solutions to avoid the situation...
Feb 1 '06 #2
I have navigated around similar issues before but those solutions won't
apply to this one. :-(

I guess then what I will have to do is to remove autopostback and create my
own JS onchange event to refresh the page using get instead of post. I
suppose this way, I can handle it the way it should handle.

I hate having to revert to ASP type technology to get around stupid issues
like this.

Thanks.

Best regards,
Dave Colliver.
http://www.SheffieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:uu**************@TK2MSFTNGP10.phx.gbl...
"David" <da*****************@revilloc.REMOVETHIS.com> wrote in message
news:O8**************@TK2MSFTNGP15.phx.gbl...
How can I stop that?


I never found a way to prevent that in v1.x, so I would invariably design
solutions to avoid the situation...

Feb 1 '06 #3
"David" <da*****************@revilloc.REMOVETHIS.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
I hate having to revert to ASP type technology to get around stupid issues
like this.


I know what you mean!

I haven't had a chance to check whether this is fixed in v2 - does anyone
know?
Feb 2 '06 #4
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:ug**************@TK2MSFTNGP09.phx.gbl...
I haven't had a chance to check whether this is fixed in v2 - does anyone
know?


I can confirm that this has *not* been fixed in ASP.NET v2

Here's how to reproduce it.

1) Create a simple web page with an <asp:DropDownList> and an <asp:Button>

2) Create a SelectedIndexChanged method for the DropDownList and a Command
event for the Button

3) Add any single line of code to each event - just enough so you can set a
breakpoint

4) Populate the DropDownList in the Page_Init method - only a couple of
items will do, just enough to cause the event to fire.

5) Set a breakpoint in the SelectedIndexChanged method and the Command
method

6) Run the page in Debug mode

7) Select a different item in the DropDownList - you jump into its
SelectedIndexChanged method as expected - hit F5 to resume

8) Click the Button - you jump into the DropDownList's SelectedIndexChanged
method before jumping into the Button's Command method - that's bad, at
least, to my way of thinking. I would have expected the Page_Init to fire,
the Page_Load to fire and the Button's Command method to fire. I would have
expected the ViewState to remember the DropDownList's selection, but not its
SelectedIndexChanged method to fire.

Can anyone please confirm that this is a bug?
Feb 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Shiju Poyilil | last post: by
10 posts views Thread by Sacha Korell | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.