在 webform1.aspcx.vb 自己定义函数(my_f()) 如何在 webform1.aspcx 中直接输出
在 webform1.aspcx.vb 自己定义函数(my_f()) 如何在 webform1.aspcx 中直接输出
如下面
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub my_shuchu(ByVal sender As System.Object, ByVal e As System.EventArgs)
………………
End Sub
Private function my_f(ByVal sender As System.Object, ByVal e As System.EventArgs)
…………….
End function
End Class
我想在页面中直接输出 my_f的结果
问题点数:20、回复次数:1Top
1 楼saucer(思归)回复于 2005-08-01 08:08:07 得分 0
make it protected
protected function my_f(ByVal sender As System.Object, ByVal e As System.EventArgs)
....
End function
then do
<%= my_f(Me,EventArgs.Empty) %>
or you should do
<asp:Literal id="lit" runat="server" />
...
protected lit as Literal
...
then
lit.Text = my_f(Me,EventArgs.Empty)Top




