Novice question

G

Greg Smith

Hi I have what I am sure is a really stupid question, but, here goes.

I am creating a database application. To allow people to edit records, I
run a stored procedure and populate the text boxes on the form. After the
data is edited I try to run a stored procedure to update the record. The
problem is the click event on the button posts back to the server before the
stored procedure runs and I get back the original data before the save.

How do I turn this off?


Any help is greatly appreciated.
 
G

Greg Smith

Thank you for your response Karl. I see how that would work in the case of
the dropdown list but I am having trouble applying it to what I what to do.

I want to run a function on a button click but the Post Back is returning
the data to it's original state before my code can save the editing data.

Any other ideas?
 
K

Karl Seguin

Greg:
Some code might be helpful. But I gotta stick with my original
recommendation. You say "Post back is returning the data to it's orignal
state"...but that must be because you are telling it to do that. In your
Page_Load you must be setting data to it's state. Remember, on Postback,
Page_Load fires first, then the button's click event handler.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top