扩展控制问题 [英] Extended control issue

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

问题描述

您好,


当我尝试扩展文本框时出现问题。

所以我覆盖了Render方法。对于我尝试做的事情,我希望

将自定义属性添加到我的自定义文本框中。

因此它呈现如下内容:

< input ... myattribute =" value" />


我修改了myattribute的值使用javascript,但是当我提交我的

表格时,我无法获得myattribute的价值。


我是否必须创建创建一个类扩展了属性类?我如何

必须继续?


提前谢谢你,

Fabien。

Hello,

I got a problem when I try to extend a textbox.
So I overwrite the Render method. For the stuff I try to do, I would like
to add a custom attribute to my customized textbox.
So it renders something like this:
<input ... myattribute="value" />

I modify the value of "myattribute" using javascript, but when I submit my
form, I can''t get the value of "myattribute".

Do I have to create create a class extended the attribute class? How do I
have to proceed?

Thank you in advance,
Fabien.

推荐答案



" Fabien Henriet" < fa ************ @ nospam.bewrote in message

news:e%**************** @ TK2MSFTNGP04.phx.gbl ...

"Fabien Henriet" <fa************@nospam.bewrote in message
news:e%****************@TK2MSFTNGP04.phx.gbl...

您好,


当我尝试扩展文本框时出现问题。

所以我覆盖了Render方法。对于我尝试做的事情,我希望

将自定义属性添加到我的自定义文本框中。

因此它呈现如下内容:

< input ... myattribute =" value" />


我修改了myattribute的值使用javascript,但是当我提交我的

表格时,我无法获得myattribute的价值。


我是否必须创建创建一个类扩展了属性类?我如何

必须继续?


提前谢谢,

Fabien。
Hello,

I got a problem when I try to extend a textbox.
So I overwrite the Render method. For the stuff I try to do, I would like
to add a custom attribute to my customized textbox.
So it renders something like this:
<input ... myattribute="value" />

I modify the value of "myattribute" using javascript, but when I submit my
form, I can''t get the value of "myattribute".

Do I have to create create a class extended the attribute class? How do I
have to proceed?

Thank you in advance,
Fabien.



提交表单时,每个表单元素都带有name和name。属性和

" value"属性将作为名称=值对的对或集发送。对于

示例< input type =" hidden"名称= QUOT;颜色"值= QUOT;蓝色" /这个元素将

提供color = blue。

HTH

When you submit the form, each form element with a "name" attribute and a
"value" attribute will be sent as a ''pair'' or ''set'' of name=value pairs. For
example <input type="hidden" name="color" value="blue" / this element will
provide color=blue.
HTH


感谢您的快速回答! />
我已经想过要使用一个隐藏字段。但我不知道如何在扩展控件中获得此字段的

值。


我解释:当我提交表单时,我在这个方法中调用我扩展文本框的方法和

,我想测试我的隐藏字段的值。我希望
不要在我的页面后面的代码中进行测试。


提前感谢您的帮助。


Fabien。

< Hal Rosser" < hm ****** @bellsouth.netaécritdansle message de news:

fj ******************* @ bignews8 .bellsouth.net ...
Thank you for your quick answer!
I''ve already thought to use an hiddenfield. But I don''t know how to get the
value of this field in my extended control.

I explain: when I submit my form, I call a method of my extended textbox and
within this method, I would like to test the value of my hiddenfield. I
prefer not to make that test in code behind of my page.

Thanks in advance for your help.

Fabien.
"Hal Rosser" <hm******@bellsouth.neta écrit dans le message de news:
fj*******************@bignews8.bellsouth.net...

>

" Fabien Henriet" < fa ************ @ nospam.bewrote in message

news:e%**************** @ TK2MSFTNGP04.phx.gbl ...
>
"Fabien Henriet" <fa************@nospam.bewrote in message
news:e%****************@TK2MSFTNGP04.phx.gbl...

>您好,

当我尝试扩展文本框时出现问题。所以我覆盖了Render方法。对于我尝试做的事情,我会想要在我的自定义文本框中添加自定义属性。
因此它呈现如下内容:
< input ... myattribute ="值" />

我修改了myattribute的值使用javascript,但是当我提交
我的表单时,我无法获得myattribute的值。

我是否必须创建一个扩展属性类的类?怎么做我必须继续?

提前谢谢你,
Fabien。
>Hello,

I got a problem when I try to extend a textbox.
So I overwrite the Render method. For the stuff I try to do, I would
like to add a custom attribute to my customized textbox.
So it renders something like this:
<input ... myattribute="value" />

I modify the value of "myattribute" using javascript, but when I submit
my form, I can''t get the value of "myattribute".

Do I have to create create a class extended the attribute class? How do
I have to proceed?

Thank you in advance,
Fabien.



当您提交表单时,每个表单元素都带有name和name。属性和

" value"属性将作为名称=值对的对或集发送。

例如< input type =" hidden"名称= QUOT;颜色"值= QUOT;蓝色" /这个

元素将提供color = blue。

HTH


When you submit the form, each form element with a "name" attribute and a
"value" attribute will be sent as a ''pair'' or ''set'' of name=value pairs.
For example <input type="hidden" name="color" value="blue" / this
element will provide color=blue.
HTH



你好,


它很简单,在页面中找到HiddenField(你可以通过anyControl.Page获取当前页面

实例),每个控件都有一个FindControl方法(但它只有他的孩子才会搜索他的孩子而不是他孩子的孩子.....)所以如果

hiddenField在某个深处,你将使用递归到找到

控件。然后你将通过yourHiddenField.Value获得它的价值


问候,


Lukas Holota


Fabien Henriet < fa ************ @ nospam.bewrote in message

news:eR ************** @ TK2MSFTNGP03.phx .gbl ...
Hi,

it''s simple, find the HiddenField in page (you can get the current page
instance by anyControl.Page), every control has a FindControl method (but it
searches only his childs not childs of his childs.....) so if the
hiddenField is somewhere deep, you will have use recursion to find the
control. Then you will get it''s value by yourHiddenField.Value

Regards,

Lukas Holota

"Fabien Henriet" <fa************@nospam.bewrote in message
news:eR**************@TK2MSFTNGP03.phx.gbl...

感谢您的快速回答!

我已经想过要使用隐藏字段了。但我不知道如何在我的扩展控件中获得这个字段的价值

我解释说:当我提交表单时,我调用我的扩展文本框的方法

并且在这个方法中,我想测试我的隐藏字段的值。

我不想在后面的代码中进行测试我的页面。


预先感谢您的帮助。


Fabien。


" Hal Rosser < hm ****** @bellsouth.netaécritdansle message de news:

fj ******************* @ bignews8 .bellsouth.net ...
Thank you for your quick answer!
I''ve already thought to use an hiddenfield. But I don''t know how to get
the value of this field in my extended control.

I explain: when I submit my form, I call a method of my extended textbox
and within this method, I would like to test the value of my hiddenfield.
I prefer not to make that test in code behind of my page.

Thanks in advance for your help.

Fabien.
"Hal Rosser" <hm******@bellsouth.neta écrit dans le message de news:
fj*******************@bignews8.bellsouth.net...

>>
" Fabien Henriet" < fa ************ @ nospam.bewrote in message
新闻:e%**************** @ TK2MSFTNGP04.phx。 gbl ...
>>
"Fabien Henriet" <fa************@nospam.bewrote in message
news:e%****************@TK2MSFTNGP04.phx.gbl...

>>您好,

当我尝试扩展文本框时出现问题。
所以我覆盖了Render方法。对于我尝试做的事情,我会想要在我的自定义文本框中添加自定义属性。
因此它呈现如下内容:
< input ... myattribute ="值" />

我修改了myattribute的值使用javascript,但是当我提交
我的表单时,我无法获得myattribute的值。

我是否必须创建一个扩展属性类的类?怎么做我必须继续?

提前谢谢你,
Fabien。
>>Hello,

I got a problem when I try to extend a textbox.
So I overwrite the Render method. For the stuff I try to do, I would
like to add a custom attribute to my customized textbox.
So it renders something like this:
<input ... myattribute="value" />

I modify the value of "myattribute" using javascript, but when I submit
my form, I can''t get the value of "myattribute".

Do I have to create create a class extended the attribute class? How do
I have to proceed?

Thank you in advance,
Fabien.


当您提交表单时,每个表单元素都带有name和name。属性和
值属性将作为名称=值对的对或集发送。
例如< input type =" hidden"名称= QUOT;颜色"值= QUOT;蓝色" / this
元素将提供color = blue。
HTH


When you submit the form, each form element with a "name" attribute and a
"value" attribute will be sent as a ''pair'' or ''set'' of name=value pairs.
For example <input type="hidden" name="color" value="blue" / this
element will provide color=blue.
HTH



这篇关于扩展控制问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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