Its Problem or my mistake
-
I am New to .net , in my project I am using one dropdownlist and using its (selecteditem.text)value and selectedvalue both.Now the problem is that selectedtext i.e stnno is unique but its selectedvalue is date and not unique if i select the third value from dropdown whose postback=true then it is returing the value of first record because the selectedvalue i.e date is same for both the index what can I do.???????????? Ankur
-
I am New to .net , in my project I am using one dropdownlist and using its (selecteditem.text)value and selectedvalue both.Now the problem is that selectedtext i.e stnno is unique but its selectedvalue is date and not unique if i select the third value from dropdown whose postback=true then it is returing the value of first record because the selectedvalue i.e date is same for both the index what can I do.???????????? Ankur
Not sure I follow 100%, but if your control is databound, and you bind on postback, your selection will be lost. Put your DataBind code inside a if(!IsPostback) block
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I am New to .net , in my project I am using one dropdownlist and using its (selecteditem.text)value and selectedvalue both.Now the problem is that selectedtext i.e stnno is unique but its selectedvalue is date and not unique if i select the third value from dropdown whose postback=true then it is returing the value of first record because the selectedvalue i.e date is same for both the index what can I do.???????????? Ankur
The values of the options are supposed to be unique. The only thing that is sent back from the browser in the postback is the value of the selected option, so if the values are not unique, you can't know which option was really selected. If you really can't use unique values, you have to handle the detection of the selected option all by yourself. You can put a Javascript in the onsubmit event in the form, that gets the selectedIndex from the html element that the dropdownlist generates, and puts it in a hidden field.
--- single minded; short sighted; long gone;