1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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.
    SEMrush
    Pls help me out
     
    sumit_banderwal, Jul 19, 2009 IP
    SEMrush
  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