Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This Is A FileUpload What I Need In Here Is To Make it Auto PostBack=True Or Mianly
I Need It To Automaticlly do The Following c# code in codebehind after The use Chooses The Pic He Want:
*****(Notice The Following PLz I have In the Page Just FileUpload And Image No Use OF Buttons Or Any Thing Else)

if(this.FileUpload1.HasFile)
this.image1.imageurl=this.FileUpload1.FileName;

<asp:FileUpload ID="FileUpload1" runat="server" Style="z-index: 103; left: 240px;
    position: absolute; top: 317px" />



And Thank You All (I am nEW aT THIS BLOG AND IT IS FANTASTIC)
Posted
Updated 14-Jun-11 22:10pm
v3

1 solution

You can do something like this. This is not tested. Please try this.

C++
<asp:FileUpload ID="myFileUpload" onchange="if (confirm('Upload ' + this.value + '?')) this.form.submit();" runat="server" />


Asking the users for confirmation is recommendable, so they stay in control of the process and can cancel if they chose the wrong file by accident.
 
Share this answer
 
Comments
marwan93 15-Jun-11 3:49am    
no it didnt work and i need the picture url to go directly to the image no buttons no java nno nothimg directly after he clicks browse and ok to choose the image it appears on the sceen as image1.url
but thank you very much good answer maybe if u try it and let it work then tell me how to do it i will use it thank u very much really

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900