我创建了一个母版页
Login_Nav
并使用母版页(AuthenticationMethods.aspx,password.aspx)
创建了两个Login_Nav.master
网页,并且我在CheckAuth()
页面中创建了方法AuthenticationMethods.aspx
,我想将该方法调用到password.aspx
页面中,我已经创建了实例 Model_AuthenticationMethods authenticationMethods = new Model_AuthenticationMethods();
并且它抛出了类似 are you missing a using directive or an assembly reference
的错误,我不知道如何在我想要的地方调用该方法 CheckAuth()
,下面是我的代码
Login_Nav 主页:-
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Login_Nav.master.cs" Inherits="Login_Nav" %>
public partial class Login_Nav : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
带有母版页的 AuthenticationMethods aspx 页面:-
<%@ Page Title="" Language="C#" MasterPageFile="~/Login_Nav.master" AutoEventWireup="true" CodeFile="AuthenticationMethods.aspx.cs" Inherits="Model_AuthenticationMethods" %>
public partial class Model_AuthenticationMethods : System.Web.UI.Page
{
public void CheckAuth()
{
//my logic will go here
}
}
带有母版页的密码 aspx 页面:-
我想调用
CheckAuth();
页面中的password.aspx
方法
<%@ Page Title="" Language="C#" MasterPageFile="~/Login_Nav.master" AutoEventWireup="true" CodeFile="password.aspx.cs" Inherits="password" %>
public partial class Model_Data : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Creating an instance of Model_AuthenticationMethods
Model_AuthenticationMethods authenticationMethods = new Model_AuthenticationMethods(); //getting error "are you missing a using directive or an assembly reference"
authenticationMethods.CheckAuth()
//CheckAuth();
}
}
建议我如何调用该方法
{creating an instance or using inheritance concept}
我没有足够的知识来实现这个概念
iPhone iPhonejjrhfhfhfhfhhfhfjnfnfjfnnfnfjcjchchchudbskg e NH s 在每个 Yb 汇丰银行 hmm fkdkx 在 Xbox GB 盒子 Yb 说关键阿拉莫 VA 将电视 Vlasic Yb s 银河如果困难过渡威斯康星州解释精神分析分析杰克逊维尔最喜欢的瓦茨拉夫 CA 长臂猿