Link to home
Start Free TrialLog in
Avatar of dkilby
dkilbyFlag for Canada

asked on

asp.net + Global.GetApplicationPath(Request) Error

I am using the following code for an iframe which work perfectly fine in a different user control in the same project but for some reason is creating an error.

src="<%= Global.GetApplicationPath(Request) & "/WebForms/ViewOrderLogs.aspx" %>"

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'Global' is not declared.
Avatar of raterus
raterus
Flag of United States of America image

Try this, the ~ resolves to the application path.  You may need to put runat="server" on the tag.

src="~/WebForms/ViewOrderLogs.aspx"
Avatar of praneetha
praneetha

src="<%= Global.GetApplicationPath(Request)  %> /WebForms/ViewOrderLogs.aspx"
ASKER CERTIFIED SOLUTION
Avatar of praneetha
praneetha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkilby

ASKER

tried all the 3 last one worked, thanks
well thanks for the points.

and just for reference...raterus is right too...but what he said holds true for webcontrols...but that's a good point.

and instead of using import and global.getapplictaionath you can also try

 src="<%= Request.ApplicationPath%> /WebForms/ViewOrderLogs.aspx"

Good Luck

Oh NOW you mention I'm right too :-)
:) well now that i have the points
:) hmm so u r an administrator too ...hey i dont mind sharing points with you...u r one of my fav expert on this site. :)