日期:2014-05-18  浏览次数:20383 次

关于子页调用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());
}