上传控件不点按钮直接传

 <asp:FileUpload ID="fuPhoto"  runat="server" ToolTip="选择图片" />
            <asp:LinkButton ID="lbUploadPhoto"  runat="server" OnClick="lbUploadPhoto_Click" ></asp:LinkButton>

 

 if(!IsPostBack)
            {
               fuPhoto.Attributes.Add("onchange", "javascript:__doPostBack('" + lbUploadPhoto.ClientID.Replace("_","$") + "','')");
            }

你可能感兴趣的:(上传)