|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DropdownLisr problem on postbackHi.
I working with dropdownlist control, this control is populated with a collection. when the page has a postback i tried to get the new selectedindex that the user select but always is 0. What happening? What can i do? this control doný fire teh postback. Regards HI,
Is it running the "DataBinding" code to re-bind the dropdownlist when the page is postback ? Show quoteHide quote "Herman Geovany Ayala Zúñiga" <geovanyay***@gmail.com> :Oxy4CzdsGHA.1***@TK2MSFTNGP05.phx.gbl... > Hi. > > I working with dropdownlist control, this control is populated with a > collection. when the page has a postback i tried to get the new > selectedindex that the user select but always is 0. What happening? What > can i do? this control doný fire teh postback. > > Regards Chison Cai escribió:
Show quoteHide quote > HI, I do that to populate again the dropdownlist but i want to get the > Is it running the "DataBinding" code to re-bind the dropdownlist when > the page is postback ? > > "Herman Geovany Ayala Zúñiga" <geovanyay***@gmail.com> > :Oxy4CzdsGHA.1***@TK2MSFTNGP05.phx.gbl... >> Hi. >> >> I working with dropdownlist control, this control is populated with a >> collection. when the page has a postback i tried to get the new >> selectedindex that the user select but always is 0. What happening? What >> can i do? this control doný fire teh postback. >> >> Regards > > selectedindex when the postback fires regards You should NOT re-bind the dropdownlist when the page is postback...
cos it will refresh the dropdownlist's DataSource and reset the selectedindex to 0 . you just need to have data binded when the page is not PostBack. like this: private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { //binding dropdownlist } } holp it helps Regards, chison Show quoteHide quote "Herman Geovany Ayala Zúñiga" <geovanyay***@gmail.com> :eiNbuSnsGHA.4***@TK2MSFTNGP02.phx.gbl... > Chison Cai escribió: >> HI, >> Is it running the "DataBinding" code to re-bind the dropdownlist when >> the page is postback ? >> >> "Herman Geovany Ayala Zúñiga" <geovanyay***@gmail.com> >> :Oxy4CzdsGHA.1***@TK2MSFTNGP05.phx.gbl... >>> Hi. >>> >>> I working with dropdownlist control, this control is populated with a >>> collection. when the page has a postback i tried to get the new >>> selectedindex that the user select but always is 0. What happening? What >>> can i do? this control doný fire teh postback. >>> >>> Regards >> >> > I do that to populate again the dropdownlist but i want to get the > selectedindex when the postback fires > > regards
disable an ascx entirely in my web page
I guess a simple question but I cant find it :-( Integration of GridView and FormView DropDownList skin - assign BorderColor format text in dropdownlist Allowing entry of a Carriage Return during data entry Stop Postback in image button sumbit server form to another page Rename ID in Properties Window Change report chart type ad runtime. |
|||||||||||||||||||||||