加载和编辑数据的jQuery UI的对话框 [英] Load and Edit Data in jQuery UI Dialog

查看:215
本文介绍了加载和编辑数据的jQuery UI的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net MVC应用程序,我使用的WebGrid列出的客户。

I have an asp.net mvc application and I'm using Webgrid to list customers.

我想编辑的jQuery的对话框客户的数据,所以,我觉得做一个动作上我的控制器返回PartialView是最好的方式。问题是,这个PartialView有一些JavaScript code,以验证该输入(我使用jQuery验证,以验证在客户端)。我的问题是:

I want to edit the customers' data on the jQuery Dialog, so, I think to do an action on my controller returning a PartialView is the best way. The problem is that this PartialView has some javascript code to validate this input (I'm using jQuery Validation to validate on client side). My questions are:

  1. 所有的脚本来验证我的形式在对话框上,它的jQuery和Ajax发送到服务器,应该是在页面上还是有什么办法可以把它放在PartialView?

  1. All the script to validate my form on the dialog and send it to server by jquery and ajax, should be on the page or is there any way to put it on the PartialView?

如何加载partialView我对话的最好方式($。员额,$不用彷徨,.load方法等)?被铁道部安全邮递使用?

How is the best way to load the partialView on my Dialog ($.post, $.get, .load method, etc)? Is mor safe to use by post?

是否有code任何样品张贴或任何链接显示,我呢?我想看到的code一些样品:)

Is there any sample of code to post or any link to show-me? I would like to see some samples of code :)

感谢您

推荐答案

会这样回答来帮助你完成加载jQuery UI的对话与你PartialView,我的经验是,一个PartialView可以包含JavaScript,但只有当它的服务,就好像它是一个视图,即JavaScript的一个这与另一PartialView叫我不工作PartialView在

This SO answer should help you with loading the jQuery UI Dialog with your PartialView, and my experience has been that a PartialView can contain JavaScript, but only if it's served as if it's a View, i.e. JavaScript within a PartialView that's called from another PartialView my not work

这篇关于加载和编辑数据的jQuery UI的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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