添加新ASP.NEt服务器控件与jQuery? [英] Add new ASP.NEt server controls with jQuery?

查看:135
本文介绍了添加新ASP.NEt服务器控件与jQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组重复的表单上字段。它们仅仅是3输入框中。我在上面写着一组底部的链接添加更多。单击时,我使用jQuery的.append(),以写出输入字段的新行(并将其命名为独特的东西)。问题是我加入HTML领域,而不是ASP.NET服务器控件。

I have a set of fields that are repeated on a form. They are simply 3 input boxes. I have a link at the bottom of the set that says "Add More." When clicked, I use .append() in jQuery to write out a new row of input fields (and name them something unique). The problem is I am adding HTML fields, not ASP.NET server controls.

我如何访问这些在我的code的后面,因为他们没有看到在表格上,直到运行时(也就是,在浏览器中运行时)?

How do I access these in my code behind since they are not seen on the form until runtime (that is, runtime in the browser)?

克里斯

推荐答案

这是根本不可能的。

jQuery的纯粹运行在客户端上,而主要存在于服务器上的ASP.Net服务器端控件。

jQuery runs purely on the client, whereas ASP.Net server-side controls exist primarily on the server.

相反,你可以使用jQuery通过将信息隐藏域服务器端code进行通信。

Instead, you can communicate with server-side code using jQuery by putting information in hidden fields.

考虑改用ASP.Net MVC,这是在这种事情要好得多。

Consider switching to ASP.Net MVC, which is much better at this sort of thing.

这篇关于添加新ASP.NEt服务器控件与jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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