By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

radio button event in web form

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
???

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

P: n/a
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.