Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery和@Html.Label_Jquery_Asp.net Mvc 3 - Fatal编程技术网

jquery和@Html.Label

jquery和@Html.Label,jquery,asp.net-mvc-3,Jquery,Asp.net Mvc 3,我遇到的问题是,虽然它传递了函数Username,但在传递了 $("#Name").text("*"); In debug mode in Mozilla, it displays undefined! What is wrong or what have I missed? 我有@Html.LabelName,和 当您编写@Html.LabelName时,不会生成Html,这有点奇怪,但这就是这个帮助程序的实现方式@Html.LabelName,将生成以下Html: <label f

我遇到的问题是,虽然它传递了函数Username,但在传递了

$("#Name").text("*");  In debug mode in Mozilla, it displays undefined! What is wrong or what have I missed?
我有@Html.LabelName,和

当您编写@Html.LabelName时,不会生成Html,这有点奇怪,但这就是这个帮助程序的实现方式@Html.LabelName,将生成以下Html:

<label for="Name"> </label>

我确实觉得很奇怪。我做了以下操作:@Html.LabelName,Name@Html.LabelnamePrompt,@Html.Label,nameprompt@Html.LabelnamePrompt,nameprompt,以下是Html生成的名称50 51 nameprompt 52 nameprompt我不需要标签中的任何文本,但是使用@Html.LabelName,不会生成Html标记!@HTml.LabelName没有生成任何HTml标记!这对你有用吗?@user281180,是的,这正是我在回答中所说的。请尝试使用@HTml.LabelName。注意这个空间.谢谢.我没有注意到这个空间。愚蠢的我!
<label for="Name"> </label>
$('label[for=Name]').html('*');