tags:

views:

35

answers:

2

Hi,

I have a Jquery dialog with an ASP listview control inside. Before showing the dialog the listview is already filled on Page_Load, but I want to change this. I want to fill the listview when a dropdownlist is changed in the .aspx page, which triggers a postback to databind the listview.

The problem I'm having now is, when I want the dialog to be shown with the listview inside, the listview is still showing show the data I've binded on Page_Load.

How can I show the up-to-date listview inside my dialog after a postback?

Code to fill listview:

        string conString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLCONN"].ToString();
    SqlConnection conn = new SqlConnection(conString);
    string cmdstr = "querystring";
    DataSet ds = new DataSet();
    SqlDataAdapter da = new SqlDataAdapter(cmdstr, conn);
    da.Fill(ds, "PlanningWagen");
    lvPlanningWagen.DataSource = ds;
    lvPlanningWagen.DataBind();

The querystring is right. Depending on whats selected in the ddl, the right records are always filled in the dataset. I've checked that.

Thx

A: 

The problem could be either with jQuery or ASP code. Do a debugging session with the dialog div always visible, so that you are sure there is nothing wrong with your ASP code. Are you sure for example that the dropdown list is configured to do a post-back automatically when the selection is changed?

kgiannakakis
The problem is the listview isn't filled after the postback. I've added the code I use to fill my listview which is triggered by the ddl_Change.
Ben
A: 

I solved the problem by placing the content of the jquery in an updatepanel.

Ben