SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict inverse.chi's Avatar
    Join Date
    May 2006
    Location
    Oxford, UK | Durham, UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DropDownList problems

    Hi,

    it's been a while since i've posted on these forums.

    I have two dropdownlists that are being bound to SQLDataSources
    One is bound as such:

    CustomerCode = DataValueField
    CustomerCode = DataTextField

    the other is:

    CustomerCode = DataValueField
    CustomerName = DataTextField

    I want to make one update the other if the other one is selected. I have managed to implement this on a separate page using:

    Code:
        protected void ddlCustomerCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlCustomerCodeDesc.SelectedValue = ddlCustomerCode.SelectedValue;
        }
        protected void ddlCustomerCodeDesc_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlCustomerCode.SelectedValue = ddlCustomerCodeDesc.SelectedValue;
        }
    and this works fine.


    How would i make this AJAX enabled so that it wouldn't cause a whole page refresh?

    I think i'm going to have to go into all the code that my coworker has written for the ddlCustomerCode and see what triggers this handles to see why it's not working on the required page.
    Malachi Soord
    Something will come here

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use a updatepanel. I personally dont like to use those though, so I usually implement the ICallbackEventHandler Interface.
    Web Application Development & Maintenance


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •