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.
dkilbyAsked:
Who is Participating?
 
praneethaCommented:
and also use that in the html

<%@ Import Namespace="<Project Namespace or rather namespace of global.asax>" %>
0
 
raterusCommented:
Try this, the ~ resolves to the application path.  You may need to put runat="server" on the tag.

src="~/WebForms/ViewOrderLogs.aspx"
0
 
praneethaCommented:
src="<%= Global.GetApplicationPath(Request)  %> /WebForms/ViewOrderLogs.aspx"
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dkilbyAuthor Commented:
tried all the 3 last one worked, thanks
0
 
praneethaCommented:
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

0
 
raterusCommented:
Oh NOW you mention I'm right too :-)
0
 
praneethaCommented:
:) well now that i have the points
0
 
praneethaCommented:
:) 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. :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.