<pre lang="text">I have a button click event.
in it ,
after satisfying some condition, I should get a confirmation dialog.
When I click "OK" button of that confirmation dialog, I want to proceed further in my code on server side.
SetUp.Aspx Code
<pre>
<asp:ImageButton ID="btnCreateJob" ImageUrl="~/Images/btn_create_new_request.gif"
runat="server" OnClick="btnCreateJob_Click" />
Setup.Aspx.vb Code
<pre lang="ASP.NET">Protected Sub btnCreateJob_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles btnCreateJob.Click
Dim UserID As String = ddlUsrId.SelectedValue.ToString()
Dim requestType As String = ddlRequestTypes.SelectedValue.ToString()
Dim producttype As String = ddlProduct.SelectedValue.ToString()
Dim taxyear As String = ddlTaxyear.Items(0).Value
Try
If ddlRequestTypes.SelectedValue.Trim() = "RC1" AndAlso producttype = "M" AndAlso UserID = "UT" Then
Dim Job_CreateTime As String = Common.Business.Jobsetup.GetCompletedCombinableJobsDetail(taxyear)
If Job_CreateTime = "" Then
ScriptManager.RegisterStartupScript(Me.Page, Page.[GetType](), "showalert", "confirm('There is no request in the table. Please proceed with the request')", True)
If (ok button clicked)
{
InsertNewJob(taxyear, UserID)
}
Else
{
//do Not insert
}
End If
Else
ScriptManager.RegisterStartupScript(Me.Page, Page.[GetType](), "showalert", "confirm('The request is already submitted on " + Job_CreateTime + " do you want to place a new request?')", True)
If (ok button clicked)
{
InsertNewJob(taxyear, UserID)
}
Else
{
//do Not insert
}
End If
End If
Catch ex As Exception
End Try
End Sub
I am not good at ASP, Please help me on this,
Or please give if there is any better approach to implement this.
Thanks in advance.
What I have tried:
Protected Sub btnCreateJob_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles btnCreateJob.Click
Dim UserID As String = ddlUsrId.SelectedValue.ToString()
Dim requestType As String = ddlRequestTypes.SelectedValue.ToString()
Dim producttype As String = ddlProduct.SelectedValue.ToString()
Dim taxyear As String = ddlTaxyear.Items(0).Value
Try
If ddlRequestTypes.SelectedValue.Trim() = "RC1" AndAlso producttype = "M" AndAlso UserID = "UT" Then
Dim Job_CreateTime As String = Common.Business.Jobsetup.GetCompletedCombinableJobsDetail(taxyear)
If Job_CreateTime = "" Then
ScriptManager.RegisterStartupScript(Me.Page, Page.[GetType](), "showalert", "confirm('There is no request in the table. Please proceed with the request')", True)
'My doubt Is this
If (ok button clicked)
{
InsertNewJob(taxyear, UserID)
}
Else
{
//do Not insert
}
End If
Else
ScriptManager.RegisterStartupScript(Me.Page, Page.[GetType](), "showalert", "confirm('The request is already submitted on " + Job_CreateTime + " do you want to place a new request?')", True)
If (ok button clicked)
{
InsertNewJob(taxyear, UserID)
}
Else
{
//do Not insert
}
End If
End If
Catch ex As Exception
End Try
End Sub