<%@ - Page/Control/Import/Register directive <%$ - Resource access and Expression building <%= - Explicit output to page, equivalent to <% Response.Write( ) %> <%# - Data Binding. It can only used where databinding is supported, or at the page level if you call Page.DataBind() in your code-behind. <%-- - Server-side comment block
不过这个变量的申明位置有要求吗?
要在Page_Load的上面申明成全局变量吗?
public string geturl()
{ string str = string.Empty;
switch (status)
{
case "1":
str = "rightlist.aspx";
break;
case "2":
str = "rightsearch.aspx";
break;
default:
str = "rightlist.aspx";
break;
}
return str;
}
<%$ - Resource access and Expression building
<%= - Explicit output to page, equivalent to <% Response.Write( ) %>
<%# - Data Binding. It can only used where databinding is supported, or at the page level if you call Page.DataBind() in your code-behind.
<%-- - Server-side comment block
protected void Page_Load(object sender, EventArgs e)
{ }