radio button in datalist

V

Vikas Kumar

i am selectin some data from database and through reader showing it in
datalist as above now for radio buttons i have single column which returns
1,2,3 and according to that i want one of above radio button to be
preselected in this datalist how can i do that
doing something like this
but this gives error "The type or namespace name 'rdbtn' could not be found
(are you missing a using directive or an assembly reference?)"
as its in datalist



<table width="100%">
<tr width="100%">
<td width="25%"><%#DataBinder.Eval(Container.DataItem,"FName")%></td>
<td width="25%"><input type=text name="txtPass"
value='<%#DataBinder.Eval(Container.DataItem,"Passwd")%>'></td>
<td width="45%" align="left">





<input type=hidden name="txtPerm"
value='<%#DataBinder.Eval(Container.DataItem,"Permission")%>'>
<%string x=Request.Form.Get("txtPerm");%>
<% if(x=="1")
{
rdbtn.SelectedValue="1";
}
else if(x=="2")
{
rdbtn.SelectedValue="2";
}
else if(x=="3")
{
rdbtn.SelectedValue="3";
}%>
</td>
<td width="5%" align="left">
</td>
</tr>
</table>
 
S

Steven Cheng[MSFT]

Hi Vikas,

Thank you for posting.

Regarding on this issue, I've also found your another duplicated one in the
following newsgroup:

Subject: selecting radio button in datalist
Date: Tue, 25 Apr 2006 17:38:14 +0530
Newsgroups: microsoft.public.dotnet.framework.aspnet

I've posted my response and some suggestion there. I'd appreciate if you
have a look there. Also, if you feel it convenient that we continue to
discuss in that thread, please feel free to post there.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top