By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,107 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,107 IT Pros & Developers. It's quick & easy.

Get Confirm response in code

P: n/a
Hi,

In ASP.NET page, when my user tries to edit a record in gridview, I
need to display a confirmation message, if another user is editing the
same record. Since the confirmation message will not be displayed on a
button click, I am using the following:

'check whether another user is editing record

IF another user is editing record THEN
Dim cspt As ClientScriptManager = Page.ClientScript

If (Not cspt.IsStartupScriptRegistered(Me.GetType(), "confirm"))
Then cspt.RegisterStartupScript(Me.GetType(), "confirm",
"confirm('" & vsp_message_text & "' );", True)
End If

IF CONFIRM = YES Then
ELSE

Can I retrieve the answer from confirm message in any way ? If not, is
there another way of doing this ? I tried with showing as modalwindow
one custom confirm form I created but the problem is that statements
after IF CONFIRM = YES Then are executed before custom confirm form is
displayed.

Thanks a lot in advance.

Jun 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Chris,

To display a confirmation message we can use the server side code that uses
javascript.

bnEdit.Attributes.Add("onclick",
"return(confirm('SomeOne Editing?'));");

Here this syntax works only when Ok button is clicked. If we click cancel
there will be no postback.

If you want to fire some event on clicking the cancel, u can code ur own
messages box . You can get an idea from

http://www.codeproject.com/aspnet/Ni...pleControl.asp

Regards.

Valli,

www.syncfusion.com

"chris" <CL*****@gmail.com> wrote in message
news:11**********************@y41g2000cwy.googlegr oups.com...
Hi,

In ASP.NET page, when my user tries to edit a record in gridview, I
need to display a confirmation message, if another user is editing the
same record. Since the confirmation message will not be displayed on a
button click, I am using the following:

'check whether another user is editing record

IF another user is editing record THEN
Dim cspt As ClientScriptManager = Page.ClientScript

If (Not cspt.IsStartupScriptRegistered(Me.GetType(), "confirm"))
Then cspt.RegisterStartupScript(Me.GetType(), "confirm",
"confirm('" & vsp_message_text & "' );", True)
End If

IF CONFIRM = YES Then
ELSE

Can I retrieve the answer from confirm message in any way ? If not, is
there another way of doing this ? I tried with showing as modalwindow
one custom confirm form I created but the problem is that statements
after IF CONFIRM = YES Then are executed before custom confirm form is
displayed.

Thanks a lot in advance.

Jun 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.