按钮的点击事件是't在asp.net中触发
The click event of button isn't trigged in asp.net
我的页面中有一个按钮,您可以在这里看到:
<div class="buttonPossion">
<asp:Button ID="btnFinal" runat="server" Text="دانلود مقاله" CssClass="buttonBlue" OnClick="btnFinal_Click"/>
</div>
该按钮的点击事件为:
protected void btnFinal_Click(object sender, EventArgs e)
{
int count =
dbcontext.tblJurorArticles.Where(i => i.articleid == articleId && i.jurorUsername == Session["juror"])
.Count();
if (count == 1)
{
Response.Redirect("../AdminPortal/DownloadArticleHandler.ashx?File=" +
obj.Return_filelocation_article(articleId.ToString()));
}
else
{
Response.Redirect("asda");
}
}
但当我点击按钮时,它不起作用。重要的是我在页面中的所有按钮都被禁用了。
如果需要html代码,我可以把它包括在我的问题中。
webconfig
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="DB-Conference-CivilConstruction" connectionString="Data Source=176.9.90.204,9992;Initial Catalog=DB-Conference-CivilConstruction;User ID=DB-Conference-CivilConstruction-user; password=123qweQWE@;"
providerName="System.Data.SqlClient" />
<!--<add name="DB-Conference-CivilConstruction" connectionString="Data Source=192.168.223.75;Initial Catalog=DB-Conference-CivilConstruction;User ID=DB-Conference-CivilConstruction-user; password=123qweQWE@;"
providerName="System.Data.SqlClient" />-->
</connectionStrings>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime maxRequestLength="1048576" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
</configuration>
向致以最良好的问候
如果您的eventClick调用回发并启动page_Load函数而不移动到您的点击事件hundler,并且您确定OnClick属性具有正确的事件hundle名称,则您必须检查web.config
在本节
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="xxx" />
</appSettings>
将其更改为
<appSettings>
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />
</appSettings>
如果"MaxHttpCollectionKeys"不存在,请添加它。
并在下更改此配置
<configuration>
<system.web>
<httpRuntime maxRequestLength="xxx" />
至
<configuration>
<system.web>
<httpRuntime maxRequestLength="51200" />
相关文章:
- 借助asp.net验证或java脚本对多个文本进行验证
- 将Javascript数组发送到控制器ASP.NET MVC
- ASP.NET通过单击JavaScript按钮触发c#事件
- 文本框不是从Javascript/Asp.net中的对话框中打印出来的
- 从javascript调用asp.net codebehind函数
- 使用javascript的Asp.net内容占位符
- 获取ASP.NET Ajax Timer状态
- ASP.NET网络摄像头显示
- 如何在只能有一个asp.net表单的主页上从asp.net页面中的javascript中获取值
- 如何将乳胶配方奶粉图像保存到Asp.net中的文件夹中
- asp.net,包括iss上的javascript slow
- 选择不在GridView-ASP.NET中激发
- 什么'是在asp.net MVC中将本地化的resources.resx文件转换为javascript文件的有效
- 使用ASP.NET将谷歌地图添加到项目中,并从数据库中检索位置
- 有什么“;错误的”;将javascript放在asp.net表单上,而不是放在单独的文件中
- 将Javascript日期转换为ASP.NET日期格式
- C#asp.net mvc Set CheckBoxFor已检查的具有Model Value的属性
- 在asp.net中确认是或否消息
- ASP.NET MVC 3-在ajax调用后,重定向到新页面或生成页面刷新
- asp.net中的验证工具