Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

ASP.NET RatioButtons don't respond to events on my webform

ASP.NET RatioButtons don't respond to events on my webform
I have a webform with 4 RadioButtons
I need to refresh a datagrid reflecting the radiobutton selection.
I tried to put the ratiobuttons as part of HTML
Also I tried adding the elements by Attribute.Add and see if the SelectedIndexChanged event is trigger this way
I put some code under the _SelectedIndexChanged sub in the aspx.vb file but it is not happening.
  They do not show on the form this way.
Still not responding

any code is appreciated.
0
EdCariello
Asked:
EdCariello
  • 2
  • 2
  • 2
  • +2
5 Solutions
 
tusharashahCommented:
Make sure that Property AutoPostBack=True for your RadioButtons...

-tushar
0
 
allanau20Commented:
This is really reaching and guessing... but do you have:
 
 RUNAT=server
0
 
allanau20Commented:
You're insane tushar -- 107006 for this month alone ! WoW.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
tusharashahCommented:
:) If you call me insane then what do you call the guy who has almost 300000 points this month....

EdCariello, your RadioButton should look something like following:
<asp:RadioButton id="RadioButton1" runat="server"AutoPostBack="True"></asp:RadioButton>

Now, double click on it and write your code in SelectedIndexChange Event..

-tushar
0
 
RejojohnyCommented:
>>I put some code under the _SelectedIndexChanged sub in the aspx.vb file but it is not happening.
for radio button, the event is "CheckedChange" and not "SelectedIndexChanged"

for a radio button defined this way
<asp:RadioButton id="RadioButton1"  runat="server"  AutoPostBack="true"></asp:RadioButton>

the code-behind should have a procedure something like this

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged

    End Sub

to handle the change in the selection. ...... the "handles" statement at the end of the procedure and the autopostback = true for the radio button are important ...

0
 
doobdaveCommented:
Not sure, but I think you have to also have the Page directive "AutoEventWireUp=True"

David
0
 
TorrwinCommented:
Also make sure you are re-binding your data grid in your checkedchanged sub.  Otherwise, even though the radio button will change, nothing will happen to your grid.
0
 
RejojohnyCommented:
glad that u were able to solve ur problem .. but am a bit confused. u seem to have accepted everyone's suggestion .. so what did u exactly code?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now