Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Maintainance of State


Message #1 by "Julian Roberts" <jules@c...> on Mon, 16 Dec 2002 15:47:57 -0000
I've got an asp:listbox on a page that is bound to data. I've also got a
client-side javascript function that can 'move' the options up or down the
list. The problem is that after submitting the form, the options revert back
to the original state. Anyone got any pointers on this? My codebehind looks
something like:

private void Page_Load(object sender, System.EventArgs e)
  {
   if (!IsPostBack)
   {
   int FormID=Convert.ToInt32(Request.QueryString["FormID"]);
   string strSQL="select * from " + Table + " where FormID=" +
FormID.ToString() + " and Active=1 order by RowOrder";
   DataSet ds = SqlHelper.ExecuteDataset(CommandType.Text,strSQL);
   DataTable dt=ds.Tables[0];
   list.DataTextField=Label;
   list.DataValueField=ID;
   list.DataSource=dt;
   list.DataBind();
   }

  }

--
Jules
http://www.charon.co.uk





  Return to Index