如何在c#中编写3层的page_load事件代码 [英] How to write page_load event code in 3 tier in c#

查看:100
本文介绍了如何在c#中编写3层的page_load事件代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,



在我的aspx页面中有一个列表框。它是从sql表填充值。在页面中

_load事件我们可以编写方法并从table填充它。如果我们使用3层,我们如何为此编写代码。



Plz帮助我

解决方案

问题与N层没有直接关系。你有一个数据库服务器,这就是最重要的。



首先,没有page_load或_load等事件;有事件 System.Web.UI.Control.Load

http://msdn.microsoft.com/en-us/library/system.web.ui.control .load%28v = vs.110%29.aspx [ ^ ]。



在实施事件处理之前,你应该首先学习.NET事件,至少学习它们的处理。您甚至无法正确命名事件这一事实表明,到目前为止,您还没有线索。不用担心,只需学习这部分技术:

http:// msdn .microsoft.com / zh-cn / library / awbftdfh.aspx [ ^ ],

http:/ /msdn.microsoft.com/en-us/library/8627sbea.aspx [ ^ ],

http ://msdn.microsoft.com/en-us/library/ms366768.aspx [ ^ ]。



您的其他疑虑不明确;希望您知道如何使用ADO.NET:

http://en.wikipedia.org/ wiki / Ado.net [ ^ ],

http://msdn.microsoft.com/en-us/library/ aa286484.aspx [ ^ ]。



如果你有更具体的顾虑,你需要提出更具体的问题。



-SA

Hai,

In my aspx page there is a list box.It is populating values from sql table.In the page
_load event we can write the method and populate it from table.Suppose if we use 3 tier how can we write code for this.

Plz help me

解决方案

The problem is not directly related to N-tier. You have a database server somewhere, this is all what matters.

To start with, there is no such events as "page_load" or "_load"; there is the event System.Web.UI.Control.Load:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.load%28v=vs.110%29.aspx[^].

Before implementing event handling, you should first learn the .NET events and at least their handling. The fact that you cannot even name the event correctly suggests that, by now, you don't have a clues. Not to worry, just learn this part of technology:
http://msdn.microsoft.com/en-us/library/awbftdfh.aspx[^],
http://msdn.microsoft.com/en-us/library/8627sbea.aspx[^],
http://msdn.microsoft.com/en-us/library/ms366768.aspx[^].

Your other concerns are not clear; hope you know how to use ADO.NET:
http://en.wikipedia.org/wiki/Ado.net[^],
http://msdn.microsoft.com/en-us/library/aa286484.aspx[^].

If you have more specific concerns, you will need to ask more specific questions.

—SA


这篇关于如何在c#中编写3层的page_load事件代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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