Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2004, 09:29 AM
Authorized User
 
Join Date: Oct 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Radiobuttonlist

I have this Code in "details.aspx":

<asp:radiobuttonlist id="UserType" runat="server" >
<asp:ListItem Value="reular">reular</asp:ListItem>
<asp:ListItem Value="advance">reular</asp:ListItem>
</asp:radiobuttonlist>

In "details.aspx.vb" I have this code

Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim number as integer= request.form("numType")

If number="1" then
  ' here come the mising code
else
  ' here come the mising code
end if

END SUB


In the mising code I want to write that if numbet="1" so I want that in my radiobuttonlist, the first Radio will be checked and Else the seconed will be checked.

How to do it???

 
Old December 10th, 2004, 12:45 PM
Authorized User
 
Join Date: Nov 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Radiobuttonlist has 0 based index. So what you can do is something like this(Code in C#)

if(number >= 1)
   UserType.SelectedIndex = number-1;

This should check the Radiobuttonlist according to the number. So if number is 1 it will check first item, if number is 5 it will check fifth item.

Hope it helps





Similar Threads
Thread Thread Starter Forum Replies Last Post
RadioButtonList sumith ASP.NET 2.0 Basics 0 October 2nd, 2007 11:30 PM
Get values from RadioButtonList debjanib ASP.NET 1.0 and 1.1 Basics 1 May 30th, 2006 09:45 PM
get values from radiobuttonlist debjanib ASP.NET 1.0 and 1.1 Professional 1 May 30th, 2006 09:36 PM
Can't get RadioButtonlist with databind nayalksrs123 .NET Web Services 0 January 15th, 2005 06:29 AM
radiobuttonlist fzilz VS.NET 2002/2003 1 April 9th, 2004 10:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.