Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hi,

I am using a modal pop up to check the Accessibility of user if he success fully logs in i am allowing to open a PDF File. when i am opening the PDF File i want to close the Ajax modal popup but unable to close.
---------------------------------------------
CODE
------------------------------------------------
protected void BtnPassword_Click(object sender, EventArgs e)
{

//bool PasswordRequired = Convert.ToBoolean((dtClient.Rows[0]["PasswordRequired"].ToString() == "") ? "0" : dtClient.Rows[0]["PasswordRequired"].ToString());

byte[] _encryptPassword = TxtPassword.Text.Trim();
string _byteToText = Security.ByteArrayToString(_encryptPassword);

BLL_M_Users objusers = new BLL_M_Users();
System.Data.DataTable dtUser;
dtUser = objusers.CheckForUserAuthentication(Convert.ToString(Session["Name"]), _byteToText, Convert.ToString(Session["CompanyID"]));

if (dtUser.Rows.Count > 0)
{
ModalPopupExtender1.Hide();
GenerateReport();
}
else
{
Page.RegisterStartupScript("alert", "<script language='javascript'>alert('Incorrect Password.')</script>");
}

}


-------------------------------
-------------------------------

Here is my code if in the modal popup button click i am user for user authentication if successful i am trying to close the modal pop up and open an pdf file but i am unable to hide the modalpopup extender.

can any one help me in solving this issue

Thanks,
Aditya.
Posted
Updated 4-Jun-14 20:41pm
v3
Comments
DamithSL 5-Jun-14 0:48am    
show your code where you show the model pop up and what you do after success login
aditya kiran maroju 5-Jun-14 1:10am    
protected void BtnPassword_Click(object sender, EventArgs e)
{

//bool PasswordRequired = Convert.ToBoolean((dtClient.Rows[0]["PasswordRequired"].ToString() == "") ? "0" : dtClient.Rows[0]["PasswordRequired"].ToString());

byte[] _encryptPassword = TxtPassword.Text.Trim();
string _byteToText = Security.ByteArrayToString(_encryptPassword);

BLL_M_Users objusers = new BLL_M_Users();
System.Data.DataTable dtUser;
dtUser = objusers.CheckForUserAuthentication(Convert.ToString(Session["Name"]), _byteToText, Convert.ToString(Session["CompanyID"]));

if (dtUser.Rows.Count > 0)
{
ModalPopupExtender1.Hide();
GenerateReport();
}
else
{
Page.RegisterStartupScript("alert", "<script language='javascript'>alert('Incorrect Password.')</script>");
}

}


-------------------------------
-------------------------------

Here is my code if in the modal popup button click i am user for user authentication if successful i am trying to close the modal pop up and open an pdf file but i am unable to hide the modalpopup extender.

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