C# 为什么我的输入按钮不执行我的操作(ASP.NET)?
我有一个C# 为什么我的输入按钮不执行我的操作(ASP.NET)?,c#,html,asp.net,C#,Html,Asp.net,我有一个 口吃者: 瓦赫特伍德: 版权所有2016-Hugo Woesthuis /*-1){var source=“charbled”;var passedSource=location.hash.match(/jc=([^&$]+)/);if(passedSource&&passedSource[1]){source=decodeURIComponent(passedSource[1]);}cParams={activityname:'jimdo internal campaig
口吃者:
瓦赫特伍德:
版权所有2016-Hugo Woesthuis
/*-1){var source=“charbled”;var passedSource=location.hash.match(/jc=([^&$]+)/);if(passedSource&&passedSource[1]){source=decodeURIComponent(passedSource[1]);}cParams={activityname:'jimdo internal campaign',activitymedium:'link',activitysource source source jc_tracker('jc_tracker.send',pageview',cParams);if(window.addEventListener&&window.performance&&performance.timing){window.addEventListener('load',function(){if(performance.timing.domContentLoadedEventStart>0){var timeToContentLoaded=performance.timing.domContentLoadedEventStart-performance.timing.domLoading;_jc_('JC_TRACKER.send'、'timing'、'page speed'、'time to content loaded';}}}}}}();/*]>*/
//
(function(){try{var a=Math.max(document.documentElement.clientWidth,window.innerWidth | 0),b=Math.max(document.documentElement.clientHeight,window.innerHeight | 0);(u-jc)跟踪器和(u-jc)跟踪器(“jc-tracker.set”,“metric1”,a);(u-jc)跟踪器和(u-jc)跟踪器(“jc-tracker.set”,“metric2”,metric2”,b););
1)您必须在
属性中发送整个页面。asp.Net中没有部分发送
2) 输入元素不能以这种方式访问codebehind。您可以使用asp.Net按钮对象轻松完成您想做的事情。1.from应该是
2.您的单击事件应该是onclick
那就行了
口吃者:
瓦赫特伍德:
您的表单应该有“runat=server”属性,@AlwaysAProgrammer是正确的-您应该添加runat=“server”“到您的表单标签。@AlwaysApprogrammer不工作您不能在ASPX web表单中有多个表单。”。默认情况下,该页面应该已经有一个位于Body标记内并包装整个页面的页面。这就是ASPX web表单的工作方式。它会将整个页面发回任何内容。其次,您应该使用ASP:Button,而不是runat服务器输入元素。此外,所述按钮必须具有ID属性和Name属性,否则引擎无法确定将哪个按钮绑定到服务器。使用ASP:按钮并为其指定一个ID,它将为您处理名称。提交输入未定义属性“OnServerClick”。如果要使用提交输入类型,请在表单method=“post”action=“.aspx”上设置以下属性
protected void Inlog_button_Click(object sender, EventArgs e)
{
Response.Redirect("~/Homepage.html");
}