Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Cofirmation box

Author  Topic 

salmonraju
Yak Posting Veteran

54 Posts

Posted - 2008-04-21 : 09:53:54
Hi,

I want some code/scrpit that asks for confirmation, before overwriting any existing value.



I have tried with Confirm function of javascript,

But it is executing at the beginning or end of the code.Not the exact position where I wanted



EX:

Line1

Lline2

.

.

.

.

.My script shoud pop up here and ask for confirmation

Once got conformation remaining code should execute.

..

Line10

Line11





}.

bbasir
Yak Posting Veteran

76 Posts

Posted - 2008-04-21 : 19:17:31
take a look at this...
http://www.ondotnet.com/pub/a/dotnet/2003/09/15/aspnet.html
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2008-04-23 : 12:59:34
Try something like this:
Public Sub ChangesMade(ByVal Editing As Boolean)
lnkAdd.Enabled = Editing
lnkDelete.Enabled = Editing
lnkSave.Enabled = Editing
lnkCancel.Enabled = Editing

If Editing Then
lnkBack.Attributes.Add("onclick", "return confirm('Are you sure you want to stop editing?');")
lnkCancel.Attributes.Add("onclick", "return confirm('Are you sure you want to cancel and lose all changes?');")
lnkDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record?');")
lnkMainMenu.Attributes.Add("onclick", "return confirm('Are you sure you want to exit the Chart of Accounts Main Application and lose all changes?');")

Else
Session("blnChangesMade") = False
lnkBack.Attributes.Remove("onClick")
lnkCancel.Attributes.Remove("onclick")
lnkDelete.Attributes.Remove("onclick")
lnkMainMenu.Attributes.Remove("onclick")
End If
Go to Top of Page
   

- Advertisement -