![](/img/trans.png)
[英]MVC3 Telerik Treeview Add HTML Elements(Button) to each node
[英]MVC3 HTML button
我正在使用MVC3,但我不想使用Microsoft.Web.Mvc
如何轉換此代碼以在MVC3中使用? 視圖引擎是.aspx
Html.Button ("abc", "Button abc", HtmlButtonType.Button)
還有這個腳本
$("button[name=abc]").attr("disabled",true);
任何反饋表示贊賞嗎?
按鈕的HTML標記 :
<input type="button" name="abc" disabled="true" value="Button abc" />
ASP.NET MVC 3沒有用於按鈕的內置HtmlHelper
擴展方法。 你總是可以輕松地創建於:
public static class YourMvcButtonExtensionMethod
{
public static MvcHtmlString Button(this HtmlHelper helper, string text,
IDictionary<string, object> htmlAttributes)
{
// generate the markup for the input/button
}
}
因此,您確實有兩種選擇:
“我正在使用MVC3,但我不想使用Microsoft.Web.Mvc。”這聽起來令人困惑……
無論如何,您可以改用button元素。
<button disabled='true'>Button abc</button>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.