Problem in using Ajax with ASP pls hel

Discussion in 'C#' started by sumit_banderwal, Jul 19, 2009.

  1. #1
    Hi, all
    I have three list box. I want to populate one list box when i change the value of another list box through ajax i.e without submitting the whole page.

    Pls help me out
     
    sumit_banderwal, Jul 19, 2009 IP
  2. ChaosTrivia

    ChaosTrivia Active Member

    Messages:
    2,093
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    65
    #2
    Welcome to DP. Here are the guidelines for your solution:

    <asp:ScriptManager ID="ScriptManager1" runat="server"/>
    <<asp:UpdatePanel ID="sumit_banderwalUpdatePanel" runat="server" UpdateMode="Conditional">
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="ListBox1" EventName="xxxx" />
    </Triggers>
    <ContentTemplate>
    <asp:ListBox1 ...... />
    <asp:ListBox2 ...... />
    <asp:ListBox3 ...... />
    </ContentTemplate>
    </asp:UpdatePanel>

    code behind, Page_Load
    {
    .....
    if (IsInAsyncPostBack)
    {
    Read ListBox1, Set ListBox2+3 accordingly
    }
    ....
    sumit_banderwalUpdatePanel.Update()
    }

    (find the name of the change event, i was lazy)
    :D
     
    ChaosTrivia, Jul 19, 2009 IP