Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am opening a pop up page with following code but the error of access denied is shown.

VB
'TODO: To open the page in pop up window
            Dim url3 As String = Server.MapPath("~/AppPages/frmEmailPopUp.aspx")
            Dim newWin3 As String = "window.open('" & url3 + "', 'popup_window_3', 'width=500,height=300,left=400,right=0,top=200,resizable=yes,scrollbars=yes');"
            ClientScript.RegisterStartupScript(Me.GetType(), "pop", newWin3, True)



I have to use mappath because the page from which i am calling is in another folder within AppPages folder.

Pls suggest the remedy.
Thanks
Posted

1 solution

You can't use MapPath, that translates a web folder into a physical folder on the drive, so you're trying to open something like "c:\..." on the client and that's not going to work. You just have to use the proper url in your window.open command, start with hard-coding it like

/yourfolder/yourpage.aspx

and see if you can at least get it working like that.
 
Share this answer
 
Comments
atul sharma 5126 21-Jul-15 6:37am    
Thanks dear it worked smoothly by "/AppPages/frmEmailPopUp.aspx"
atul sharma 5126 25-Jul-15 9:17am    
To update for use by anybody. The above solution was working well in development but was giving error when made live. The solution worked was ../../AppPages..

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