使用jquery动态创建服务器控件? [英] dynamically create server controls using jquery?

查看:73
本文介绍了使用jquery动态创建服务器控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我想使用jquery创建动态服务器控件。我怎么能这样做?

请帮助我...谢谢!

Hi All.
I want to create dynamic server controls using jquery. how can i do it?
please help me... thanks!

推荐答案

我也有同样的想法使用jQuery,



但不幸的是答案是你不能。



有理由认为你可以'' t:

通常在设计时或动态创建服务器控件时,您可能会观察到属性
i too had the same thought by using jQuery,

but unfortunately the answer is you can''t.

Reason to think that you can''t:
Usually when creating a server control during design time or dynamically, you might observe an attribute
runat="server"

,表示它是服务器控件。



只是为了好玩:尝试将一个属性添加到控件中,作为

in the tag, indicating that it''s a server control.

just for fun: try adding an attribute to a control as


#labelid)。attr( runat server);
("#labelid").attr("runat","server");

动态按下按钮。


你不会说你在用什么,但无论如何,它都不会这样。需要在页面生命周期中创建服务器端控件。动态控件不具有视图状态。如果您使用jquery,最好的选择是使用AJAX进行所有操作并忘记服务器端控件。
You don''t say what you''re using, but either way, it doesn''t work that way. Server side controls need to be created in a page lifecycle. Dynamic controls won''t have viewstate. Your best bet if you''re using jquery is to use AJAX for all operations and forget server side controls.


这篇关于使用jquery动态创建服务器控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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