|
-
Aug 28th, 2003, 09:17 AM
#1
Thread Starter
Lively Member
Add asp:radiobutton to string?
I am using the replace function to try and add a radiobutton into a string but can not figure out how to do it programatically. Any help would be appreciated
Code:
strRep=replace("<--add radio1 here-->","<asp:radiobutton runat=server id=radiobutton1/>")
label1.text=strRep
I know that doesn work but not sure how to do it.
"Find all you need in your mind if you take the time" -DT
-
Aug 30th, 2003, 09:52 AM
#2
Junior Member
Assign a value to your Radio Button in your aspx page, example (threw a button on there so you can test this, just paste inside a form tag):
<asp:radiobuttonlist id="rd1" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" ForeColor="Black">
<asp:ListItem Value="RD String Value1 " Selected="True">All</asp:ListItem>
<asp:ListItem Value="RD String Value2 ">None</asp:ListItem>
</asp:radiobuttonlist></FONT></TD><TD vAlign="center" colSpan="5"><FONT color="#000000">RD Display Text</TD>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
<BR>
<BR>
<asp:Label id="Label1" runat="server">Label</asp:Label></TR></FONT>
In your Code Behind Page:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strRep As String
strRep = "Test1 "
strRep = strRep & rd1.SelectedItem.Value 'Concatenates the string with the radio buttom value
Label1.Text = strRep
End Sub
Good Luck.
If you would have been listening, you would have heard what I meant to say.
-
Aug 30th, 2003, 12:16 PM
#3
Hyperactive Member
It looks like you want the actual radio button(not the value of a radio button) added to your string...What exactly are you trying to do? There's probably an easy way of doin it, just need to know what is the desired end result.
-
Sep 1st, 2003, 04:05 AM
#4
Frenzied Member
You can add a placeholder to the form, then just add the radio button to the placeholder at runtime.
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
|