如果我在asp.net上有课我怎么称呼他们? [英] if i have classes in asp.net how i call them?

查看:64
本文介绍了如果我在asp.net上有课我怎么称呼他们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说如果我们有



  public   partial   class 登录:System.Web.UI.Page 
{

< span class =code-keyword> protected void Page_Load( object sender,EventArgs e )
{

}
public void Button1_Click ( object sender,EventArgs e)
{

}



}





//并且想想我是否有


  public   class  harversine 
{

}

public class location
{

}







想想现在我想获得班级哈弗森的位置价值

我想在登录课上打电话给哈弗森课程





我可以这样做



  public   partial   class 登录:System.Web.UI.Page 
{

受保护 void Page_Load( object sender,EventArgs e)
{

}
public void Button1_Click( object sender,EventArgs e)
{
harversine hvs = new harversine();
add (hvs);

}



}

// 并认为我是否

public harversine:location
{

}

public class location
{

}







我还好吗?





有人告诉我吗?

解决方案

看到这个链接,你会得到答案:



如何在asp.net 3.5中创建和使用类 [ ^ ]



如果有帮助,请接受答复。






你说的是继承:

http://www.shoutasp.net/discussions/p423/What-is-inheritance-in-C-Explain- with-an-example.aspx [ ^ ]


let say if we have

public partial class Login : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    public void Button1_Click(object sender, EventArgs e)
    {

    }



}



//and think if i have

public class harversine
{

}

public class location
{

}




think now i want to get location values to class harversine
and i want to call harversine class in login class


can i do like this

public partial class Login : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public void Button1_Click(object sender, EventArgs e)
    {
    harversine hvs = new harversine();
    add(hvs);

    }



}

//and think if i have

public class harversine : location
{

}

public class location
{

}




is it okay if i do like that?


please someone tell me?

解决方案

See this link you will get your answer :

How to create and use class in asp.net 3.5[^]

Accept as answer if help to you.


Hi,

You are saying about inheritance:
http://www.shoutasp.net/discussions/p423/What-is-inheritance-in-C-Explain-with-an-example.aspx[^]


这篇关于如果我在asp.net上有课我怎么称呼他们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆