下面提到的是我的按钮的代码
<button type="button"  Value="End Test" class="testBtns" style="float:right;"onclick="location.href='@Url.Action("StudentResult", "Student", new {  TestId = ViewBag.TestId ,style="color:white"} )'" />
i am not getting the "End Text" text on my button anybody know then please help发布于 2014-08-05 06:53:50
试试这个;
<button type="button"  class="testBtns" style="float:right;" onclick="location.href='@Url.Action("StudentResult", "Student", new {  TestId = ViewBag.TestId ,style="color:white"} )'" >End Test</button>value属性指定<button>在<form>中的初始值,而不是显示文本。
发布于 2014-08-05 06:55:30
只需将按钮更正为:
<button type="button"  class="testBtns" style="float:right;" onclick="location.href='@Url.Action("StudentResult", "Student", new {  TestId = ViewBag.TestId },new { @style="color:white" } )'">End Test</button>您想要在按钮中显示的文本应该包含在button tag的开始标记和结束标记之间,并且只要更正@url.action,您就可以将object route和html attributes混合在一起。
https://stackoverflow.com/questions/25132749
复制相似问题