在视图的部分页面中禁用和启用按钮 [英] disable and enable button in a partial page of a view

查看:111
本文介绍了在视图的部分页面中禁用和启用按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视图(主页),其中有2个部分页面.

第一个(部分页面)有数据,另一个第二个(部分页面)是购物车.
两者都在同一页上.对于选择,我通过单击选择"按钮在一页中进行选择,然后将所选项目发送到购物车(部分页面)中.购物车(部分页面)和一个确认并取消按钮.现在,我需要在购物车页面上禁用提交按钮,然后再加载它.一旦加载了项目,则提交按钮应该处于活动状态.因为提交"按钮会显示帐单信息(另一个视图).

我已经以这种方式给出了按钮.使用MVC3,Jquery,JavaScript

I have a view(Home) with 2 partial pages in it.

1st (partial page) has data and the other 2nd (partial page) is a cart.
Both are on the same page. For the selection I make in one page by clicking a "select" button I send the selected items into the cart(partial page). the cart (partial page) and a confirm and cancel button.now I need to disable the submit button in the cart page before its loaded. once its loaded with items then the submit button should be active. as the submit button leads to billing information(another view).

I have given the button this way. Using MVC3,Jquery,JavaScript

 <a type="button" href="@Url.Action("Index", "Billing")">Submit </a>
<a type="button" href="@Url.Action("Index", "Home")">Cancel</a>

推荐答案

您可以将ActionLink用作
You can use ActionLink as
<%: Html.ActionLink("Submit", "Index", "Billing", new {}, new {@disabled = "disabled"}; %>


这篇关于在视图的部分页面中禁用和启用按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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