Click here to Skip to main content
15,887,240 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,

I Have a Parent Page which have a Popup.When popup appears the parent page should be inactive. Means user
cannot have any access untill the popup appears.Upto this working fine.

Problem starts when msg box(ex: Saved Successful) appears.The parent Page is becoming active.What i exactly need is
parent page should not be active untill msgbox and popup close.

Please help me.


Thanks,
Narrin
CMG
Malaysia.
Posted
Updated 17-Sep-12 18:09pm
v3
Comments
[no name] 17-Sep-12 22:49pm    
And what are you using as a "Message Box"?
narendrag999 18-Sep-12 0:55am    
Hi Code for Modal Popup:

Partial Class Paperwork_frmALPassword
Inherits System.Web.UI.Page
Dim glob_SecurityLoginEmpID As String
Dim omodglobal As New modGlobal
Dim odbHelper As New DBHelper
Dim dt As DataTable
Dim SqlStr As String

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Session("glob_formAccID") = "" Then
'frmALPassword.Caption = "Security Login"

Else
'frmSecurity.Caption = "Access Level " + omodglobal.glob_formAccID + " Password Required"
End If
Session("gUserAccess") = 0
Session("gCancel") = False
Session("glob_formAccID") = ""
End Sub

Protected Sub cmdOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdOk.Click
Session("glob_SecurityLoginEmpID") = ConnectionInfo.LoggedInUser.UserID
If Trim(txtUserID.Text) = "" And Trim(txtPassword.Text) = "" Then
omodglobal.MesssgeBox(omodglobal.Get_Mesg_Desc("SE-01"), Me)
txtUserID.Focus()
Exit Sub
End If

If Trim(txtPassword.Text) = "" Then
omodglobal.MesssgeBox(omodglobal.Get_Mesg_Desc("SE-03"), Me)
txtPassword.Focus()
Exit Sub
End If

SqlStr = "select ESC_ACCESS_ID " & _
" from EMP_ESC_EMPSECURITY " & _
" where ESC_EMP_ID='" & omodglobal.Sqt2Dqt(omodglobal.Sbs2Dbs(txtUserID.Text)) & "'" & _
" and ESC_PASSWORD='" & omodglobal.Encrypt((omodglobal.Sqt2Dqt(omodglobal.Sbs2Dbs(txtPassword.Text)))) & "'"


dt = odbHelper.ExecuteDataTable(CommandType.Text, SqlStr)
If dt.Rows.Count > 0 Then
Session("gUserAccess") = omodglobal.RetStr(dt.Rows(0).Item(0))
Session("glob_SecurityLoginEmpID") = Trim(txtUserID.Text)
Session("globchk") = True
ScriptManager.RegisterClientScriptBlock(Me, Me.[GetType](), "window", "javascript:window.close();", True
Else
omodglobal.MesssgeBox(omodglobal.Get_Mesg_Desc("SE-04"), Me)
txtPassword.Text = ""
txtPassword.Focus()
Exit Sub
End If
End Sub

Protected Sub cmdCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
Session("gCancel") = True
ScriptManager.RegisterClientScriptBlock(Me, Me.[GetType](), "window", "javascript:window.close();", True)
End Sub



narendrag999 18-Sep-12 1:04am    
Hello sir Below is the code in Parent Page for Update Button Click:

Protected Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdUpdate.Click

strPWDate = txtPWdate.Text
Dim ans
''Dim EOD_Flag As String 'cmt 13/05/2010 move to top declaration
glob_auto_update_paperwork_YN = "N" 'NEED TO DELETE THIS LINE LATER 11.08.2012 @ 412PM
If glob_auto_update_paperwork_YN = "N" Then 'add if st 25/06/2012
If Session("BlnIndreport") = False Then
gFrmName = "frmPWPaperWork"
If genFunction.RetNum(genFunction.Basic_SecAccess(gFrmName)) > 0 Then

If Session(" gCancel") = False Then
If genFunction.SecAccess(gFrmName) Then
'continue update
Else
'Exit Sub 'HIGHER LEVEL NEEDED
End If
Else
Exit Sub
End If
Else
Exit Sub
End If
End If
End If

'ADD 03/01/2011 to update Accident no of incidents
txtAccIncid.Text = Replace(txtAccIncid.Text, "-", "") 'add 02/03/2011
Dim strSQL As String = ""
strSQL = "select ORT_DATE "
strSQL = strSQL + " FROM A2_SIU_EXTRA_INFO "
strSQL = strSQL + " Where ORT_DATE = '" & genFunction.GetMYSQLDate(strPWDate) & "' "

Dim DT As New DataTable
DT = oDBHelper.ExecuteDataTable(CommandType.Text, strSQL)

If Not DT.Rows.Count > 0 Then
strSQL = ""
strSQL = "insert into A2_SIU_EXTRA_INFO "
strSQL = strSQL & "(ORT_DATE,Accident_Incident) "
strSQL = strSQL & " values("
strSQL = strSQL & " '" & genFunction.GetMYSQLDate(strPWDate) & "','" & genFunction.RetNum(Trim(txtAccIncid.Text)) & "')"

oDBHelper.ExecuteNonQuery(CommandType.Text, strSQL)
Else
strSQL = ""
strSQL = "update A2_SIU_EXTRA_INFO set"
strSQL = strSQL & " Accident_Incident = '" & genFunction.RetNum(Trim(txtAccIncid.Text)) & "' "
strSQL = strSQL + " Where ORT_DATE = '" & genFunction.GetMYSQLDate(strPWDate) & "' "

oDBHelper.ExecuteNonQuery(CommandType.Text, strSQL)
End If
'END 03/01/2011

'add 25/06/2012
If glob_auto_update_paperwork_YN = "Y" Then
If CDate(txtPWdate.Text) = CDate(genFunction.FindProDate) Then


Call Update_Insert_Paperwork()
Exit Sub
Else 'not process date, so don't update
Exit Sub
End If
End If
'end 25/06/2012

'add 12/02/2010 'avoid update paperwork from report
If Session("BlnIndreport") = True Then

If CDate(strPWDate) <> CDate(genFunction.FindProDate) Then


Exit Sub
End If
End If
'end 12/02/2010

If Cmd_Chk = False Then

'add 04/07/2008 to avoid paperwork sometimes no record


'add 13/05/2010 to make insert/update as seperate procedure
Call Update_Insert_Paperwork()


If Session("BlnIndreport") = False Then
If chkEOD.Checked = True Then
ans = ConfirmEOD()

If ans = vbNo Then
'Resp = MsgBox(genFunction.Get_Mesg_Desc("PW-01"), vbOKOnly + vbExclamation, "Message")
MsgBox(genFunction.Get_Mesg_Desc("PW-01"), vbOKOnly + vbExclamation, "Message")
Exit Sub
End If
End If
End If

'add 13/05/2010 to make insert/update as seperate procedure


Chk_flag = False
Afzal Shaikh 18-Sep-12 0:36am    
can you please exactly paste the code here how you are doing that?
narendrag999 18-Sep-12 0:53am    
Hi Code for Modal Popup:

Partial Class Paperwork_frmALPassword
Inherits System.Web.UI.Page
Dim glob_SecurityLoginEmpID As String
Dim omodglobal As New modGlobal
Dim odbHelper As New DBHelper
Dim dt As DataTable
Dim SqlStr As String

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Session("glob_formAccID") = "" Then
'frmALPassword.Caption = "Security Login"

Else
'frmSecurity.Caption = "Access Level " + omodglobal.glob_formAccID + " Password Required"
End If
Session("gUserAccess") = 0
Session("gCancel") = False
Session("glob_formAccID") = ""
End Sub

Protected Sub cmdOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdOk.Click
Session("glob_SecurityLoginEmpID") = ConnectionInfo.LoggedInUser.UserID
If Trim(txtUserID.Text) = "" And Trim(txtPassword.Text) = "" Then
omodglobal.MesssgeBox(omodglobal.Get_Mesg_Desc("SE-01"), Me)
txtUserID.Focus()
Exit Sub
End If

If Trim(txtPassword.Text) = "" Then
omodglobal.MesssgeBox(omodglobal.Get_Mesg_Desc("SE-03"), Me)
txtPassword.Focus()
Exit Sub
End If

SqlStr = "select ESC_ACCESS_ID " & _
" from EMP_ESC_EMPSECURITY " & _
" where ESC_EMP_ID='" & omodglobal.Sqt2Dqt(omodglobal.Sbs2Dbs(txtUserID.Text)) & "'" & _
" and ESC_PASSWORD='" & omodglobal.Encrypt((omodglobal.Sqt2Dqt(omodglobal.Sbs2Dbs(txtPassword.Text)))) & "'"


dt = odbHelper.ExecuteDataTable(CommandType.Text, SqlStr)
If dt.Rows.Count > 0 Then
Session("gUserAccess") = omodglobal.RetStr(dt.Rows(0).Item(0))
Session("glob_SecurityLoginEmpID") = Trim(txtUserID.Text)
Session("globchk") = True
ScriptManager.RegisterClientScriptBlock(Me, Me.[GetType](), "window", "javascript:window.close();", True
Else
omodglobal.MesssgeBox(omodglobal.Get_Mesg_Desc("SE-04"), Me)
txtPassword.Text = ""
txtPassword.Focus()
Exit Sub
End If
End Sub

Protected Sub cmdCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
Session("gCancel") = True
ScriptManager.RegisterClientScriptBlock(Me, Me.[GetType](), "window", "javascript:window.close();", True)
End Sub







Code in Parent Page with Update Button event:


Protected Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdUpdate.Click

strPWDate = txtPWdate.Text
Dim ans
glob_auto_update_paperwork_YN = "N" 'NEED TO DELETE THIS LINE LATER 11.08.2012 @ 412PM
If glob_auto_update_paperwork_YN = "N" Then 'add if st 25/06/2012
If Session("BlnIndreport") = False Then
gFrmName = "frmPWPaperWork"
If genFunction.RetNum(genFunction.Basic_SecAccess(gFrmName)) > 0 Then

If Session(" gCancel") = False Then
If genFunction.SecAccess(gFrmName) Then
'continue update
Else
'Exit Sub 'HIGHER LEVEL NEEDED
End If
Else
Exit Sub
End If
Else
Exit Sub
End If
End If
End If

'ADD 03/01/2011 to update Accident no of incidents
txtAccIncid.Text = Replace(txtAccIncid.Text, "-", "") 'add 02/03/2011
Dim strSQL As String = ""
strSQL = "select ORT_DATE "
strSQL = strSQL + " FROM A2_SIU_EXTRA_INFO "
strSQL = strSQL + " Where ORT_DATE = '" & genFunction.GetMYSQLDate(strPWDate) & "' "

Dim DT As New DataTable
DT = oDBHelper.ExecuteDataTable(CommandType.Text, strSQL)

If Not DT.R

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900