上传控件不点按钮直接传

 <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("_","$") + "','')");
            }

posted @ 2015-03-27 19:45  王鹏飛  阅读(174)  评论(0编辑  收藏  举报