[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Re: Re: radiobutton click and avoid page refresh

Sarah

2/15/2011 11:48:00 AM

works on my case! I need to open a new page and keep old page not refresh some divs.
Thanks very much!

> On Tuesday, December 02, 2008 10:29 AM rum2 wrote:

> I have a list of radio buttons on a page like this
>
>
> <asp:UpdatePanel ID="updAuthoptions" runat="server">
> <ContentTemplate>
>
> <asp:Panel ID="panelAuthorizationType" runat="server">
> <table>
> <tr>
> <td>
> <asp:RadioButton ID="RadioButton1"
> GroupName="rbAuthType" runat="server" Text="radio 1"
>
> OnCheckedChanged="RadioButton1_CheckedChanged" AutoPostBack="true">
> </asp:RadioButton>
> </td>
> </tr>
> <tr>
> <td>
> <asp:RadioButton ID="RadioButton2"
> GroupName="rbAuthType" runat="server" Text="radio 2"
>
> OnCheckedChanged="RadioButton2_CheckedChanged" AutoPostBack="true">
> </asp:RadioButton>
> </td>
> </tr>
> <tr>
> <td>
> <asp:RadioButton ID="RadioButton3"
> GroupName="rbAuthType" runat="server" Text="radio 3"
>
> OnCheckedChanged="RadioButton3_CheckedChanged" AutoPostBack="true">
> </asp:RadioButton>
> </td>
> </tr>
> </table>
> </asp:panel>
> </ContentTemplate>
> <Triggers>
> <asp:AsyncPostBackTrigger ControlID="RadioButton1"
> EventName="RadioButton1_CheckedChanged" />
> <asp:AsyncPostBackTrigger ControlID="RadioButton2"
> EventName="RadioButton2_CheckedChanged" />
> <asp:AsyncPostBackTrigger ControlID="RadioButton3"
> EventName="RadioButton3_CheckedChanged" />
> </Triggers>
> </asp:UpdatePanel>
>
> Based on the radio button click, I will be enabling/disabling other controls
> on the page. Now, I want to do the enabling and disabling of controls without
> the page refresh. However, with the code above, the page refreshes whenever
> radiobutton1 or radiobutton2 or radiobutton3 is clicked. If I don't set the
> Autopoastback, the event is not even firing. What wrong am I doing? please
> help.
>
> Thanks!


>> On Wednesday, December 03, 2008 7:42 PM Nathan Sokalski wrote:

>> Try adding the following properties to your UpdatePanel:
>>
>> <asp:UpdatePanel ID="updAuthoptions" runat="server"
>> ChildrenAsTriggers="false" UpdateMode="Conditional">
>>
>> By default, any child controls (anything in the ContentTemplate) are
>> automatically added as Triggers. You can use the ChildrenAsTriggers property
>> to change this. Also, by default the controls in the UpdatePanel are updated
>> on every postback. You can set the UpdateMode property to "Conditional" to
>> specify that it should only be updated when triggered by one of the
>> Triggers. I nearly always use ChildrenAsTriggers="false" and
>> UpdateMode="Conditional" because it gives you more control over the
>> functionality, but depending on the purpose of the pages you are writing
>> your usage may be different. A great book on ASP.NET AJAX, which is where I
>> learned the info I have given you above, is "Introducing Microsoft ASP.NET
>> AJAX" by Dino Esposito from Microsoft Press. Hopefully this helps.
>> --
>> Nathan Sokalski
>> njsokalski@hotmail.com
>> http://www.nathansok...
>>
>> "rum23" <rum23@discussions.microsoft.com> wrote in message
>> news:9241C0D7-C101-4854-BAAE-C3DF8C14AC7D@microsoft.com...


>>> On Tuesday, January 06, 2009 1:13 PM misunderstoo wrote:

>>> Hi,
>>> I have the same issue with radio buttons. I tried <asp:UpdatePanel
>>> ID="updAuthoptions" runat="server"
>>> My requirement is that another set radiobuttons(in a panel) need to get
>>> enabled when an option is chosen from the first radio button list .
>>> The page doesn't jump, but then the 2nd set of radiobuttons does not get
>>> enabled, although the control goes to its selected index changed event.
>>> Could you tell me if I am missing anything?
>>>
>>> "Nathan Sokalski" wrote:


>>>> On Wednesday, January 07, 2009 12:32 AM Nathan Sokalski wrote:

>>>> It may be easier for me to help you if you post your current code. Until
>>>> then, it sounds like you need to use the Triggers control of the UpdatePanel
>>>> to use the first RadioButtonList as a Trigger. If you post your code I can
>>>> show you how you should do this for your situation. Good Luck!
>>>> --
>>>> Nathan Sokalski
>>>> njsokalski@hotmail.com
>>>> http://www.nathansok...
>>>>
>>>> "misunderstood" <misunderstood@discussions.microsoft.com> wrote in message
>>>> news:59D648F5-7E6E-4E23-98BC-52EB385E194B@microsoft.com...


>>>> Submitted via EggHeadCafe
>>>> ASP.NET Generic Cookie Utility Class
>>>> http://www.eggheadcafe.com/tutorials/aspnet/e7108c33-1cc6-48ae-9f65-cc391c8b66a7/aspnet-generic-cookie-utility-...
2 Answers

misunderstood

1/6/2009 6:13:00 PM

0

Hi,
I have the same issue with radio buttons. I tried <asp:UpdatePanel
ID="updAuthoptions" runat="server"
> ChildrenAsTriggers="false" UpdateMode="Conditional">.
My requirement is that another set radiobuttons(in a panel) need to get
enabled when an option is chosen from the first radio button list .
The page doesn't jump, but then the 2nd set of radiobuttons does not get
enabled, although the control goes to its selected index changed event.
Could you tell me if I am missing anything?

"Nathan Sokalski" wrote:

> Try adding the following properties to your UpdatePanel:
>
> <asp:UpdatePanel ID="updAuthoptions" runat="server"
> ChildrenAsTriggers="false" UpdateMode="Conditional">
>
> By default, any child controls (anything in the ContentTemplate) are
> automatically added as Triggers. You can use the ChildrenAsTriggers property
> to change this. Also, by default the controls in the UpdatePanel are updated
> on every postback. You can set the UpdateMode property to "Conditional" to
> specify that it should only be updated when triggered by one of the
> Triggers. I nearly always use ChildrenAsTriggers="false" and
> UpdateMode="Conditional" because it gives you more control over the
> functionality, but depending on the purpose of the pages you are writing
> your usage may be different. A great book on ASP.NET AJAX, which is where I
> learned the info I have given you above, is "Introducing Microsoft ASP.NET
> AJAX" by Dino Esposito from Microsoft Press. Hopefully this helps.
> --
> Nathan Sokalski
> njsokalski@hotmail.com
> http://www.nathansok...
>
> "rum23" <rum23@discussions.microsoft.com> wrote in message
> news:9241C0D7-C101-4854-BAAE-C3DF8C14AC7D@microsoft.com...
> >I have a list of radio buttons on a page like this
> >
> >
> > <asp:UpdatePanel ID="updAuthoptions" runat="server">
> > <ContentTemplate>
> >
> > <asp:Panel ID="panelAuthorizationType" runat="server">
> > <table>
> > <tr>
> > <td>
> > <asp:RadioButton ID="RadioButton1"
> > GroupName="rbAuthType" runat="server" Text="radio 1"
> >
> > OnCheckedChanged="RadioButton1_CheckedChanged" AutoPostBack="true">
> > </asp:RadioButton>
> > </td>
> > </tr>
> > <tr>
> > <td>
> > <asp:RadioButton ID="RadioButton2"
> > GroupName="rbAuthType" runat="server" Text="radio 2"
> >
> > OnCheckedChanged="RadioButton2_CheckedChanged" AutoPostBack="true">
> > </asp:RadioButton>
> > </td>
> > </tr>
> > <tr>
> > <td>
> > <asp:RadioButton ID="RadioButton3"
> > GroupName="rbAuthType" runat="server" Text="radio 3"
> >
> > OnCheckedChanged="RadioButton3_CheckedChanged" AutoPostBack="true">
> > </asp:RadioButton>
> > </td>
> > </tr>
> > </table>
> > </asp:panel>
> > </ContentTemplate>
> > <Triggers>
> > <asp:AsyncPostBackTrigger ControlID="RadioButton1"
> > EventName="RadioButton1_CheckedChanged" />
> > <asp:AsyncPostBackTrigger ControlID="RadioButton2"
> > EventName="RadioButton2_CheckedChanged" />
> > <asp:AsyncPostBackTrigger ControlID="RadioButton3"
> > EventName="RadioButton3_CheckedChanged" />
> > </Triggers>
> > </asp:UpdatePanel>
> >
> > Based on the radio button click, I will be enabling/disabling other
> > controls
> > on the page. Now, I want to do the enabling and disabling of controls
> > without
> > the page refresh. However, with the code above, the page refreshes
> > whenever
> > radiobutton1 or radiobutton2 or radiobutton3 is clicked. If I don't set
> > the
> > Autopoastback, the event is not even firing. What wrong am I doing? please
> > help.
> >
> > Thanks!
>
>
>

Nathan Sokalski

1/7/2009 5:33:00 AM

0

It may be easier for me to help you if you post your current code. Until
then, it sounds like you need to use the Triggers control of the UpdatePanel
to use the first RadioButtonList as a Trigger. If you post your code I can
show you how you should do this for your situation. Good Luck!
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansok...

"misunderstood" <misunderstood@discussions.microsoft.com> wrote in message
news:59D648F5-7E6E-4E23-98BC-52EB385E194B@microsoft.com...
> Hi,
> I have the same issue with radio buttons. I tried <asp:UpdatePanel
> ID="updAuthoptions" runat="server"
>> ChildrenAsTriggers="false" UpdateMode="Conditional">.
> My requirement is that another set radiobuttons(in a panel) need to get
> enabled when an option is chosen from the first radio button list .
> The page doesn't jump, but then the 2nd set of radiobuttons does not get
> enabled, although the control goes to its selected index changed event.
> Could you tell me if I am missing anything?
>
> "Nathan Sokalski" wrote:
>
>> Try adding the following properties to your UpdatePanel:
>>
>> <asp:UpdatePanel ID="updAuthoptions" runat="server"
>> ChildrenAsTriggers="false" UpdateMode="Conditional">
>>
>> By default, any child controls (anything in the ContentTemplate) are
>> automatically added as Triggers. You can use the ChildrenAsTriggers
>> property
>> to change this. Also, by default the controls in the UpdatePanel are
>> updated
>> on every postback. You can set the UpdateMode property to "Conditional"
>> to
>> specify that it should only be updated when triggered by one of the
>> Triggers. I nearly always use ChildrenAsTriggers="false" and
>> UpdateMode="Conditional" because it gives you more control over the
>> functionality, but depending on the purpose of the pages you are writing
>> your usage may be different. A great book on ASP.NET AJAX, which is where
>> I
>> learned the info I have given you above, is "Introducing Microsoft
>> ASP.NET
>> AJAX" by Dino Esposito from Microsoft Press. Hopefully this helps.
>> --
>> Nathan Sokalski
>> njsokalski@hotmail.com
>> http://www.nathansok...
>>
>> "rum23" <rum23@discussions.microsoft.com> wrote in message
>> news:9241C0D7-C101-4854-BAAE-C3DF8C14AC7D@microsoft.com...
>> >I have a list of radio buttons on a page like this
>> >
>> >
>> > <asp:UpdatePanel ID="updAuthoptions" runat="server">
>> > <ContentTemplate>
>> >
>> > <asp:Panel ID="panelAuthorizationType" runat="server">
>> > <table>
>> > <tr>
>> > <td>
>> > <asp:RadioButton
>> > ID="RadioButton1"
>> > GroupName="rbAuthType" runat="server" Text="radio 1"
>> >
>> > OnCheckedChanged="RadioButton1_CheckedChanged" AutoPostBack="true">
>> > </asp:RadioButton>
>> > </td>
>> > </tr>
>> > <tr>
>> > <td>
>> > <asp:RadioButton
>> > ID="RadioButton2"
>> > GroupName="rbAuthType" runat="server" Text="radio 2"
>> >
>> > OnCheckedChanged="RadioButton2_CheckedChanged" AutoPostBack="true">
>> > </asp:RadioButton>
>> > </td>
>> > </tr>
>> > <tr>
>> > <td>
>> > <asp:RadioButton
>> > ID="RadioButton3"
>> > GroupName="rbAuthType" runat="server" Text="radio 3"
>> >
>> > OnCheckedChanged="RadioButton3_CheckedChanged" AutoPostBack="true">
>> > </asp:RadioButton>
>> > </td>
>> > </tr>
>> > </table>
>> > </asp:panel>
>> > </ContentTemplate>
>> > <Triggers>
>> > <asp:AsyncPostBackTrigger ControlID="RadioButton1"
>> > EventName="RadioButton1_CheckedChanged" />
>> > <asp:AsyncPostBackTrigger ControlID="RadioButton2"
>> > EventName="RadioButton2_CheckedChanged" />
>> > <asp:AsyncPostBackTrigger ControlID="RadioButton3"
>> > EventName="RadioButton3_CheckedChanged" />
>> > </Triggers>
>> > </asp:UpdatePanel>
>> >
>> > Based on the radio button click, I will be enabling/disabling other
>> > controls
>> > on the page. Now, I want to do the enabling and disabling of controls
>> > without
>> > the page refresh. However, with the code above, the page refreshes
>> > whenever
>> > radiobutton1 or radiobutton2 or radiobutton3 is clicked. If I don't set
>> > the
>> > Autopoastback, the event is not even firing. What wrong am I doing?
>> > please
>> > help.
>> >
>> > Thanks!
>>
>>
>>