Can this be done

G

Guest

Hi,

I have a wab form that allows users to input customer information, when
users click submit, the web form insert or update a SQL table based on
whether the customer name already exists in table. This part is working fine.

Now the project manager wants me to pop up a javascript confirm box on the
client side to ask user to confirm overwriting existing infomation if
customer name already exists in the table. How do I do this?

I tried to user btnSubmit.Attributes.add("onclick",......), but this pops
up the confirm box no matter the customer name exists in the table or not.

TIA
 
K

Karl Seguin

you have the submit the form as you normally would, in teh button's click
event check if the user name exists, if it does, send the page back to the
client but make the popup appear, if the user clicks ok, resubmit the form
and force the overwrite.

Karl
 
G

Guest

Thank you for your response.

But I am still fuzzy about how this can be done. Say the customer exists, I
use RegisterStartupScript to pop up a javascript confirm box on client
side, if users click OK, do I use javascript to submit the form? Also once
the form has been resubmited, how would the server side ASP.Net codes know
it is the second submission?

Thanks Again!
 
N

Nicole Schenk

Ed said:
Thank you for your response.

But I am still fuzzy about how this can be done. Say the customer exists,
I
use RegisterStartupScript to pop up a javascript confirm box on client
side, if users click OK, do I use javascript to submit the form? Also once
the form has been resubmited, how would the server side ASP.Net codes
know it is the second submission?

Thanks Again!
Let me see, at the client you have conditionally generated code to popup an
alert (or confirm). If the user desires you must change some form variable
and cause a resubmit. The server then uses the form variable to guide its
next action.
 

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,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top