c# - asp.net radiobuttonlist will not selectindex -


i have radio button list...

            <asp:radiobuttonlist id="rblcollectoptions" runat="server" cssclass="radiolist">             <asp:listitem value="collect" text="collect address"></asp:listitem>             <asp:listitem value="dropoff" text="drop off @ depot (uk only)"></asp:listitem>         </asp:radiobuttonlist> 

i have link button on page "enter address manually" want set radio button "collect" value.

i tried...

rblcollectoptions.selectedindex = 0; 

and

rblcollectoptions.items[0].selected = true; 

both work if no option selected, if manually set radio button option, or set default selection, link button not work.

call clearselection or set selectedindex = -1 before set selected item.

rblcollectoptions.clearselection(); 

or

rblcollectoptions.selectedindex = -1; 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -