Advertisement

06.06.2008 at 06:10AM PDT, ID: 23463537
[x]
Attachment Details

ASP.NET Confirm message

Asked by lrbrister in .Net Editors & IDEs, Visual Studio .NET 2005, Visual Studio 2008

In my attached code how would I add an "are you sure" message?  I know with a button I can use

 btndelete.Attributes.Add("Onclick", "return confirm('Are you sure you want to delete this file?');")

But this is coming through a page load event...

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
'Set up call to update stored procedure
conn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("strConn1")
conn.Open()
 
'Remove image from database
cmd.Connection = conn
cmd.CommandType = System.Data.CommandType.StoredProcedure
cmd.CommandText = "DeleteImage"
cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ImageID", System.Data.SqlDbType.Int, 4)).Value = Request.Params("ImageID")
cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4)).Value = Request.QueryString("HotelID")
cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Code", System.Data.SqlDbType.VarChar)).Value = "HPHTO"
objDR = cmd.ExecuteReader()
 
'Remove image from server
File.Delete(Path.Combine(Server.MapPath("") & "\ImagesHotels\", Request.QueryString("Image")))
 
objDR.Close()
conn.Close()
RefreshPage()
End If
[+][-]06.06.2008 at 07:38AM PDT, ID: 21729501

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 07:40AM PDT, ID: 21729515

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 07:42AM PDT, ID: 21729535

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 09:38AM PDT, ID: 21730595

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 10:56AM PDT, ID: 21731299

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 11:00AM PDT, ID: 21731336

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 05:17AM PDT, ID: 21750405

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 05:37AM PDT, ID: 21750568

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Visual Studio .NET 2005, Visual Studio 2008
Sign Up Now!
Solution Provided By: naspinski
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906