Click here to Skip to main content
15,891,607 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Grouping session variables Pin
petersgyoung10-Aug-07 19:50
petersgyoung10-Aug-07 19:50 
QuestionSQLDataSource Inserting Pin
hurrem10-Aug-07 12:50
hurrem10-Aug-07 12:50 
AnswerRe: SQLDataSource Inserting Pin
Fred_Smith10-Aug-07 13:06
Fred_Smith10-Aug-07 13:06 
Questionhost window component in ASP.NET Pin
mhp13010-Aug-07 11:09
mhp13010-Aug-07 11:09 
Questionerror in radgride of aspx page Pin
avinol10-Aug-07 10:43
avinol10-Aug-07 10:43 
AnswerRe: error in radgride of aspx page Pin
petersgyoung12-Aug-07 15:19
petersgyoung12-Aug-07 15:19 
QuestionWizard containg User control Pin
kjosh10-Aug-07 6:35
kjosh10-Aug-07 6:35 
QuestionPostback problem from ASP.NET page Pin
LancashireLad10-Aug-07 6:10
LancashireLad10-Aug-07 6:10 
I am trying to use a client side confirm dialog box. I have a generic sub (borrowed from an article by Jim Stall) that successfully generates the client side Yes/No dialog box. According to the forums and docs I've read, a postback should only occur if the user clicks OK. This means my server code should only needs to check if OK was pressed.

The behavior I'm finding is that a postback occurs regardless of whether the user clicks OK or Cancel. This means I can't detect what was selected. Can someone suggest what I'm doing wrong?

Here's the server side code:

Public Shared Sub CreateConfirmBox(ByRef btn As WebControls.LinkButton, ByVal strMessage As String)
btn.Attributes.Add("onclick", "return confirm('" & strMessage & "');")
End Sub

The button declaration code:
<asp:linkbutton id="btnDelete" runat="server" text="Delete">

The page load code that calls the button generation code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
eVSUtils.CreateConfirmBox(btnDelete, "Are you sure you want to delete this user?")
End If
End Sub

Any suggestions on why it does a postback regardless of the button pressed?

Thanks!
AnswerRe: Postback problem from ASP.NET page Pin
Michael Sync10-Aug-07 6:54
Michael Sync10-Aug-07 6:54 
GeneralRe: Postback problem from ASP.NET page Pin
LancashireLad10-Aug-07 7:32
LancashireLad10-Aug-07 7:32 
GeneralRe: Postback problem from ASP.NET page Pin
LancashireLad10-Aug-07 8:56
LancashireLad10-Aug-07 8:56 
GeneralRe: Postback problem from ASP.NET page Pin
Michael Sync10-Aug-07 16:21
Michael Sync10-Aug-07 16:21 
AnswerRe: Postback problem from ASP.NET page Pin
Guffa10-Aug-07 9:41
Guffa10-Aug-07 9:41 
GeneralRe: Postback problem from ASP.NET page Pin
LancashireLad10-Aug-07 10:41
LancashireLad10-Aug-07 10:41 
AnswerRe: Postback problem from ASP.NET page Pin
Fred_Smith10-Aug-07 11:44
Fred_Smith10-Aug-07 11:44 
GeneralRe: Postback problem from ASP.NET page Pin
LancashireLad11-Aug-07 3:16
LancashireLad11-Aug-07 3:16 
GeneralRe: Postback problem from ASP.NET page Pin
LancashireLad11-Aug-07 3:25
LancashireLad11-Aug-07 3:25 
QuestionCalculate distinces between 2 location Pin
DonVBguy10-Aug-07 5:26
DonVBguy10-Aug-07 5:26 
AnswerRe: Calculate distinces between 2 location Pin
Guffa10-Aug-07 5:56
Guffa10-Aug-07 5:56 
AnswerRe: Calculate distinces between 2 location Pin
Jon Sagara10-Aug-07 8:45
Jon Sagara10-Aug-07 8:45 
QuestionHow to get or set value/text of disabled dropdown list in java script Pin
here2learn10-Aug-07 5:19
here2learn10-Aug-07 5:19 
AnswerRe: How to get or set value/text of disabled dropdown list in java script Pin
Guffa10-Aug-07 5:28
Guffa10-Aug-07 5:28 
GeneralRe: How to get or set value/text of disabled dropdown list in java script Pin
here2learn12-Aug-07 18:50
here2learn12-Aug-07 18:50 
QuestionOverFlow Property in HTML 4.01 Pin
nandhububbly10-Aug-07 4:05
nandhububbly10-Aug-07 4:05 
AnswerRe: OverFlow Property in HTML 4.01 Pin
Vasudevan Deepak Kumar10-Aug-07 4:08
Vasudevan Deepak Kumar10-Aug-07 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.