when i m select any option in radiobutton list that time my asp.net button is visible=true

Posted by Sagarp under ASP.NET on 12/3/2009 | Views : 1686 | Status : [Member] | Replies : 6
HI



i have try to do when i m select any option in radiobutton list that time my asp.net button is visible=true ,tell what i do?
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem >min</asp:ListItem>
<asp:ListItem>hour</asp:ListItem>
<asp:ListItem>daily</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button2" runat="server" Text="Button" />

Code:
page lode
{
Button2.Visible =false

}

when i have select any option in RadioButtonList1that time for ex: i m select option min that time my Button2.Visible = true to
Thanks
sagar

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/



Responses

Posted by: Vuyiswamb on: 12/3/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
i really dont know what you are saying. Please try and Explain Clearly.

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 12/3/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
if i understand you correctly you have a Button and you want to make it invinsible on page load and when someone Clicks the Radio buttons it should show the Button ? The First Change this and make it look like this


<asp:RadioButtonList AutoPostBack="true" ID="RadioButtonList1" runat="server">
<asp:ListItem >min</asp:ListItem>
<asp:ListItem>hour</asp:ListItem>
<asp:ListItem>daily</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button2" Visible ="false" runat="server" Text="Button" />


and Double Click the RadioButtonlist to show you the event

protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
Button2.Visible = true;
}
}


and show it as i did in the above code. Remove the Code that you have added in the page load it will serve no Purpose.

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 12/3/2009 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
If you want to postback the page when any change is made in Radiobuttonlist, you might add autopostback="true" like this :

<asp:RadioButtonList ID="rdbtn1" runat="server" AutoPostBack="true"  OnSelectedIndexChanged="rdbtn1_SelectedIndexChanged">

<asp:ListItem >min</asp:ListItem>
<asp:ListItem>hour</asp:ListItem>
<asp:ListItem>daily</asp:ListItem>
</asp:RadioButtonList>

<asp:Button ID="btn" Visible ="false" runat="server" Text="Button" />

Put AutoPostBack = "true" for your RadioButtonList and then

In codebehind add this :
protected void rdbtn1_SelectedIndexChanged(object sender, EventArgs e)

{
this.btn.Visible = true;
}


Hope you got the point.
Cheers


www.abhisheksur.com

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 12/3/2009 [Member] Bronze

Up
0
Down
thx abhijit plz send me ur mail id,

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 12/4/2009 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
I am not Abhijit, I am abhishek...


To find my mail id, just search in google by my name "Abhishek Sur" you will get that automatically. :)

www.abhisheksur.com

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 12/4/2009 [Member] Bronze

Up
0
Down
ok

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response