Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

help getting CheckedChanged working on radio buttons .net VB

Posted on 2010-09-17
3
Medium Priority
?
413 Views
Last Modified: 2012-05-10
I'm trying to get a sub to run when a radio button is selected. My code looks like this, but it's not working. What am I doing wrong? Thanks.

Page Code:
<asp:RadioButton id="register" GroupName="tiles" runat="server"/>

Code behind:
    Protected Sub register_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles register.CheckedChanged
        Message.Text = "working"
    End Sub
Imports System.Data.SqlClient
Imports System.Configuration

Partial Class _admin_tiles_edit
    Inherits System.Web.UI.Page


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim fileName As String
        Dim fileName2 As String
        If register.Checked Then
            fileName = "register_off.png"
            fileName2 = "register_on.png"
        ElseIf mailing_list.Checked Then
            fileName = "mailing_list_off.png"
            fileName2 = "mailing_list_on.png"
        ElseIf center_bar.Checked Then
            fileName = "center_bar_off.png"
            fileName2 = "center_bar_on.png"
        ElseIf photos.Checked Then
            fileName = "photos_off.png"
            fileName2 = "photos_on.png"
        ElseIf rules.Checked Then
            fileName = "rules_off.png"
            fileName2 = "rules_on.png"
        ElseIf store.Checked Then
            fileName = "store_off.png"
            fileName2 = "store_on.png"
        End If
        If FileUpload1.HasFile Then
            ' = FileUpload1.FileName
            FileUpload1.SaveAs(MapPath("images/" & fileName))
            Message.Text = "Changes complete."
        Else
            Message.Text = "Error, please try again."
        End If

        If FileUpload2.HasFile Then
            ' = FileUpload2.FileName
            FileUpload2.SaveAs(MapPath("images/" & fileName2))
            Message.Text = "Changes complete."
        Else
            Message.Text = "Error, please try again."
        End If
    End Sub

    
    Protected Sub register_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles register.CheckedChanged
        Message.Text = "working"
    End Sub
End Class

Open in new window

0
Comment
Question by:elliottbenzle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 2000 total points
ID: 33707039
Set AutoPostBack="true" for the radiobutton
0
 
LVL 3

Expert Comment

by:ghayasurrehman
ID: 33707062
<asp:RadioButton id="register" AutoPostback="true" checked_change="register_CheckedChanged" GroupName="tiles" runat="server"/>
0
 
LVL 4

Author Closing Comment

by:elliottbenzle
ID: 33707122
thanks
0

Featured Post

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question