dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: RadioButtonList trigger not working in content page

  1. #1
    Join Date
    Jun 2004
    Posts
    19

    Exclamation RadioButtonList trigger not working in content page

    Hi,

    I'm using ajax in my content page which contain several control in page. It could be like dropdownlist, button, gridview and radiobuttonlist. All control is working find except the radiobuttonlist, it always do the postback. Since I'm using master page to control all content page, I have no idea why is not functioning? Therefore, I create a single page without inherit the masterpage, the radiobuttonlist is working. So is it the masterpage problem?

    Part of the code:

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
    <Triggers>
    <atlas:ControlValueTrigger ControlID="RadioButtonList" PropertyName="SelectedValue" />
    <atlas:ControlEventTrigger ControlID="Button" EventName="Click" />
    <atlas:ControlValueTrigger ControlID="DropDownList" PropertyName="SelectedValue" />
    </Triggers>
    <ContentTemplate>
    .
    .
    </ContentTemplate>
    </atlas:UpdatePanel>
    </asp:Content>


    Any help will be appreciate.
    Calvin

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    When you say "not working" or "not functioning" what exactly does that mean?

    Are you getting errors?

  3. #3
    Join Date
    Jun 2004
    Posts
    19
    It postbact (refresh) the whole page.

  4. #4
    Join Date
    Jun 2004
    Posts
    19
    Single page without inherit master page where postback without "Refresh the whole page"

    HTML Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Settings_TimeTable_Default" %>
    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Test RadioButtonList Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
    <ErrorTemplate>
    Something Wrong to Script Manager
    </ErrorTemplate>
    </atlas:ScriptManager>
    <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional">
    <ContentTemplate>
    <asp:RadioButtonList ID="rblTest" runat="server" AutoPostBack="True" OnSelectedIndexChanged="rblTest_SelectedIndexChanged"
    RepeatDirection="Horizontal">
    <asp:ListItem>Hide</asp:ListItem>
    <asp:ListItem>UnHide</asp:ListItem>
    </asp:RadioButtonList>&nbsp;
    <asp:Label ID="lblMsg" runat="server" Text="Test Partial Rendering"></asp:Label>
    </ContentTemplate>
    </atlas:UpdatePanel>
    </form>
    </body>
    </html>

    Code Behind:
    Partial Class Settings_TimeTable_Default
    Inherits System.Web.UI.Page

    Protected Sub rblTest_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    Select Case rblTest.SelectedValue
    Case "Hide"
    lblMsg.Visible = False
    Case "UnHide"
    lblMsg.Visible = True
    End Select
    End Sub
    End Class


    -------------------------------------------------------------------------
    A page inherit master page where postback "Refresh the whole page"

    HTML Code:
    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Copy of Default.aspx.vb" Inherits="Settings_TimeTable_Default" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <atlas:UpdateProgress ID="UpdateProgress1" runat="server">
    <ProgressTemplate>
    <div id="progressBackgroundFilter"></div>
    <div id="processMessage"><br /><br />
    <asp:Image ID="ImgLoading" runat="server" SkinID="ImgLoading" />
    </div>
    </ProgressTemplate>
    </atlas:UpdateProgress>


    <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional">
    <ContentTemplate>
    <asp:RadioButtonList ID="rblTest" runat="server" AutoPostBack="True" OnSelectedIndexChanged="rblTest_SelectedIndexChanged"
    RepeatDirection="Horizontal">
    <asp:ListItem>Hide</asp:ListItem>
    <asp:ListItem>UnHide</asp:ListItem>
    </asp:RadioButtonList>&nbsp;
    <asp:Label ID="lblMsg" runat="server" Text="Test Partial Rendering"></asp:Label>
    </ContentTemplate>
    </atlas:UpdatePanel>

    </asp:Content>

    Code Behind:

    Partial Class Settings_TimeTable_Default
    Inherits System.Web.UI.Page

    Protected Sub rblTest_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    Select Case rblTest.SelectedValue
    Case "Hide"
    lblMsg.Visible = False
    Case "UnHide"
    lblMsg.Visible = True
    End Select
    End Sub
    End Class

  5. #5
    Join Date
    Jun 2004
    Posts
    19
    Oh, I omit to upload this part, but it still not working!

    .....
    </ContentTemplate>

    <Triggers> <---Omitted Part
    <atlas:ControlValueTrigger ControlID="rblTest" PropertyName="SelectedValue" />
    </Triggers>

    </atlas:UpdatePanel>

  6. #6
    Join Date
    Jun 2004
    Posts
    19

    Question

    help !!!! any solution????

  7. #7
    Join Date
    Jun 2004
    Posts
    19
    Thanks for help. Finally found the solution. Since I'm migrate from ASP.NET 1.1 to 2.0 , I have no observe there is a field inside the web.config, which is <xhtmlConformance mode="Legacy"/>, so I remove the code from the file.

    Reference:
    "Don't use <xhtmlConformance mode="Legacy"/> with ASP.NET AJAX "
    http://weblogs.asp.net/scottgu/archi...-net-ajax.aspx

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Thanks for posting your solution.

    Hopefully it will help others with the same or similiar question.

Similar Threads

  1. Move the position of Content in a Web Page
    By Raj2007 in forum ASP.NET
    Replies: 1
    Last Post: 06-29-2007, 02:31 AM
  2. Loading Page Variables
    By hoyaabanks in forum ASP.NET
    Replies: 0
    Last Post: 02-26-2007, 04:46 PM
  3. Replies: 0
    Last Post: 05-08-2006, 08:02 PM
  4. Replies: 2
    Last Post: 03-16-2001, 10:56 AM
  5. Replies: 0
    Last Post: 01-23-2001, 08:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center