Get Confirm response in code

C

chris

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.
 
V

ValliM

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/NingLiangSimpleControl.asp

Regards.

Valli,

www.syncfusion.com
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top