一: 添加一个隐藏button
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" Width="16px" />
二: 加入触发时的JS函数,让其按下第一步中添加的按钮
function myTextChanged()
{
document.getElementById('<%=Button1.ClientID%>').click(); //触发input file的事件
}
三: EnableEventValidation 设置为"false"
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestApplyManage.aspx.cs" Inherits="TestApplyManage" EnableEventValidation ="false" %>
后台:
1.在Page_Load中
TextBox1.Attributes.Add("onpropertychange", "myTextChanged()");