读书人

关于子页调用master页面中函数的有关问

发布时间: 2011-12-26 23:09:58 作者: rapoo

关于子页调用master页面中函数的问题?
我在MasterPage.master文件的代码中写了个函数
public string strReplace(string strInput)
{
return strInput;
}
在其它页面中继承了mater页
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "login.aspx.cs " Inherits= "login " MasterPageFile= "~/MasterPage.master "%>
怎么不能调用master页中的函数啊

[解决办法]
Master.strReplace
[解决办法]
new MasterPage().strReplace()

这个有意义么?
[解决办法]
if (this.Master != null)
{
MasterPage I = new MasterPage();
Response.Write(I.strReplace());
}

读书人网 >asp.net

热点推荐