User-885259083 posted
Hi All,
i am trying to show the confirm box using javascript.
there is home page in that page i am having the user controls standardheader.ascx. from user control i am hitting a search button.
under search button_click 1. fetching data from DB and doing some validation 2. now i have to show confirm box 3.based on response from confirm box i have to continue the balance code execution in the button_click.
i used separate method for java script like below and calling the below java script to show the confirm box.
javaScript.Append("var userConfirmation = window.confirm('" & message & "');")
javaScript.Append("if ( userConfirmation == true )")
'javaScript.Append("if (<%=Page.IsPostBack%> == False) var pageId = '<%= this.UniqueID %>';
javaScript.Append("__doPostBack('UserConfirmationPostBack', userConfirmation);")
Page.ClientScript.RegisterStartupScript(Me.GetType(), scriptKey, javaScript.ToString(), True)
doing the post back validation in page load.
Page.ClientScript.GetPostBackEventReference(Me, String.Empty) 'added for Confirm message
'If IsPostBack Then
' Dim eventTarget As String = If(Request("__EVENTTARGET"), String.Empty)
' Dim eventArgument As String = If(Request("__EVENTARGUMENT"), String.Empty)
' Select Case eventTarget
' Case "UserConfirmationPostBack"
' If Convert.ToBoolean(eventArgument) Then
' _CDBcheck = False
' btnSearch_Click(sender, e)
' Else
' End If
' End Select
'End If
but the issue is when i am running the application in web / IIS the confirm box is not showing. please help me to solve it very quickly