472,090 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,090 software developers and data experts.

radio button event in web form

I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons.
When the user click the first radio button, the text will change to
uppercase. If the user clicks the other radio button, the text will change
to lowercase.

I added the following event, but still won't able to change the text to
uppercase.
Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Text = UCase(TextBox1.Text)
End Sub
any ideas?

Nov 17 '05 #1
3 2982
You may want to check out the ASP.NET newsgroups, they could probably help
you, but FYI, the RadioButton needs to be set to AutoPostback.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"John Davis" <jr*******@hotmail.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons. When the user click the first radio button, the text will change to
uppercase. If the user clicks the other radio button, the text will change
to lowercase.

I added the following event, but still won't able to change the text to
uppercase.
Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Text = UCase(TextBox1.Text)
End Sub
any ideas?

Nov 17 '05 #2
???

He said ASP.NET in his original post... And he also X-Posted to the ASP.NET
newsgroup

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
The right answer is already given Tom. This was a VB.Net and C# problem,
has nothing to do with ASP.Net, maybe with controls.

Nov 17 '05 #3
Yes, once I set the property of radio button to AutoPostBack=True, the text
in the text box will change automatically when i click the radio button.

However, since I have 2 radio buttons, when I click one of the radio button,
the text will change. When I click the other radio button, the check mark
still there in the previous radio button. OK, then I do the following to
clean up the old choice. But it is tedious if there are 10 radio buttons,
since radio button only allows users to choose ONE CHOICE at a time. I just
think to clear the old check mark should be done automatically as ASP.NET
feature, not programmatically. Maybe I just don't know. Please
advice.Thanks.

Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles RadioButton1.CheckedChanged
RadioButton2.Checked = False
TextBox1.Text = UCase(TextBox1.Text)
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles RadioButton2.CheckedChanged
RadioButton1.Checked = False
TextBox1.Text = LCase(TextBox1.Text)
End Sub
John

"Chris Wilmot" <ch**********@mtsgroup.co.uk> wrote in message
news:#g**************@TK2MSFTNGP09.phx.gbl...
Do you have the button set as Auto Postback???

CW
"John Davis" <jr*******@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio

buttons.
When the user click the first radio button, the text will change to
uppercase. If the user clicks the other radio button, the text will change to lowercase.

I added the following event, but still won't able to change the text to
uppercase.
Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
TextBox1.Text = UCase(TextBox1.Text)
End Sub
any ideas?


Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Randell D. | last post: by
15 posts views Thread by JR | last post: by
1 post views Thread by Jerry | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.