For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > June 2006 > Get Confirm response in code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Get Confirm response in code
chris

2006-06-30, 4:01 am

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.

ValliM

2006-06-30, 8:02 am

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/N...mpleControl.asp

Regards.

Valli,

www.syncfusion.com

"chris" <CLarkou@gmail.com> wrote in message
news:1151655781.195286.310760@y41g2000cwy.googlegroups.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.
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com