Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > adding delete confirmation

Reply
Thread Tools

adding delete confirmation

 
 
Mike Brearley
Guest
Posts: n/a
 
      07-06-2004
How would I add a delete confirmation popup box for the following?

Here's what I have... A table (not a form) that contains this line:

<td align="center"><a
href="delete.asp?username=<%=rsUsers("username")%> &startletter=<%=startlette
r%>">Delete user</a></td>

And delete.asp looks like this...

----------------------------------------------
<%
Option Explicit
Dim username,rsDelete,startletter

startletter = Request.QueryString("startletter")

if Session("fewmetadminlogin") = "True" then

username = Request.QueryString("username")
%>
<!--#include file="../includes/conn.asp"-->
<%
set rsDelete = conn.Execute("DELETE * FROM users WHERE username = '" &
username & "'")

conn.close
set conn = nothing
end if

Response.Redirect("default.asp?startletter=" & startletter)
%>

---------------------------------------------

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley


 
Reply With Quote
 
 
 
 
CJM
Guest
Posts: n/a
 
      07-06-2004
You can either do something in Javascript (in which post a question in
microsoft.public.scripting.jscript) or you can use ASP to post to another
form where the question can be asked.

By the looks of it, you are looking at a Javascript solution..

Chris

"Mike Brearley" <> wrote in message
news:...
> How would I add a delete confirmation popup box for the following?
>
> Here's what I have... A table (not a form) that contains this line:
>
> <td align="center"><a
>

href="delete.asp?username=<%=rsUsers("username")%> &startletter=<%=startlette
> r%>">Delete user</a></td>
>
> And delete.asp looks like this...
>
> ----------------------------------------------
> <%
> Option Explicit
> Dim username,rsDelete,startletter
>
> startletter = Request.QueryString("startletter")
>
> if Session("fewmetadminlogin") = "True" then
>
> username = Request.QueryString("username")
> %>
> <!--#include file="../includes/conn.asp"-->
> <%
> set rsDelete = conn.Execute("DELETE * FROM users WHERE username = '" &
> username & "'")
>
> conn.close
> set conn = nothing
> end if
>
> Response.Redirect("default.asp?startletter=" & startletter)
> %>
>
> ---------------------------------------------
>
> --
> Posted 'as is'. If there are any spelling and/or grammar mistakes, they
> were a direct result of my fingers and brain not being synchronized or my
> lack of caffeine.
>
> Mike Brearley
>
>



 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      07-06-2004
<%
Option Explicit
Dim username,rsDelete,startletter
startletter = Request.QueryString("startletter")
if Session("fewmetadminlogin") = "True" then
if request.querystring("confirm_delete")="Yes" then
username = Request.QueryString("username")
%>
<!--#include file="../includes/conn.asp"-->
<%
set rsDelete = conn.Execute("DELETE * FROM users WHERE username = '"
& username & "'")
conn.close
set conn = nothing
else
%>
<a href="<%=request.servervariables("url")%>&confirm_ delete=Yes">Aww, go
on then</a>
<%
end if
end if
Response.Redirect("default.asp?startletter=" & startletter)
%>


--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


"Mike Brearley" <> wrote in message
news:...
> How would I add a delete confirmation popup box for the following?
>
> Here's what I have... A table (not a form) that contains this line:
>
> <td align="center"><a
>

href="delete.asp?username=<%=rsUsers("username")%> &startletter=<%=startlette
> r%>">Delete user</a></td>
>
> And delete.asp looks like this...
>
> ----------------------------------------------
> <%
> Option Explicit
> Dim username,rsDelete,startletter
>
> startletter = Request.QueryString("startletter")
>
> if Session("fewmetadminlogin") = "True" then
>
> username = Request.QueryString("username")
> %>
> <!--#include file="../includes/conn.asp"-->
> <%
> set rsDelete = conn.Execute("DELETE * FROM users WHERE username = '" &
> username & "'")
>
> conn.close
> set conn = nothing
> end if
>
> Response.Redirect("default.asp?startletter=" & startletter)
> %>
>
> ---------------------------------------------
>
> --
> Posted 'as is'. If there are any spelling and/or grammar mistakes, they
> were a direct result of my fingers and brain not being synchronized or my
> lack of caffeine.
>
> Mike Brearley
>
>



 
Reply With Quote
 
Bullschmidt
Guest
Posts: n/a
 
      07-06-2004
Here's something similar I've done using onclick and JavaScript:

<% ' *** btnDel %>
<input type="submit" name="btnDel" value="Delete" onclick="return
confirm('Are you sure you want to delete this record?');">

Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
http://www.Bullschmidt.com
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Mike Brearley
Guest
Posts: n/a
 
      07-06-2004
Thanks... That was easy enough.


"Bullschmidt" <-nospam> wrote in message
news:...
> Here's something similar I've done using onclick and JavaScript:
>
> <% ' *** btnDel %>
> <input type="submit" name="btnDel" value="Delete" onclick="return
> confirm('Are you sure you want to delete this record?');">
>
> Best regards,
> J. Paul Schmidt, Freelance ASP Web Designer
> http://www.Bullschmidt.com
> ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
>
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Confirmation Message on DATAGRID Item Delete rajeshgujar@hotmail.com ASP .Net 0 06-14-2007 07:34 PM
Adding a confirmation pop-up window for datagrid delete Elton W ASP .Net 0 05-15-2005 08:47 PM
Datagrid Item Delete Confirmation not working Nedu N ASP .Net 2 12-04-2003 02:16 AM
Delete Confirmation Dotnet Guy ASP .Net 4 10-21-2003 03:50 AM
Re: delete confirmation in datagrid sramruttun ASP .Net 0 07-04-2003 06:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57