Click here to Skip to main content
15,905,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi I have page a child.aspx. It acts like a popup window. I call it from another page parent.aspx, while clicking on a button of parent.aspx page. It is handled in OnClientClick() of the button using JS

JavaScript
window.showModalDialog('child.aspx', '', 'dialogWidth:355px;dialogHeight:250px');


i want to prevent accessing the page from any other means such as typing the child.aspx's url in browser window.

Can anyone give me some hint to do this?
Posted

AFAIK, this setting depends on the browser and cannot be controlled through code.
 
Share this answer
 
you can do that by using the Page.IsCrossPagePostBack property like shown below

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.sIsCrossPagePostBack)
{
Response.Redirect("url");
}
}
 
Share this answer
 

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