|
-
Mar 29th, 2008, 02:01 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [2008] selecting default item for RadioButtonList in asp.net 2.0
hello...
i have a RadioButtonList in my web application which is developing by asp.net 2.0, i just need some help,
Code:
<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="true" >
<asp:ListItem>Month View</asp:ListItem>
<asp:ListItem>Week View</asp:ListItem>
<asp:ListItem>Day View</asp:ListItem>
</asp:RadioButtonList>
when the page loads by default the second item is selected, how can i change this default item?
thanks
In Love With .NET Framwork and Microsoft
Learning ASP.NET,ADO.NET And VB.NET
Becoming a Software Engineer...
-
Mar 29th, 2008, 02:03 PM
#2
Re: [2008] selecting default item for RadioButtonList in asp.net 2.0
RadioButtonList1.SelectedIndex = 0
-
Mar 29th, 2008, 02:09 PM
#3
Thread Starter
Addicted Member
Re: [2008] selecting default item for RadioButtonList in asp.net 2.0
where should i put it?
i put it in page_load event, but doesn't work that way, its autopost back and everytime when i select something on everypage load the first item is selected, only on the first time that the page loads the fist item should be selected then the user can select anyone of them
In Love With .NET Framwork and Microsoft
Learning ASP.NET,ADO.NET And VB.NET
Becoming a Software Engineer...
-
Mar 29th, 2008, 02:32 PM
#4
Re: [2008] selecting default item for RadioButtonList in asp.net 2.0
Place it in a Page.IsPostBack check so that the default item is selected only if the page is being loaded for the first time, but not during postbacks.
-
Mar 29th, 2008, 02:36 PM
#5
Thread Starter
Addicted Member
Re: [2008] selecting default item for RadioButtonList in asp.net 2.0
thanks alot... problem sloved
In Love With .NET Framwork and Microsoft
Learning ASP.NET,ADO.NET And VB.NET
Becoming a Software Engineer...
-
Mar 29th, 2008, 02:39 PM
#6
Re: [RESOLVED] [2008] selecting default item for RadioButtonList in asp.net 2.0
No problem, feel free to post back any time you have more questions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|