English 中文(简体)
• 如何以美元计的定购单方法进行动态控制?
原标题:How to get/pass dynamic controls in $.post method in asp.net?

I am add controls dynamically in my page from the database and i am using $.post() method to pass values in client side. Now i want to pass this controls in $.post() method. so can any one suggest me how to get these controls in post method.

 $.post("TestPage.aspx", { Type:  SaveData , drpGender: $( #MainContent_drpGender ).val(), cmbMonth: $( #MainContent_cmbMonth ).val(), cmbYear: $( #MainContent_cmbYear ).val(), drpTall: $( #MainContent_drpTall ).val(), txtWeight: $( #MainContent_txtWeight ).val() }, function (data) {
                    alert(data);
                }, "html");

上文中,drpGender、mbMonth、drpTall、txtheigh是动态控制,在我的网页上加起来。

在客户方面,即在“拯救儿童”方法中保存数据。 一、使用这种控制对客户的价值

Request.Form["drpGender"];

因此,谁能告诉我如何这样做?

提前感谢。

最佳回答

<代码>查询。 页: 1 Ajax员额是因为你是手工操作的,把数据作为JSON物体发送给控制员,而不是作为表格编码的数据。

Try URL在寄出费用之前将物体编码。 我将一些法典分为可读性,如果你想要的话,你可以只增加<条码>。

// Get your submit data.
var sendData = { Type:  SaveData , drpGender: $( #MainContent_drpGender ).val(), cmbMonth: $( #MainContent_cmbMonth ).val(), cmbYear: $( #MainContent_cmbYear ).val(), drpTall: $( #MainContent_drpTall ).val(), txtWeight: $( #MainContent_txtWeight ).val() };

// Form encode your data.
sendData = $.param(sendData);

// Send.
$.post("TestPage.aspx", sendData, function (data) {
                    alert(data);
                }, "html");

这将使控制员处理收到的申请,如表格和人口代码。 表格

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签