473,804 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get Confirm response in code

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 ClientScriptMan ager = Page.ClientScri pt

If (Not cspt.IsStartupS criptRegistered (Me.GetType(), "confirm"))
Then cspt.RegisterSt artupScript(Me. GetType(), "confirm",
"confirm('" & vsp_message_tex t & "' );", 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
1 2461
Hi Chris,

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

bnEdit.Attribut es.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.goo glegroups.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 ClientScriptMan ager = Page.ClientScri pt

If (Not cspt.IsStartupS criptRegistered (Me.GetType(), "confirm"))
Then cspt.RegisterSt artupScript(Me. GetType(), "confirm",
"confirm('" & vsp_message_tex t & "' );", 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6597
by: J Sahoo | last post by:
I have an asp button on my form. If user clicks the button then my Javascript code Confirm pops up with "Ok" & "Cancel" button. If the user clicks "Ok" from my pop-up then I do my vbMethod doApproveIt(). This works great if the Javascript returns true and I show the message that the record is approved. But if the user does not select "OK", chooses "cancel" button then doApproveIt() method never executes. What I want is, how can I get the...
13
5679
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I have created an Is_Dirty routine checking for field changes on my page then if the user clicks on the "exit" button I check for Is_Dirty = true and want to ask then "do you want to exit without saving?". It's a code behind where if the value of...
3
3830
by: ad | last post by:
I want user can confirm before delete records ? How can I show a confirm dialog when users press a button?
1
3832
by: freshRecruit | last post by:
Hi, I am having a problem, and is driving me nuts and my deadline is fast approaching. Please do help me.. This is a webapplication with a usercontrol which has some buttons for adding, deleting and updating to a database. When the user clicks the "Add" button than the information provided is validated against the database. If the validation succeeds than the information is added to the database. If not a confirm box is shown and if...
8
33707
by: Dave | last post by:
Hello all, I have been able to use a Javascript alert box in my vb.net web application, for example: Dim msg As String = "Hello, world." Dim alertScript As String = "<script language=JavaScript runat=server>" alertScript &= "alert('" & msg & "');" alertScript &= "</script>"
5
3072
by: Dave | last post by:
I'm tearing my hair out over this one. Using VS 2003, inline (not code-behind), vb.net. I have a button (btnClear) that calls a vb routine that goes into sql server and truncates a table. What I want is to call a javascript confirm box upon clicking the button that asks the user if he's sure he wants to do the deed. I have tried so many permutations and combinations of RegisterClientScriptBlock, <input
1
7791
by: manika02 | last post by:
Hi, I want to add a JavaScript confirmation box on a DropDown. I want to display the confirmation box only when a particular value is selected. I check this condition in selectedindexchanged event as below. As shown I try both "Response.Write" and "Page.RegisterStartUpScript" but the control always goes past the javascript to the next statement irrespective of whether I select "OK" or "Cancel" in the confirm box. Please help
8
4036
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form has a Button. When the Button is clicked, I want a JavaScript confirm dialog to pop-up with the options 'OK' & 'Cancel'. I have done this using the following code: Sub Page_Load(....) btnClick.Attributes.Add("OnClick", "javascript:return...
7
5212
by: shil | last post by:
Hi all, Can any one direct me in how to use javascript confirm() function when a condition is met from codebehind. I don't want to attach this to a button. When I submit the page, I want to check some business rules, and based on the response from the database, if the response is Yes, I need to display a confirmation alert to user. When the user clicks ok, then I should take an action, if not, exit out of the subroutine. Below is the...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10603
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.