last day (15 days later) » 

10:42 PM
0
A: How to loop trough radiobuttonlist and if selected show content

Faraz AhmedPlease try with this example protected void SelectedButtonChange(object sender, EventArgs e) { if (RadioButtonList1.SelectedIndex > -1) { lbllogin.Visible = false; lblSignup.Visible = false; lblReset.Visible = false; string selected = RadioButtonList5.Sele...

 
Nope still didn't work, RadioButtonList1.SelectedItem.Text; changed .text to .value but still same result when I switch from signin to reset and back nothink shows up
 
@Bartfranken I have edit answer please check.
 
The edits that is made has still same result so when I switch back nothink shows up :( strange...
Does it has to be in a special event handler? Because I did everythink in pageload I think that could be somethink to do with it
 
@Bartfranken I have change all thing, you have to add event listener on asp:RadioButtonList also
yes this need to be in a event handler, because, page load doesn't have any selected text by default, or if you want to do in page load first you have to make any radio button selected than, you have to add event handler of OnSelectedIndexChanged="SelectedButtonChange", so that it is working
 
Did you add in your code the event listener? Or do I have to add it bcs I dont see it. thanks for the help trying it now. Just copied the code one on one with yours but still didn't work
 
10:42 PM
Yes, you have to updated your asp:RadioButtonList aspx code with mine
 
Just did but didnt work
 
@Bartfranken will you please show me what you have done? because I have tested my work, it is working. may be you are doing some thing wrong from your side
 
Yea sure I will update the code in original post
 
@Bartfranken when Update your code, please acknowledge me
 
Just updated it the code under the name Second update
 
10:42 PM
@Bartfranken what you get when you click on radio button?
 
Added the post with pictures to make it clear
 
@Bartfranken you are doing correct until now which you have show here, but for better understanding, will you please show me lbllogin, lblSignup and lblReset work, I think you are doing something wrong with it.
 
added the whole asp code with all lbl labels in one with comments with parts where is changes
 
Here I can't find asp:RadioButtonList where it is??
I have updated my code, which contain some of your code, and it's working fine, please check, may be this helps you.
 
I will check it now
 
10:42 PM
Yes remove that one
 
Still does not work
 
Ok will you please share whole file code, which you have test?
 
Updeated the whole code in original. And a little explaination about the javascript inserted
I made a new document file, without css javascript button etc... just the basics, and copied exact your code but that does stilll give the same error
 
please change SelectedButtonChange event with mine, which I have given in my answer, this is different from yours, I am using Value, but you have implemented old one, Text.
 
Sorry did indeed changed but still the same porblem, I was changing it to text to see if I could build it with ASP radiobutton instead of radiobuttonlist
 

last day (15 days later) »