Issue with AJAX Update PANEL - PLEASE HELP!!!

Discussion in 'ASP .Net' started by vishal, May 21, 2008.

  1. vishal

    vishal Guest

    dFieldValidator ID="RequiredFieldValidator_topic" runat="server"
    ControlToValidate="DropDownList_Topic"
    ErrorMessage="Select a topic"
    Display="Dynamic" Width="130px"></asp:RequiredFieldValidator><br />
    </td>
    <td style="height: 50px;" colspan=""><asp:Label
    ID="Label_Param_Sat" Text='Sub-Topic :' runat="server" Height="19px"
    Width="96px" /></td>
    <td style="width: 233px; height: 50px;"
    colspan=""><asp:DropDownList ID="DropDownList_SubTopic" runat="server"
    Width="182px"></asp:DropDownList><br />
    </td>
    </tr>
    </ContentTemplate>
    <Triggers >

    <asp:AsyncPostBackTrigger ControlID ="DropDownList1" EventName
    ="SelectedIndexChanged" />

    </Triggers>
    </asp:UpdatePanel>


    Here is the code in my page behind vb file

    Public Sub DropDownList_Topic_SelectedIndexChanged(ByVal sender As
    Object, ByVal e As System.EventArgs) Handles
    DropDownList_Topic.SelectedIndexChanged
    Dim dr As DbDataReader
    Dim mySearchService As New DropDownService
    Dim strTextField As String = ""
    Dim strValueField As String = ""
    If (strCategory = "") Then
    strCategory = DropDownList_Search.SelectedItem.Value
    End If
    dr = mySearchService.GetsubtopicValues(strCategory,
    DropDownList_Topic.SelectedItem.Value, strTextField, strValueField)
    If (dr.HasRows()) Then
    DropDownList_SubTopic.DataTextField = strTextField
    DropDownList_SubTopic.DataValueField = strValueField
    DropDownList_SubTopic.DataSource = dr
    DropDownList_SubTopic.DataBind()

    DropDownList_SubTopic.Items.Insert(0, New ListItem("",
    ""))
    End If

    End Sub
    vishal, May 21, 2008
    #1
    1. Advertising

  2. vishal

    vishal Guest

    Re: Issue with AJAX Update PANEL - PLEASE HELP!!!

    On May 21, 4:09 pm, vishal <> wrote:
    > dFieldValidator ID="RequiredFieldValidator_topic" runat="server"
    > ControlToValidate="DropDownList_Topic"
    > ErrorMessage="Select a topic"
    > Display="Dynamic" Width="130px"></asp:RequiredFieldValidator><br />
    > </td>
    > <td style="height: 50px;" colspan=""><asp:Label
    > ID="Label_Param_Sat" Text='Sub-Topic :' runat="server" Height="19px"
    > Width="96px" /></td>
    > <td style="width: 233px; height: 50px;"
    > colspan=""><asp:DropDownList ID="DropDownList_SubTopic" runat="server"
    > Width="182px"></asp:DropDownList><br />
    > </td>
    > </tr>
    > </ContentTemplate>
    > <Triggers >
    >
    > <asp:AsyncPostBackTrigger ControlID ="DropDownList1" EventName
    > ="SelectedIndexChanged" />
    >
    > </Triggers>
    > </asp:UpdatePanel>
    >
    > Here is the code in my page behind vb file
    >
    > Public Sub DropDownList_Topic_SelectedIndexChanged(ByVal sender As
    > Object, ByVal e As System.EventArgs) Handles
    > DropDownList_Topic.SelectedIndexChanged
    > Dim dr As DbDataReader
    > Dim mySearchService As New DropDownService
    > Dim strTextField As String = ""
    > Dim strValueField As String = ""
    > If (strCategory = "") Then
    > strCategory = DropDownList_Search.SelectedItem.Value
    > End If
    > dr = mySearchService.GetsubtopicValues(strCategory,
    > DropDownList_Topic.SelectedItem.Value, strTextField, strValueField)
    > If (dr.HasRows()) Then
    > DropDownList_SubTopic.DataTextField = strTextField
    > DropDownList_SubTopic.DataValueField = strValueField
    > DropDownList_SubTopic.DataSource = dr
    > DropDownList_SubTopic.DataBind()
    >
    > DropDownList_SubTopic.Items.Insert(0, New ListItem("",
    > ""))
    > End If
    >
    > End Sub



    My apologies the original post didn't go through fine. I am having
    issues with using ajax with an asp.net page. I have 2 drop downs topic
    and subtopic and subtopic loads when I select a topic. I am using an
    updatepanel to make sure the entire page doesn't refresh/reload but
    this doesn't work. In my case the entire page ends up refreshing even
    though I've used an update panel. The load in the aspx file is as
    follows

    <ajaxToolkit:ToolkitScriptManager
    ID="ScriptManager1" EnablePartialRendering="true" runat="server"/>
    <asp:UpdatePanel runat="server" ID="up1"
    UpdateMode="Conditional">
    <ContentTemplate>
    <tr>

    <td style="height: 50px;" colspan=""><asp:Label
    ID="Label_Topic" Text='Topic :' runat="server" Height="22px"
    Width="92px" /></td>
    <td style="width: 277px; height: 50px;" colspan="">
    <br />
    <asp:DropDownList ID="DropDownList_Topic"
    runat="server" Width="182px" AutoPostBack="True"></
    asp:DropDownList><br />
    <asp:RequiredFieldValidator
    ID="RequiredFieldValidator_topic" runat="server"
    ControlToValidate="DropDownList_Topic"
    ErrorMessage="Select a topic"
    Display="Dynamic" Width="130px"></asp:RequiredFieldValidator><br />
    </td>
    <td style="height: 50px;" colspan=""><asp:Label
    ID="Label_Param_Sat" Text='Sub-Topic :' runat="server" Height="19px"
    Width="96px" /></td>
    <td style="width: 233px; height: 50px;"
    colspan=""><asp:DropDownList ID="DropDownList_SubTopic" runat="server"
    Width="182px"></asp:DropDownList><br />
    </td>
    </tr>
    </ContentTemplate>
    <Triggers >

    <asp:AsyncPostBackTrigger ControlID ="DropDownList1" EventName
    ="SelectedIndexChanged" />

    </Triggers>
    </asp:UpdatePanel>

    Thanks.
    vishal, May 21, 2008
    #2
    1. Advertising

  3. vishal

    Joe Guest

    Re: Issue with AJAX Update PANEL - PLEASE HELP!!!

    It seems your source is not complete. it is missing the Table Tag. I
    was unable to make it work when the Table tag was outside the
    UpdatePanel. When placed inside the contentTemplate it started
    working.

    -joe
    Joe, May 21, 2008
    #3
  4. vishal

    vishal Guest

    Re: Issue with AJAX Update PANEL - PLEASE HELP!!!

    On May 21, 11:40 pm, Joe <> wrote:
    > It seems your source is not complete. it is missing the Table Tag. I
    > was unable to make it work when the Table tag was outside the
    > UpdatePanel. When placed inside the contentTemplate it started
    > working.
    >
    > -joe


    Hi Joe,
    I changed the source to the following
    <ajaxToolkit:ToolkitScriptManager
    ID="ScriptManager1" EnablePartialRendering="true" runat="server"/>
    <asp:UpdatePanel runat="server" ID="up1"
    UpdateMode="Conditional">
    <ContentTemplate>
    <table border="1">
    <tr>

    <td style="height: 50px;" colspan=""><asp:Label
    ID="Label_Topic" Text='Topic :' runat="server" Height="22px"
    Width="92px" /></td>
    <td style="width: 277px; height: 50px;" colspan="">
    <br />
    <asp:DropDownList ID="DropDownList_Topic"
    runat="server" Width="182px" AutoPostBack="True"></
    asp:DropDownList><br />
    <asp:RequiredFieldValidator
    ID="RequiredFieldValidator_topic" runat="server"
    ControlToValidate="DropDownList_Topic"
    ErrorMessage="Select a topic"
    Display="Dynamic" Width="130px"></asp:RequiredFieldValidator><br />
    </td>
    <td style="height: 50px;" colspan=""><asp:Label
    ID="Label_Param_Sat" Text='Sub-Topic :' runat="server" Height="19px"
    Width="96px" /></td>
    <td style="width: 233px; height: 50px;"
    colspan=""><asp:DropDownList ID="DropDownList_SubTopic" runat="server"
    Width="182px"></asp:DropDownList><br />
    </td>
    </tr>
    </table>
    </ContentTemplate>
    <Triggers >

    <asp:AsyncPostBackTrigger ControlID ="DropDownList_Topic" EventName
    ="SelectedIndexChanged" />

    </Triggers>
    </asp:UpdatePanel>
    Note the table tags but this is still not working. This entire code is
    inside another table but the controls I don't want to refresh are
    inside the table tag but it still doesn't work. Please help.
    vishal, May 22, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?cm9kY2hhcg==?=

    datalist and ajax update panel

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 2, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    720
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 2, 2006
  2. =?Utf-8?B?cm9kY2hhcg==?=

    ajax update panel trigger

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    521
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 7, 2006
  3. GaryDean

    AJAX Update Panel w I.E.7 Problem

    GaryDean, Dec 4, 2006, in forum: ASP .Net
    Replies:
    10
    Views:
    5,018
    Steven Cheng[MSFT]
    Dec 12, 2006
  4. =?Utf-8?B?Qw==?=

    ASP.NET Ajax Update Panel in ContentPlaceHolder

    =?Utf-8?B?Qw==?=, Feb 12, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    1,303
    =?Utf-8?B?Qw==?=
    Feb 12, 2007
  5. Neeraj
    Replies:
    0
    Views:
    851
    Neeraj
    Apr 11, 2011
Loading...

Share This Page