|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Template Column and ImageHi,
I am using a template column. There is an image in that template column. But if I change the url of the image, image does not shown. I debugged program and I see that there is no wrong in path. I mean that my image is in true folder. Code: -------------------- string new_url= "file:///F:\\Inetpub\\wwwroot\\PROJECT\\arrows\\arrow1.jpg"; System.Web.UI.WebControls.Image image= (System.Web.UI.WebControls.Image)datagrid1.Items[i].FindControl("Image1"); // i = index.. image.ImageUrl = new_url; -------------------- This the code that I am changing image url. Is there any thing that I should write? Thanks. -- huseyin_akturk ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------ The URL you specify in the image isn't the path from the server's perspective.
The URL should be form the client's perspective. So it'll be a path the browser can use to find the image. It'll look like "http://yourserver/yourapp/directory/arrow1.jpg". The reason it was working before is probabaly because you were running your browser on the same machine as the server, so the "file://" URI was accessible form the browser. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi, > I am using a template column. There is an image in that template > column. But if I change the url of the image, image does not shown. I > debugged program and I see that there is no wrong in path. I mean that > my image is in true folder. > Code: > -------------------- > string new_url= > "file:///F:\\Inetpub\\wwwroot\\PROJECT\\arrows\\arrow1.jpg"; > System.Web.UI.WebControls.Image image= > (System.Web.UI.WebControls.Image)datagrid1.Items[i].FindControl("Image > 1"); // i = index.. > image.ImageUrl = new_url; > -------------------- > > This the code that I am changing image url. Is there any thing that I > should write? > Thanks. > -- > huseyin_akturk > ---------------------------------------------------------------------- > -- > Posted via http://www.codecomments.com > ---------------------------------------------------------------------- > --
Webform Navigation
Can't set button to Visible? Is someone willing to help me with a simple VB example? Skin and custom controls (ASP 2.0) Web Custom Control using a property displaying current form text boxes Dynamically populating and expanding TreeView from button click... Datagrid - How to format EditCommandColumn? SortCommand and custom headers - why won't they play nice? Composite Web Control Open Source or Free PDF Control |
|||||||||||||||||||||||