c# - asp.net imageurl -


Uploading images to my web page server folder 'd: \ upresim' Images I'm adding are:

  Secure Zero Button 2_Click (Object Sender, EventArgs e) {FileUpload1.SaveAs (Server.MapPath ("~ / image / a.png")) ; Image1.ImageUrl = "~ / image / a.png"; }   

I have a selected image, that I received from FileUpload that I selected in the server from the selected image in the upresim folder Has added to. AdWords needs to show me the image I added on Image 1, but it can not show anything what can I do?

You must upload an image under your web app folder, for that folder your app is on the filesystem There should be a rifeth to write, and then set the relative URL to the image control image url. You should also check that the upload has a file, and preferably use it from the file uploaded with the file name. For example, suppose you have upescim folder in your web site root folder, then use this code:

  if (FileUpload1.HasFile) {FileUpload1.SaveAs (Server MapPath ("/ Upresim /") + FileUpload1.FileName); Image1.ImageUrl = "/ upresim /" + FileUpload1.FileName; }    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

c# - Add Image in a stackpanel based on textbox input -

java - Reaching JTextField in a DocumentListener -