当前位置: 代码迷 >> ASP.NET >> 关于子页调用master页面中函数的有关问题
  详细解决方案

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

热度:5223   发布时间:2013-02-25 00:00:00.0
关于子页调用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());
}
  相关解决方案