我想要做的是在用户单击单选按钮时调用 JavaScript 例程。发生这种情况时,我有一些字段可以启用/禁用。然而,当我进入
<%=Html.RadioButton("obp17", "57", ViewData.Eval("obpValue17").ToString().Equals("57"), new {@onclick = "Yes()"})%>
Run Code Online (Sandbox Code Playgroud)
尝试添加 onlick 事件时,出现“键入或带有”预期错误。这应该很容易,但我发现的样本似乎都不起作用。前导“@”在我发现的所有示例中都很常见,但似乎缺少其他东西。
是的,我知道检查“true”的方法有点矫枉过正,但它是用特殊用途的代码生成器创建的,因此没有任何额外的工作。
有什么想法吗?
我有一个ASP.Net 4.0 Web表单页面,它在我们的Web服务器上给出了以下错误

此页面在我的localhost计算机上正确运行.这是Web应用程序中唯一存在此问题的页面.我已经尝试将\ bin目录的内容复制到Web服务器,并将ASPX网页从我的localhost复制到Web服务器.
关于我接下来会尝试什么的想法?
我有一个MVC4,.Net4.5应用程序,我们正在使用会话.由于没有明显的原因,MVC4没有创建会话ID Cookie.以下是web.config中的身份验证和会话状态设置
<authentication mode="Forms">
<forms cookieless="UseCookies" loginUrl="~/Login" timeout="480"></forms>
</authentication>
<sessionState timeout="50" cookieless="UseCookies" mode="InProc"/>
Run Code Online (Sandbox Code Playgroud)
由于存在Forms Auth cookie,因此cookie不是问题.
建议?
我遇到以下html的问题
<span onClick="alert('hi" more stuff')">Works</span><br/>
<span onClick='alert("Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.")'>Works long text</span>
<br />
<span onClick='alert("Far far " away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large …Run Code Online (Sandbox Code Playgroud)