小编pho*_*tom的帖子

将 OnClick 事件添加到 Html.RadioButton

我想要做的是在用户单击单选按钮时调用 JavaScript 例程。发生这种情况时,我有一些字段可以启用/禁用。然而,当我进入

 <%=Html.RadioButton("obp17", "57", ViewData.Eval("obpValue17").ToString().Equals("57"), new {@onclick = "Yes()"})%>
Run Code Online (Sandbox Code Playgroud)

尝试添加 onlick 事件时,出现“键入或带有”预期错误。这应该很容易,但我发现的样本似乎都不起作用。前导“@”在我发现的所有示例中都很常见,但似乎缺少其他东西。

是的,我知道检查“true”的方法有点矫枉过正,但它是用特殊用途的代码生成器创建的,因此没有任何额外的工作。

有什么想法吗?

model-view-controller asp.net-mvc

1
推荐指数
1
解决办法
4万
查看次数

ASP.Net 4.0错误消息 - BC30456:'Title'不是.的成员

我有一个ASP.Net 4.0 Web表单页面,它在我们的Web服务器上给出了以下错误

在此输入图像描述

此页面在我的localhost计算机上正确运行.这是Web应用程序中唯一存在此问题的页面.我已经尝试将\ bin目录的内容复制到Web服务器,并将ASPX网页从我的localhost复制到Web服务器.

关于我接下来会尝试什么的想法?

asp.net asp.net-4.0

1
推荐指数
1
解决办法
9728
查看次数

MIssing Asp.Net会话ID Cookie

我有一个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不是问题.

建议?

asp.net asp.net-mvc asp.net-mvc-4

0
推荐指数
1
解决办法
3137
查看次数

在JavaScript函数参数中传递双引号

我遇到以下html的问题

<span onClick="alert('hi&#34 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 &#34 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)

javascript

0
推荐指数
1
解决办法
7140
查看次数