Last post Jun 20, 2019 01:10 PM by PatriceSc
Jun 20, 2019 12:46 PM|Ram_|LINK
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.
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)
' End If
' End Select
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
Jun 20, 2019 01:10 PM|PatriceSc|LINK
Depending on which kind of confirmation it is, my approach is to add that to the control right away when clicked (for example a delete button). If cancelled nothing happens and the user can still interact with the web page. If confirmed the next postback
happens and the deletion is done and an updated page or whatever is shown.
Here it seems your approach is to let the ui element to trigger this operation, then you render a new page with a confirm box and it seems you'll try to get the response right away during the same http request ??? It is not how the web works.
In short just ask for confirmation as soon as you can ie usually when a UI element is clicked.