<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Client Side Web Development</title><link>http://forums.asp.net/130.aspx</link><description>Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=18&amp;c=16" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1459787.aspx</link><pubDate>Fri, 10 Nov 2006 03:30:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1459787</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1459787.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1459787</wfw:commentRss><description>&lt;p&gt;Thank you so much. LudovicoVan and RoamingLlama.&lt;/p&gt;&lt;p&gt;Your code works very wells after adding my internal web server url in trusted site list. but firefox. In order to run that code in Firefox, I heard that I need to have NoScript Extension for adding my internal web server in trusted site. I haven't tested yet. &lt;/p&gt;&lt;p&gt;Thanks. &amp;nbsp;&lt;/p&gt;&lt;p&gt;Ajax?&amp;nbsp; Yeah. It would be good. But MS Altas might not be a solution for me since I'm using ASP.NET 1.1. So, maybe I will try with normal javascript and XmlHttpRequest object. I was thinking whether uploading image file for each preview would be good or not. but ya. my project is just for internal used only. I will try and will let you know.. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks so much again. all of you.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1458555.aspx</link><pubDate>Thu, 09 Nov 2006 10:32:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1458555</guid><dc:creator>LudovicoVan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1458555.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1458555</wfw:commentRss><description>&lt;p&gt;&lt;blockquote&gt;&lt;div&gt;&lt;img src="http://forums.asp.net/Themes/default/images/icon-quote.gif" /&gt; &lt;strong&gt;RoamingLlama:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;The solution that Julio suggested would be good for the job as long as everyone uses IE and (if its IE7) you want to add the site to the "trusted sites" list.&amp;nbsp; However, I would probably lean towards an earlier suggestion to use Microsoft AJAX to accomplish this.&lt;/div&gt;&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The question was indeed how to build a client-side preview in the context of an Intranet&lt;/strong&gt;, where you have full control over client software, and you were one of those underlying this since the beginning, if I am not wrong. In case one has to program for the Internet, this wouldn't of course be a feasible approach, as I have myself said since the beginning.&lt;/p&gt;
&lt;p&gt;And, &lt;strong&gt;I wouldn't anyway suggest Ajax&lt;/strong&gt;, because: 1st) the functionality to realize here was a local file browse with preview, and Ajax doesn't solve this, you stil have to upload the file first, and that is not a&amp;nbsp;local preview anyway; 2nd) and&amp;nbsp;even more important, tell an asker the basic approach first, that is upload the image and show it in a round-trip. Ajax is a further step. Ajax is &lt;strong&gt;always &lt;/strong&gt;a further step...&lt;/p&gt;
&lt;p&gt;Regards. -LV&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1457569.aspx</link><pubDate>Wed, 08 Nov 2006 18:23:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1457569</guid><dc:creator>RoamingLlama</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1457569.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1457569</wfw:commentRss><description>&lt;p&gt;Julio,&amp;nbsp;&lt;/p&gt;&lt;p&gt;At first this code did not work in IE7 but as you mentioned I had to add your site to my "Trusted Sites" list.&lt;/p&gt;&lt;p&gt;Michael,&lt;/p&gt;&lt;p&gt;The solution that Julio suggested would be good for the job as long as everyone uses IE and (if its IE7) you want to add the site to the "trusted sites" list.&amp;nbsp; However, I would probably lean towards an earlier suggestion to use Microsoft AJAX to accomplish this.&amp;nbsp; First write a script to upload the image to either a database or to the file system on the server somewhere.&amp;nbsp; After that is working implement the necessary controls (and a bit of code) on the Web Form to accomplish displaying the image.&amp;nbsp; Then, just AJAX enable it.&amp;nbsp; Remember that you will want to have a way to automatically delete the temporary images that get stored on the server for preview purposes (probably have them in a temp directory then on each new session simply clear out the temp folder).&amp;nbsp; This process should run rather smoothly and swiftly since it is running on the local intranet.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Dan&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1456947.aspx</link><pubDate>Wed, 08 Nov 2006 10:20:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1456947</guid><dc:creator>LudovicoVan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1456947.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1456947</wfw:commentRss><description>&lt;p&gt;Below is the code, in case my site goes down... ;) -LV&lt;/p&gt;&lt;pre class=coloredcode&gt;&amp;lt;&lt;span class=tag&gt;!DOCTYPE&lt;/span&gt; html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;
&amp;lt;&lt;span class=tag&gt;html&lt;/span&gt;&lt;span class=attr&gt; xmlns=&lt;/span&gt;&lt;span class=attrv&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span class=attr&gt; xml:lang=&lt;/span&gt;&lt;span class=attrv&gt;"en"&lt;/span&gt;&lt;span class=attr&gt; lang=&lt;/span&gt;&lt;span class=attrv&gt;"en"&lt;/span&gt;&amp;gt;
   &amp;lt;&lt;span class=tag&gt;head&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class=tag&gt;title&lt;/span&gt;&amp;gt;julio.diegidio.name - SandBox / LocalBrowse&amp;lt;/&lt;span class=tag&gt;title&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class=tag&gt;meta&lt;/span&gt;&lt;span class=attr&gt; http-equiv=&lt;/span&gt;&lt;span class=attrv&gt;"Content-Type"&lt;/span&gt;&lt;span class=attr&gt; content=&lt;/span&gt;&lt;span class=attrv&gt;"text/html; charset=utf-8"&lt;/span&gt; /&amp;gt;
   &amp;lt;/&lt;span class=tag&gt;head&lt;/span&gt;&amp;gt;
   &amp;lt;&lt;span class=tag&gt;body&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class=tag&gt;form&lt;/span&gt;&lt;span class=attr&gt; action="" onsubmit=&lt;/span&gt;&lt;span class=attrv&gt;"return false"&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span class=tag&gt;p&lt;/span&gt;&amp;gt;Select: &amp;lt;&lt;span class=tag&gt;input&lt;/span&gt;&lt;span class=attr&gt; id=&lt;/span&gt;&lt;span class=attrv&gt;"FileBox"&lt;/span&gt;&lt;span class=attr&gt; type=&lt;/span&gt;&lt;span class=attrv&gt;"file"&lt;/span&gt;
&lt;span class=attr&gt;   onchange=&lt;/span&gt;&lt;span class=attrv&gt;"fileChange()"&lt;/span&gt; /&amp;gt;&amp;lt;/&lt;span class=tag&gt;p&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span class=tag&gt;p&lt;/span&gt;&amp;gt;Preview: &amp;lt;&lt;span class=tag&gt;img&lt;/span&gt;&lt;span class=attr&gt; id=&lt;/span&gt;&lt;span class=attrv&gt;"FileImg"&lt;/span&gt;&lt;span class=attr&gt; src="" style=&lt;/span&gt;&lt;span class=attrv&gt;"width: 10em"&lt;/span&gt;
&lt;span class=attr&gt;   onload=&lt;/span&gt;&lt;span class=attrv&gt;"fileLoad()"&lt;/span&gt; /&amp;gt;&amp;lt;/&lt;span class=tag&gt;p&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span class=tag&gt;p&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class=tag&gt;span&lt;/span&gt;&lt;span class=attr&gt; id=&lt;/span&gt;&lt;span class=attrv&gt;"FileDsp"&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class=tag&gt;em&lt;/span&gt;&amp;gt;Waiting...&amp;lt;/&lt;span class=tag&gt;em&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class=tag&gt;span&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class=tag&gt;p&lt;/span&gt;&amp;gt;

      &amp;lt;/&lt;span class=tag&gt;form&lt;/span&gt;&amp;gt;
      
      &amp;lt;&lt;span class=tag&gt;script&lt;/span&gt;&lt;span class=attr&gt; type=&lt;/span&gt;&lt;span class=attrv&gt;"text/javascript"&lt;/span&gt;&amp;gt;
      /*&amp;lt;&lt;span class=tag&gt;![CDATA[*/&lt;/span&gt;
var fileRef = -1;

function fileChange() {
   fileRef = setTimeout("fileErr()", 100);
   
   var fileBox = document.getElementById("FileBox");
   var fileImg = document.getElementById("FileImg");
   var fileDsp = document.getElementById("FileDsp");
   
   // Keep order!
   fileDsp.innerHTML = "&amp;lt;&lt;span class=tag&gt;em&lt;/span&gt;&amp;gt;Loading...&amp;lt;/&lt;span class=tag&gt;em&lt;/span&gt;&amp;gt;";
   
   fileImg.src = fileBox.value;
   //
}

function fileErr() {
   if(fileRef &amp;lt; 0) return;
   
   var fileDsp = document.getElementById("FileDsp");
   
   fileDsp.innerHTML = "&amp;lt;&lt;span class=tag&gt;em&lt;/span&gt;&amp;gt;Error: unsupported or invalid format!&amp;lt;/&lt;span class=tag&gt;em&lt;/span&gt;&amp;gt;";
}

function fileLoad() {
   fileRef = -1;
   
   var fileImg = document.getElementById("FileImg");
   var fileDsp = document.getElementById("FileDsp");
   
   fileDsp.innerHTML = fileImg.src;
}
      /*]]&amp;gt;*/
      &amp;lt;/&lt;span class=tag&gt;script&lt;/span&gt;&amp;gt;
      
   &amp;lt;/&lt;span class=tag&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class=tag&gt;html&lt;/span&gt;&amp;gt;&lt;/pre&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1456940.aspx</link><pubDate>Wed, 08 Nov 2006 10:13:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1456940</guid><dc:creator>LudovicoVan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1456940.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1456940</wfw:commentRss><description>&lt;p&gt;Hello Michael,&lt;/p&gt;
&lt;p&gt;&amp;gt; As I need to use this project within my office, all users who are using this project can be trusted.&lt;/p&gt;
&lt;p&gt;It is the site to be trusted by user systems, not the reverse. Also, you were actually replacing the first back-slash only. Anyway...&lt;/p&gt;
&lt;p&gt;Anyway, you know, &lt;strong&gt;I have tried it on IE6/Win98 and IE6/WinXP+SP2&amp;nbsp;and it *works*&lt;/strong&gt;! Didn't even need to touch my security settings, but if IE7 complains, then you might try to add the site to the trusted list. However, it doesn't work in FX, nor I guess in any non-IE browser.&lt;/p&gt;
&lt;p&gt;I have simplified the script a bit, since the replace stuff is unneeded, but have added some error handling. &lt;strong&gt;You can see it live here&lt;/strong&gt;: &lt;a class="" href="http://julio.diegidio.name/Sandbox/LocalBrowse.htm" target=_blank&gt;http://julio.diegidio.name/Sandbox/LocalBrowse.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I only have one final doubt, that is that it works for me because it is a plain&amp;nbsp;html page, not an .aspx page. In that case, either you again&amp;nbsp;might try by trusting the site in IE, or you might work-around it with an IFRAME.&lt;/p&gt;
&lt;p&gt;Hope this helps, and please let me know if it worked for you! Thanks.&amp;nbsp;-LV&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1456663.aspx</link><pubDate>Wed, 08 Nov 2006 04:20:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1456663</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1456663.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1456663</wfw:commentRss><description>&lt;p&gt;Thank you all.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&amp;gt;&amp;gt;As&amp;nbsp;&lt;a href="http://forums.asp.net/members/LudovicoVan.aspx"&gt;LudovicoVan&lt;/a&gt;&amp;nbsp; said, you need to virtual path, to access the image file.&lt;/p&gt;&lt;p&gt;I guess There won't be no way to get the virtual path because the user is allowed to select any photo file in his/her machine for changing the Employee Photo.&lt;/p&gt;&lt;p&gt;@
										&lt;a href="http://forums.asp.net/members/RoamingLlama.aspx"&gt;RoamingLlama&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Sorry. man. I have tested your code in local IIS. It's not working. I tested as the following.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Copy your code.&lt;/li&gt;&lt;li&gt;Paste it in notepad&lt;/li&gt;&lt;li&gt;Save it as htm ext&lt;/li&gt;&lt;li&gt;Put this file into one of my existing virtual directory&lt;/li&gt;&lt;li&gt;Run this file from localhost&lt;/li&gt;&lt;li&gt;Click "Browse" button &lt;br /&gt;
  &lt;/li&gt;&lt;li&gt;Select one JPG file &lt;br /&gt;
  &lt;/li&gt;&lt;li&gt;[ not working ]&lt;/li&gt;&lt;li&gt;Try to repeat step 6 to 7&lt;/li&gt;&lt;li&gt;[ not working ]&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;As I said in previous thread, I need to deploy this project on Internal Web Server. So, it should work on Web Server also. &lt;/p&gt;&lt;p&gt;&lt;a href="http://forums.asp.net/members/LudovicoVan.aspx"&gt;@LudovicoVan&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;gt;&amp;gt;Your code can work locally but, for security reasons, the file:
path&amp;nbsp;won't work from a web server, that is from a page served over
http:.&lt;/p&gt;&lt;p&gt;As I need to use this project within my office, all users who are using this project can be trusted. &lt;/p&gt;&lt;p&gt;Do I need to change the security setting of IIS? &lt;/p&gt;&lt;p&gt;Thanks so much.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1456193.aspx</link><pubDate>Tue, 07 Nov 2006 20:20:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1456193</guid><dc:creator>RoamingLlama</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1456193.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1456193</wfw:commentRss><description>&lt;p&gt;I was under the impression that this would be running locally on his machine...in which case the above code that I posted would work.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1456099.aspx</link><pubDate>Tue, 07 Nov 2006 18:57:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1456099</guid><dc:creator>e_screw</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1456099.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1456099</wfw:commentRss><description>&lt;p class=ForumPostUserName&gt;As&amp;nbsp;&lt;a href="http://forums.asp.net/members/LudovicoVan.aspx"&gt;LudovicoVan&lt;/a&gt;&amp;nbsp; said, you need to virtual path, to access the image file. File path wont work when accessing from web server.&lt;/p&gt;
&lt;p class=ForumPostUserName&gt;Thanks&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1455795.aspx</link><pubDate>Tue, 07 Nov 2006 15:33:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1455795</guid><dc:creator>RoamingLlama</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1455795.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1455795</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;This is very simple to do.&amp;nbsp; I have re-writen your code here:&lt;/p&gt;&lt;pre class=coloredcode&gt;&amp;nbsp;&lt;pre class=coloredcode&gt;&amp;lt;&lt;span class=tag&gt;html&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class=tag&gt;head&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;meta&lt;/span&gt;&lt;span class=attr&gt; http-equiv=&lt;/span&gt;&lt;span class=attrv&gt;"Content-Type"&lt;/span&gt;&lt;span class=attr&gt; content=&lt;/span&gt;&lt;span class=attrv&gt;"text/html; charset=windows-1252"&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;META&lt;/span&gt;&lt;span class=attr&gt; http-equiv=&lt;/span&gt;&lt;span class=attrv&gt;"Pragma"&lt;/span&gt;&lt;span class=attr&gt; content=&lt;/span&gt;&lt;span class=attrv&gt;"no-cache"&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;title&lt;/span&gt;&amp;gt;Image Src&amp;lt;/&lt;span class=tag&gt;title&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;script&lt;/span&gt;&lt;span class=attr&gt; lang=&lt;/span&gt;&lt;span class=attrv&gt;"javascript"&lt;/span&gt;&amp;gt;
      function changePic(imgId,strPath) {
        var path = new String(strPath);
        path = path.replace("\\","/");
        path = "file:///" + path;
        if(document.getElementById){
          image = document.getElementById(imgId);
          image.setAttribute("src",path);
        }
      }
    &amp;lt;/&lt;span class=tag&gt;script&lt;/span&gt;&amp;gt;
  &amp;lt;/&lt;span class=tag&gt;head&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class=tag&gt;body&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;img&lt;/span&gt;&lt;span class=attr&gt; id=&lt;/span&gt;&lt;span class=attrv&gt;"img1"&lt;/span&gt;&lt;span class=attr&gt; height=&lt;/span&gt;&lt;span class=attrv&gt;"85"&lt;/span&gt;&lt;span class=attr&gt; src=&lt;/span&gt;&lt;span class=attrv&gt;"ATT00199.jpg"&lt;/span&gt;&lt;span class=attr&gt; width=&lt;/span&gt;&lt;span class=attrv&gt;"70"&lt;/span&gt;&lt;span class=attr&gt; border=&lt;/span&gt;&lt;span class=attrv&gt;"0"&lt;/span&gt; /&amp;gt;&amp;lt;&lt;span class=tag&gt;br&lt;/span&gt; /&amp;gt;
    &amp;lt;&lt;span class=tag&gt;input&lt;/span&gt;&lt;span class=attr&gt; id=&lt;/span&gt;&lt;span class=attrv&gt;"filBrowse"&lt;/span&gt;&lt;span class=attr&gt; type=&lt;/span&gt;&lt;span class=attrv&gt;"file"&lt;/span&gt;&lt;span class=attr&gt; onChange=&lt;/span&gt;&lt;span class=attrv&gt;"changePic('img1',this.value)"&lt;/span&gt;&lt;span class=attr&gt;	size=&lt;/span&gt;&lt;span class=attrv&gt;"5"&lt;/span&gt;&lt;span class=attr&gt; name=&lt;/span&gt;&lt;span class=attrv&gt;"filBrowse"&lt;/span&gt;&lt;span class=attr&gt; width=&lt;/span&gt;&lt;span class=attrv&gt;"10"&lt;/span&gt; /&amp;gt;
  &amp;lt;/&lt;span class=tag&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class=tag&gt;html&lt;/span&gt;&amp;gt;&lt;/pre&gt;&amp;nbsp;&lt;/pre&gt;&amp;nbsp;This code works in Firefox and IE.&amp;nbsp;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1455688.aspx</link><pubDate>Tue, 07 Nov 2006 14:14:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1455688</guid><dc:creator>imran.nathani</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1455688.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1455688</wfw:commentRss><description>&lt;p&gt;I am sure that you either store the photo path or the photo itself in the database.......................so first the update to the databse is required.....this cannot be done by javascript....but you want an effect that the image has changed on client side............use &lt;strong&gt;Microsoft's AJAX&lt;/strong&gt; i.e.in an updatepanel put the image control&amp;nbsp;&amp;amp; after the&amp;nbsp;upload call a trigger for a pratial post back of the update panel.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1455591.aspx</link><pubDate>Tue, 07 Nov 2006 12:09:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1455591</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1455591.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1455591</wfw:commentRss><description>&lt;p&gt;Thanks.&lt;br /&gt;Actually, I'm working on ASP.NET project for internal use. There is one page called Employee Details that allows the users to enter new profile or update the existing profile. The users is able to update Employee Photo too. So, The updated images should be show in Image control as soon as the user choose new photo.&lt;/p&gt;&lt;p&gt;The coding that I show above is working fine in IE6. but not on other.. :( &lt;/p&gt;&lt;p&gt;Any Idea? &lt;/p&gt;&lt;p&gt;Thanks. &amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1455547.aspx</link><pubDate>Tue, 07 Nov 2006 11:13:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1455547</guid><dc:creator>LudovicoVan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1455547.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1455547</wfw:commentRss><description>&lt;p&gt;&lt;blockquote&gt;&lt;div&gt;&lt;img src="http://forums.asp.net/Themes/default/images/icon-quote.gif" /&gt; &lt;strong&gt;mchlSync:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;It's working fine normally.. but It doesn't work if we run this code in IIS. &lt;br /&gt;[...] There is one page that a user allow to browse the image from their hard disk and upload this image to the Server&lt;/div&gt;&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;Your code can work locally but, for security reasons, the file: path&amp;nbsp;won't work from a web server, that is from a page served over http:.&lt;/p&gt;
&lt;p&gt;-LV&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1455501.aspx</link><pubDate>Tue, 07 Nov 2006 10:25:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1455501</guid><dc:creator>imran.nathani</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1455501.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1455501</wfw:commentRss><description>&lt;p&gt;what you could do is simply put the image tag in a DIV &amp;amp; then change the innerHTML property of the div as follows&lt;/p&gt;
&lt;p&gt;&amp;lt;div id="DIV1" style="width: 100px; position: relative; height: 100px"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;img src="" style="position: relative" /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;in the javascript use&lt;/p&gt;
&lt;p&gt;var path ="/MY/images/IMG.jpg";&lt;br /&gt;document.getElementById("DIV1").innerHTML="&amp;lt;img src='"+path+"'/&amp;gt;";&lt;/p&gt;</description></item><item><title>Changing Image Src from JavaScript</title><link>http://forums.asp.net/thread/1455303.aspx</link><pubDate>Tue, 07 Nov 2006 06:43:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1455303</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1455303.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=1455303</wfw:commentRss><description>&lt;p&gt;Could anyone please check the code?&lt;br /&gt;
It's working fine normally.. but It doesn't work if we run this code in IIS. &lt;br /&gt;
Actually, Im working on one ASP.NET Project. There is one page that a
user allow to browse the image from their hard disk and upload this
image to the Server. Everything is working fine except displaying the
image that the user selected on IMG tag..&lt;br /&gt;
&lt;br /&gt;
It would be great if anyone can help me to fix this code..&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="alt2" style="border:1px inset;margin:0px;padding:3px;overflow:auto;width:640px;height:402px;"&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&amp;gt;&lt;br /&gt;&lt;b&gt;&amp;lt;META http-equiv="Pragma" content="no-cache"&amp;gt;&lt;/b&gt;&lt;br /&gt;&amp;lt;title&amp;gt;Image Src&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script lang="javascript"&amp;gt;&lt;br /&gt; function changePic(imgId,strPath)&lt;br /&gt; {&lt;br /&gt;         var o = document.getElementById(imgId);&lt;br /&gt;	 var s = new String(strPath);&lt;br /&gt;	 s = s.replace("\\","/");&lt;br /&gt;	 o.src = "file:///" + s;    &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;IMG id=img1 height=85 src="ATT00199.jpg" width=70 border=0&amp;gt; &amp;lt;/A&amp;gt;&lt;br /&gt;&amp;lt;INPUT id="filBrowse" type="file" onchange="changePic('img1',this.value)"&lt;br /&gt;	size="5" name="filBrowse" width="10"&amp;gt;&amp;lt;BR&amp;gt;	&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks in advance. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>