Tag: jquery

ASP.NET Forms自动保存

我们有一个内部的asp.net表单应用程序,其中一个页面本质上是一个WYSIWYG编辑器,用户输入3-5段报告。 具有最少量用户中断的自动保存function的最佳选项是什么? 我不想每五分钟左右强制回发一次,除非我不得不这样做,而是每次文本更改时可能会进行某种类型的客户端检查,并将其与上次提交信息的时间进行比较,然后从那里?

在asp.net MVC2中将html表导出为ex​​cel

您好我正在寻找有关如何在ASP.NET MVC中导出到Excel的最佳方式 现在我从billsternberger.net得到了这个 使用C#从ASP.NET MVC导出到Excel或CSV //Export to excel public ActionResult Download() { List lookupList = data,GetLookupList(); var grid = new System.Web.UI.WebControls.GridView(); grid.DataSource = lookupList; grid.DataBind(); Response.ClearContent(); Response.AddHeader(“content-disposition”, “attachment; filename=YourFileName.xlsx”); Response.ContentType = “application/vnd.ms-excel”; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); grid.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); return View(); } 这是从绑定到datagrid并导出到excel。 现在我需要做的是获取我的html表并将其导出到excel,我在操作表数据时使用jquery数据表,因此它会更轻,因为它是在客户端完成的。 我尝试使用jquery和ajax,我将我的html表传递给我的控制器上的实体 function Export() { var […]

GridView上的弹出式引导程序模型使用RowCommand事件进行单击

我有一个Bootstrap Model弹出窗口: × ADD NEW BANQUET Banquet ID: Banquet Name: 而GridView是: <asp:Label ID="lblID" runat="server" Visible="false" Text='’> <asp:Label ID="lblName" runat="server" Text='’ > Events 这是RowCommand事件: protected void gvBanquet_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow row = (GridViewRow)(((Control)e.CommandSource).NamingContainer); int index = row.RowIndex; string id = GetTextFromGridViewLabel(gvBanquet,index,”lblID”); string name = GetTextFromGridViewLabel(gvBanquet, index, “lblName”); switch (e.CommandName) { case “EditRow”: lblID.Text = […]

使用无效变量名称的jQueryvalidation远程:如何修复?

我正在使用jQuery Validation进行远程validation。 我试图在MVC中调用我的服务器端代码,但问题是我的变量是在嵌套类中: public class Customer { public State HouseState {get;set;} } public class State { public string Name {get;set;} } 在我的* .cshtml中我有这个: @Html.TextBoxFor(m => m.HouseState.Name, new { placeholder = “State Name”}) 我正在添加validation: $.validator.addMethod(“verify”, verify); $(‘#HouseState_Name’).rules(‘add’, { verify: true, remote: ‘@Url.Content(“~/Home/Validate”)’, messages: { verify: “No!” } }); 在这种情况下,它将生成如下的GET请求: http://localhost/Home/Validate?HouseState.Name=CA 问题是它希望我的服务器中的变量是House.Name是C#中无效的变量名。 有没有办法在客户端中自定义此变量或为服务器中的变量创建别名? 我已经尝试过使用FormCollection并且它有效,但远非完美。 public JsonResult Validate(FormCollection […]