Inline HTML method call

R

Robert H

Is there anyone out there that can answer a hopefully simple question?
this code is erroring out on me :

//( code behind same namespace )
public class Util {
public static string getURL(System.Web.UI.Page p){
try {return "page.aspx?name=" + p.Session["fname"] + " " +
p.Session["lname"];}
catch{return "";}
}
}


the aspx page is erroring on this code block.
<%=Util.getURL(this.Page)%>

is there a way to pass into that method a reference to the page?
thanks all,
Rob H
 
T

tdavisjr

Using "this" instead of "this.Page" should do it. Since this referrs to the
current page which is an instance of System.Web.UI.Page
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top