|
-
Feb 4th, 2003, 06:33 AM
#1
Thread Starter
Fanatic Member
radio buttons
How can I set 1 of my radio buttons to load up checked?
That wasnt to bad now was it.
CHeers
-
Feb 4th, 2003, 08:24 AM
#2
Frenzied Member
in the page load event RadioButton.Checked = True
-
Feb 5th, 2003, 06:30 AM
#3
Thread Starter
Fanatic Member
Its not a single radio button but a radio button list.
I want the first item to be ticked by default.
Cheers
-
Feb 8th, 2003, 07:59 PM
#4
Hyperactive Member
VB Code:
<script language="vb" runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack
MyRadioButtonList.Items(0).Selected = True
End If
End Sub
</script>
<html>
<body>
<form id="Form1" method="post" runat="server">
<asp:RadioButtonList
id="MyRadioButtonList"
runat="server">
<asp:ListItem Value="1">Item1</asp:ListItem>
<asp:ListItem Value="2">Item2</asp:ListItem>
</asp:RadioButtonList>
</form>
</body>
</html>
-
Feb 10th, 2003, 09:42 AM
#5
Thread Starter
Fanatic Member
Cheers.
May the sun always shine on fort collins.
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
|