手动调用methodT [英] manually call a methodT

查看:53
本文介绍了手动调用methodT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用xsl转换因此在

通常的方式中使用控件是不实际的,但我仍然想在我的代码隐藏类中调用方法。 br />

通常我只想使用onclick ="< eventHandler>"说像按钮这样的东西

控制


有没有办法手动调用代码隐藏类中定义的方法,但

不是由标准控件调用的吗?我查看了__doPostBack()函数
$。b $ b .net生成了但它看起来难以理解。


TIA

karl

解决方案

CodeBehind Class是您的Page类(.aspx页继承它)。只需

从任何Control中将其称为Page。 - 这是所有

System.Web.UI.Controls的成员。例如:


Page.DoSomething(someParameter);


-

HTH,

凯文斯宾塞

..Net开发人员

微软MVP

大件东西组成

批次小事。


" Karl Hungus" < NN ********* @ hotmail.com>在消息中写道

news:74 ******************* @ twister.nyc.rr.com ...


我使用xsl转换,因此以通常的方式使用控件不实用,但我仍然想在我的代码隐藏类中调用方法。

通常是Id只需使用onclick ="< eventHandler>"比如
按钮控件之类的东西

有没有办法手动调用代码隐藏类中定义的方法,
但是没有被标准控件调用?我查看了.net生成的__doPostBack()
函数,但它似乎无法穿透。

TIA
karl



CodeBehind Class是您的Page类(.aspx页继承它)。只需

从任何Control中将其称为Page。 - 这是所有

System.Web.UI.Controls的成员。例如:


Page.DoSomething(someParameter);


-

HTH,

凯文斯宾塞

..Net开发人员

微软MVP

大件东西组成

批次小事。


" Karl Hungus" < NN ********* @ hotmail.com>在消息中写道

news:74 ******************* @ twister.nyc.rr.com ...


我使用xsl转换,因此以通常的方式使用控件不实用,但我仍然想在我的代码隐藏类中调用方法。

通常是Id只需使用onclick ="< eventHandler>"比如
按钮控件之类的东西

有没有办法手动调用代码隐藏类中定义的方法,
但是没有被标准控件调用?我查看了.net生成的__doPostBack()
函数,但它似乎无法穿透。

TIA
karl





就是问题所在。我不能从任何控制中引用它。由于XSL转换,我无法使用控件
。我需要在__doPostBack js函数中手动重新创建

。我只是不确定是否有可能以这种方式进入

方法。


" Kevin Spencer" < uc*@ftc.gov>在消息中写道

news:在************* @ TK2MSFTNGP12.phx.gbl ...

" CodeBehind Class"是您的Page类(.aspx页继承它)。
只需从任何控件中将其称为页面即可。 - 这是所有
System.Web.UI.Controls的成员。例如:

Page.DoSomething(someParameter);

-
HTH,
Kevin Spencer
.Net开发人员
微软MVP
很多小东西组成了很多东西。

Karl Hungus < NN ********* @ hotmail.com>在消息中写道
新闻:74 ******************* @ twister.nyc.rr.com ...

中的控件是不实际的,但我仍然想在我的代码隐藏
类中调用方法。
通常我只是使用onclick = "<事件处理程序>"说像


按钮

控件

有没有办法手动调用代码隐藏类中定义的方法,


但是

不是由标准控件调用的?我查看了.net生成的__doPostBack()


函数

但它似乎难以理解。

TIA
karl





Im using an xsl transformation so its not practical to use controls in the
usual way, but I would still like to call methods in my codebehind class.

usually Id just use onclick="<eventHandler>" say for something like a button
control

is there a way to manually call a method defined in a codebehind class, but
is not called by a standard control? I looked at the __doPostBack() function
that .net generates but it seemed impenetrable.

TIA
karl

解决方案

The "CodeBehind Class" is your Page class (the .aspx Page inherits it). Just
refer to it from any Control as "Page" - which is a member of all
System.Web.UI.Controls. Example:

Page.DoSomething(someParameter);

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Karl Hungus" <nn*********@hotmail.com> wrote in message
news:74*******************@twister.nyc.rr.com...


Im using an xsl transformation so its not practical to use controls in the
usual way, but I would still like to call methods in my codebehind class.

usually Id just use onclick="<eventHandler>" say for something like a button control

is there a way to manually call a method defined in a codebehind class, but is not called by a standard control? I looked at the __doPostBack() function that .net generates but it seemed impenetrable.

TIA
karl



The "CodeBehind Class" is your Page class (the .aspx Page inherits it). Just
refer to it from any Control as "Page" - which is a member of all
System.Web.UI.Controls. Example:

Page.DoSomething(someParameter);

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Karl Hungus" <nn*********@hotmail.com> wrote in message
news:74*******************@twister.nyc.rr.com...


Im using an xsl transformation so its not practical to use controls in the
usual way, but I would still like to call methods in my codebehind class.

usually Id just use onclick="<eventHandler>" say for something like a button control

is there a way to manually call a method defined in a codebehind class, but is not called by a standard control? I looked at the __doPostBack() function that .net generates but it seemed impenetrable.

TIA
karl




thats the problem. I cant "just refer to it from any control" Im not able to
use controls because of an XSL transformation. I need to manually recreate
the __doPostBack js function. Im just not sure if its possible to get to the
method that way.

"Kevin Spencer" <uc*@ftc.gov> wrote in message
news:On*************@TK2MSFTNGP12.phx.gbl...

The "CodeBehind Class" is your Page class (the .aspx Page inherits it). Just refer to it from any Control as "Page" - which is a member of all
System.Web.UI.Controls. Example:

Page.DoSomething(someParameter);

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Karl Hungus" <nn*********@hotmail.com> wrote in message
news:74*******************@twister.nyc.rr.com...


Im using an xsl transformation so its not practical to use controls in the usual way, but I would still like to call methods in my codebehind class.
usually Id just use onclick="<eventHandler>" say for something like a


button

control

is there a way to manually call a method defined in a codebehind class,


but

is not called by a standard control? I looked at the __doPostBack()


function

that .net generates but it seemed impenetrable.

TIA
karl




这篇关于手动调用methodT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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