473,326 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 20 '05 #1
4 12691
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 20 '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 20 '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 20 '05 #4
Cor
John,
Please don't cross post
I now have to watch not to send this answer to the asp.net group

You use a radiobutton as a checkbox.

In mine idea the purpose from the radio button is to set it in a group.
radiobutton1.groupname = "John"
radiobutton2.groupname = "John"

when you push on button 1 button 2 is cleared and visa versa
Cor
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
I have radio buttons on a form, and when the user makes the selection, it will trigger the event and send the form to the web server and print the selected value. In Case 1, I just use submit...
4
by: Randell D. | last post by:
Folks, I have a form (called FORM1) - In my INPUT submit tag, I have an onClick event that I have successfully tested/used to display the value of a TEXT box using the following function (called...
15
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A...
6
by: HD | last post by:
Hi. I have an asp page with radio buttons and a combobox... when the user clicks a radio button, I want the form to submit so I can execute the ASP code in order to change the list shown in the...
3
by: John Davis | last post by:
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,...
2
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button...
1
by: Jerry | last post by:
We have a 10-question quiz for kids, each question being a yes or no answer using radio selections. I'd like to keep a current total of yes's and no's at the bottom of the quiz (if the user selects...
8
by: helpful sql | last post by:
Hi, I have 2 radio buttons on my Windows form control. The radio button's CheckedChanged event disables or enables other controls on the form based on the value of the Checked property. When the...
2
by: Peted | last post by:
Hi Im using c# express edition 2005 I have an MDI form, where i load multiple child forms from a dll i create, using reflection and late binding The child forms have multiple radio...
4
by: Z.K. | last post by:
I started a forms application and I put on the form three buttons. In the functions for the radio buttons I put in a single messagebox like: MessageBox("Hello 1") MessageBox("Hello 2") ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.