English 中文(简体)
如何更新示范领域,而不在 Java稿中明确指明外地
原标题:How to update a model field without calling the field explicitly in Javascript

在我的MVC3申请中,我有一个观点模式,即I Json在编码上,因此我可以在 Java文中加以操纵。

因此,我要说的是:

var model=@Html.Raw(Json.Encode(Model));

目前,模式。 姓名价值为“Name”。

我现在要做的是,再造一个称为“Value”的 Java语“obj”。 当你改变 ob。 价值也改变了模式。 姓名。

因此,我要谈谈:

var obj=new Object();
obj.Value=model.Name;

因此,如果我改变肥料的价值,现在就已到。 价值也不改变模式。 姓名:我想要做到这一点,我不敢肯定我如何能够在 Java文中做到这一点。 我如何执行?

最佳回答

为什么不要仅仅把这个名字放在暗中的投入领域。 改变你以惯常方式选择的 Java的价值。 然后,当表格贴出后,你就可以对控制器行动的名称价值进行约束,并确定模型名称服务器。

你试图做的是不必要的复杂工作。

如果你真的想要工作的话,那么提交文件时,把整个JSON放在一个隐蔽的输入领域。 其后,控制人员的行动又把JSON作为支撑和淡化其服务器,以重建其模式。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

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 ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签