Popup dialog box - confirmations

D

Darrin

Hello,

I have a page (schedule.aspx) that a user fills out various information such
as times, dates, location, etc. After the user fills in the information they
would click the save but and in my vb.net code I first go out to the database
and check to make sure there are no scheduling conflicts. If there isn't
then it saves the record. If there is a scheduling conflict (this is what I
am having the issues with) I would like to throw up a dialog box telling the
user there is a conflict and ask if they would like to override. If they
click "NO" no records are saved and they are back to the schedule.aspx page.
However, if they click "YES" then I would continue with my vb.net code to
save the schudule record to the database.

This is my issue:
I am having problems coming up with a solution to throw up the popup/dialog
message and return if the user clicked "Yes" or "no". I thought I could use
the (SAVE)button attributes on the click event but I cannot do this because I
only want to throw up the popup/dialog if a conflict is found. I also tried
to put some javascript in but found you cannot have return statements within
a vb.net procedure.

Hopefully I was clear enough on what I am after. Any suggestions or ideas
would be helpful.

Thanks,

Darrin
 
R

Robert Koritnik

Create a web user control that has a method ConfirmMessage(string message),
a bool property IsConfirmed and an aditional hidden field.

By default the visibility of your control should be set to false. If the
method gets called the visibility of the control must be set to true and a
javascript should execute on the client side to open the window.confirm()
box (if that is what you wish). If the user presses yes or no, javascript
wites true/false to the hidden field and postbacks the form. Your control by
itself examines the value of the hidden field and sets the property
IsConfirmed acordingly.

Your page checks the property and does the appropriate thing.

But make shure you put your user control right before the ending </form> tag
in your ASPX.

Maybe I missed something, but the idea is clearly understandable in this
scenario...
 
D

Darrin

Thanks for the input. I will give it a try!

Robert Koritnik said:
Create a web user control that has a method ConfirmMessage(string message),
a bool property IsConfirmed and an aditional hidden field.

By default the visibility of your control should be set to false. If the
method gets called the visibility of the control must be set to true and a
javascript should execute on the client side to open the window.confirm()
box (if that is what you wish). If the user presses yes or no, javascript
wites true/false to the hidden field and postbacks the form. Your control by
itself examines the value of the hidden field and sets the property
IsConfirmed acordingly.

Your page checks the property and does the appropriate thing.

But make shure you put your user control right before the ending </form> tag
in your ASPX.

Maybe I missed something, but the idea is clearly understandable in this
scenario...
 

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,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top