Tag: jquery mobile

MVC 4razor数据注释ReadOnly

ReadOnly属性似乎不在MVC 4中。可编辑(false)属性不能按照我希望的方式工作。 有类似的东西有效吗? 如果没有,那么我如何创建自己的ReadOnly属性,如下所示: public class aModel { [ReadOnly(true)] or just [ReadOnly] string aProperty {get; set;} } 所以我可以这样说: @Html.TextBoxFor(x=> x.aProperty) 而不是这(它确实有效): @Html.TextBoxFor(x=> x.aProperty , new { @readonly=”readonly”}) 或者这(它确实有效,但未提交值): @Html.TextBoxFor(x=> x.aProperty , new { disabled=”disabled”}) http://view.jquerymobile.com/1.3.2/dist/demos/widgets/forms/form-disabled.html 这样的事可能吗? https://stackoverflow.com/a/11702643/1339704 注意: [可编辑(假)]无效

MVC4多按钮forms不起作用JQM

我在MVC4中面对我的JQuery移动APP上的一个奇怪的问题: 我有一个表格,里面有几个这样的texbox @using Models @model Models.DataModel.Pagina_Details @{ Layout = “~/Views/Shared/_Layout.cshtml”; } @using (Html.BeginForm(“Pagina_Details”, “Home”, FormMethod.Post, new { id = “PaginaDetailsForm” })) { if (Request.QueryString[“Command”] != null) { Session[“Command”] = Request.QueryString[“Command”]; } else { Response.Redirect(“Index”); } Pagina’s @Html.HiddenFor(model => model.ID) @Html.LabelFor(model => model.Name, “Naam *”, new { @class = “lbl”}) @Html.TextBoxFor(model => model.Name, new { required […]

延迟加载SELECT元素选项w / jquerymobile,c#和asp.net

我的一个jQuery Mobile页面上有一个SELECT元素,它有很多可能的值。 显然,在页面加载时加载所有选项会增加移动手机的性能问题。 什么是“按需”加载项目的好方法? 我需要的一个例子是Android市场如何加载应用程序列表:最初加载x个项目,然后在滚动到选项底部后再加载x个项目,然后x更多……依此类推)。 我正在使用C#/ ASP.NET(Razor语法)来实现jQuery Mobile。

ASP.NET MVC3 jQuery移动页面的Ajax代码绑定使用PageInit事件

我们正在使用ASP.NET MVC3 + JqueryMobile RC1编写JQueryMobile应用程序。 很少有页面有自己的Ajax方法,我们使用jQuery代码( $.getJSON() )方法调用它们。 要在Ajax调用中调用这些,我们会在jquery-mobile的“pageinit”事件中单击事件绑定,如此处所述( http://jquerymobile.com/demos/1.0rc1/docs/api/events.html )。 但是,通过每次访问页面,调用绑定到pageinit的方法会增加+1。 例如,如果我使用后退按钮或任何其他链接再次访问我的页面,请再次访问它,调用两次pageinit方法,并且在pageinit内写入的任何代码执行两次…这些随着每次访问页面而不断增加。 我们应该使用哪个事件来绑定事件。 它应该只在页面加载时调用一次? 编辑: – 我们想要JQM的默认AJAX行为,并且我们将AjaxEnabled保持为true。 示例源代码(您可以通过创建新的MVC3 APP并使用给定代码替换以下三个.cshtml来重现此问题: – 我的_Layout.cshtml: – $(document).bind(“mobileinit”, function () { $.mobile.ajaxEnabled = true; }); @RenderSection(“HeaderScripts”, required: false) @ViewBag.Title About Home @RenderBody() @RenderSection(“BodyScriptsSection”, required: false) @RenderSection(“MobileFooter”, required: false) 示例Index.cshtml @{ ViewBag.Title = “Home Page”; ViewBag.DivTitle = “HomeIndex”; } @section […]