[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Steve Lloyd

2/10/2004 2:57:00 PM

Hi,

I am using a dropdown list in a webform, when the postback is done the
selected property in the <option> is set to an item in the list that was not
selected before the postback.

Has anyone seen this before and do you have a fix for it

Thanks

Steve


2 Answers

Alvin Bruney

2/11/2004 4:03:00 AM

0

first try deleting the control and adding it back. If this doesn't help,
post your page load code and the code tied to the dropdown postback if any.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl...
"Steve Lloyd" <steveRemoveThisNow@livenowpaylater.co.uk> wrote in message
news:%23V6yoY%237DHA.2028@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I am using a dropdown list in a webform, when the postback is done the
> selected property in the <option> is set to an item in the list that was
not
> selected before the postback.
>
> Has anyone seen this before and do you have a fix for it
>
> Thanks
>
> Steve
>
>


CMA

2/11/2004 4:26:00 AM

0

hi Steve,

most probably u r creating the control items in each post back round trip to
the server...
pls read on "IsPostBack" in ASP.NET...
u can easily fix it.

try to put a break point in the page load and see whether the create items
section is execute all the time.

u can use like this..

if(!IsPostBack)
{
// assign items here. so it will create only once. not in the post back
round trips..
}

hope this helps,
CMA


"Steve Lloyd" <steveRemoveThisNow@livenowpaylater.co.uk> wrote in message
news:%23V6yoY%237DHA.2028@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I am using a dropdown list in a webform, when the postback is done the
> selected property in the <option> is set to an item in the list that was
not
> selected before the postback.
>
> Has anyone seen this before and do you have a fix for it
>
> Thanks
>
> Steve
>
>