Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.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
C# 在Internet Explorer中从输入类型:文件调用Server Click失败_C#_Asp.net - Fatal编程技术网

C# 在Internet Explorer中从输入类型:文件调用Server Click失败

C# 在Internet Explorer中从输入类型:文件调用Server Click失败,c#,asp.net,C#,Asp.net,下面是我的aspx文件中的代码,我试图从hdnBtn.click()调用hdnBtn的onserverclick 下面的代码适用于Firefox和Chrome,但不适用于IE,你知道为什么吗?谢谢你的帮助 protected void Page_Load(object sender, EventArgs e) { btnBrowse.Attributes.Add("onclick", file1.ClientID + ".click()"); file1.Attr

下面是我的aspx文件中的代码,我试图从hdnBtn.click()调用hdnBtn的onserverclick

下面的代码适用于Firefox和Chrome,但不适用于IE,你知道为什么吗?谢谢你的帮助

  protected void Page_Load(object sender, EventArgs e)
  {
      btnBrowse.Attributes.Add("onclick", file1.ClientID + ".click()");
      file1.Attributes.Add("onchange", hdnBtn.ClientID + ".click()");
  }

input runat="server" id="btnBrowse" type="button" value="..." class="lookupBtn" 
      disabled=true 

input style="visibility:hidden" type="file" runat="server" name="file1" id="file1" 

input style="visibility:hidden" type="button" runat="server" name="hdnBtn" 
      id="hdnBtn" value="" onserverclick="btnLookUpFile_Click"

那不行。不能从javascript调用服务器端方法。您可以通过以下方式撤销回发: 将
OnClick
设置为
\uu doPostBack()


阅读有关呈现页面的更多信息请给我[input name=“ctl00$CPH1$btnBrowse”type=“button”id=“btnBrowse”value=“…”class=“lookupBtn”onclick=“file1.click()”],[input name=“ctl00$CPH1$file1”type=“file”id=“file1”onchange=“test()”,[input onclick=“\uu-doPostBack('ctl00$CPH1$hdnBtn'),”名称=“ctl00$CPH1$hdnBtn”type=“button”id=“hdnBtn”]当我在IE中使用开发人员工具进行调试时,它确实进入了u doPostBack函数,但它仍然不会触发我需要的后端函数