1
Page_Load()
2 {
3 this .FileUpload1.Attributes.Add( " onchange " , " document.getElementById(' " + this .Image1.ClientID + " ').src=document.getElementById(' " + this .FileUpload1.ClientID + " ').value " );
4
5 }
2 {
3 this .FileUpload1.Attributes.Add( " onchange " , " document.getElementById(' " + this .Image1.ClientID + " ').src=document.getElementById(' " + this .FileUpload1.ClientID + " ').value " );
4
5 }
1
<
asp:FileUpload ID
=
"
FileUpload1
"
runat
=
"
server
"
/>
2 < br />
3 < asp:Image ID = " Image1 " runat = " server " />
4 < br />
5 < asp:Button ID = " Button1 " runat = " server " Text = " Button " OnClick = " Button1_Click " />
6
this.FileUpload1.Attributes.Add("onchange", "document.getElementById('" + this.Image1.ClientID + "').src=document.getElementById('" + this.FileUpload1.ClientID + "').value");
2 < br />
3 < asp:Image ID = " Image1 " runat = " server " />
4 < br />
5 < asp:Button ID = " Button1 " runat = " server " Text = " Button " OnClick = " Button1_Click " />
6