Won't update dataset with new dropdownlist values

G

Geoff

I have a Webform with 2 dropdownlists and 2 text fields for the date. No
matter what I select in the drop downlist, when I hit the submit button the
data always comes up with the original values that were in the dropdownlists
however the date parameters are accepted. The dropdownlist also go back to
their original values instead of maintaining the values selected. My submit
code is as follows:
SqlDataAdapter1.SelectCommand.Parameters("@varSD").Value =
DateTime.Parse(fld_SD.Text)

SqlDataAdapter1.SelectCommand.Parameters("@varED").Value =
DateTime.Parse(fld_ED.Text)

SqlDataAdapter1.SelectCommand.Parameters("@varSN").Value =
Int32.Parse(lst_Store.SelectedValue)

SqlDataAdapter1.SelectCommand.Parameters("@varRN").Value =
Int32.Parse(lst_Report.SelectedValue)

SqlDataAdapter1.SelectCommand.Parameters("@varUno").Value =
Request.Cookies("ckusername").Value

SqlDataAdapter1.Fill(Ds_crdata2)

UltraWebGrid1.DataBind()
 
C

Curt_C [MVP]

how/where are you populating the DDL's? Try throwing a if(!IsPostBack)
around it
 
G

Geoff

How easy. I was populating the DDLs in the page load event. I just added:
"If Not (IsPostBack) Then" at the beginning of the page load event.
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top