Inline HTML method call

  • Thread starter Thread starter Robert H
  • Start date Start date
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
 
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

Back
Top