DropDownList valuehttp://forums.asp.net/t/1799235.aspx/1?DropDownList+valueWed, 02 May 2012 12:27:29 -040017992354961750http://forums.asp.net/p/1799235/4961750.aspx/1?DropDownList+valueDropDownList value <p>Hi,&nbsp;</p> <p>I had a dropDownList, and I want that when My page load, the DropDownList automatickly choose the value &quot;TI&quot; and block choosing other values</p> <p></p> <p>I had to do:&nbsp;</p> <p>// To choose TI: &nbsp; &nbsp;DropDownList.SelectedValue=&quot;TI&quot;</p> <p>// To block choosing &nbsp;??</p> <p></p> 2012-05-02T11:49:07-04:004961759http://forums.asp.net/p/1799235/4961759.aspx/1?Re+DropDownList+valueRe: DropDownList value <p>block other items in</p> <pre class="prettyprint">protected void DropDownList_SelectedIndexChanged(object sender,EventArgs e) { if(DropDownList.SelectedValue !=&quot;TI&quot;) DropDownList.SelectIndex=-1; }</pre> <p><br> <br> </p> <p></p> 2012-05-02T11:53:00-04:004961761http://forums.asp.net/p/1799235/4961761.aspx/1?Re+DropDownList+valueRe: DropDownList value <p>i didnt understand exactly what do you mean</p> <p>other values should be saved in your database;</p> <p>you need to retreive them from your databse by binding it to sql;</p> <p>then you should write in the .cs part of your project the following</p> <p>string name = DropDownList1.SelectedValue;</p> <p>and then you can insert into a table the value name from the drop downlist</p> <p></p> 2012-05-02T11:54:54-04:004961763http://forums.asp.net/p/1799235/4961763.aspx/1?Re+DropDownList+valueRe: DropDownList value <p></p> <blockquote><span class="icon-blockquote"></span> <h4>salim20001</h4> want that when My page load, the DropDownList automatickly choose the value &quot;TI&quot; and block choosing other values</blockquote> <p></p> <p>if you want to block chosing other value by user.... why keep dropdown.... keep it as simple label</p> <p>you can still block selection of dropdown by making it disabled</p> <p>DropDownList1.Enabled = false;</p> <p>hope this helps...</p> 2012-05-02T11:55:23-04:004961839http://forums.asp.net/p/1799235/4961839.aspx/1?Re+DropDownList+valueRe: DropDownList value <p>ok</p> <p>then you can simply make a lable with one value</p> <p>or if you insist on a drop downlist, just give it a single value</p> <p>or in the .cs part of your project just assign the value of the dropdownlist</p> <p>dropdownlist.selectedvalue=&quot;VALUE&quot;;</p> <p>:)</p> 2012-05-02T12:27:29-04:00