Re: Problem with dropdownlist

  •  10-28-2008, 6:20 PM

    Re: Problem with dropdownlist

    Ken, I copied your code into my website - it worked fine.

    I then split the code between the aspx part and a aspx.cs (code behind) part - it worked fine.

    I then commented out the "onload" event which databind the values to the dropdownlist. I added my SqlDataSource and linked it to the dropdownlist. I left the other code in the aspx.cs page the same so it displayed the value of the dropdownlist into the editor on selectedindexchanged - again everything works fine.

    I then added this code to the Editor1_PostBackCommand
            this.SqlDataSource1.UpdateParameters["PageName"].DefaultValue = DropDownList1.SelectedItem.Text;
            this.SqlDataSource1.UpdateParameters["HTML"].DefaultValue = Editor1.Text;
            this.SqlDataSource1.Update();

    At this point it stops working - every time the save button is pressed the dropdownlist goes back to the top item in the list.

     

View Complete Thread