Why when I change the src of an image with jquery, the the src is not changed in my c# codebehind?
<p>I have a gallery of thumbnails. When you click on a thumbnail, the main image changes to the thumbnail clicked by using jQuery and changing the 'src' tag of the . This works as expected. </p>

<pre><code>$('#ContentPlaceHolder1_photoSpotImage').attr('src', src.replace(/-thumbs/, ''));
</code></pre>

<p>I have a link that, when clicked, makes the image a downloadable file using the Content-Disposition methods in the header. When hard-set in the code it works as expected. </p>

<pre><code>&lt;asp:LinkButton runat="server" PostBackUrl="" ID="link2TheDownload" Text="+ download it" onclick="link2TheDownload_Click"&gt;&lt;/asp:LinkButton&gt;
</code></pre>

<p>Now, I have added programmatically in the codebehind get the filename of the selected image from the 'src' tag of the  tag.  </p>

<pre><code>    string thisServerName = Request.ServerVariables["SERVER_NAME"].ToString();
    string thisHref = "http://" + thisServerName + "/" +photoSpotImage.Src.ToString();
    Uri uri = new Uri(thisHref);
    string filename = Path.GetFileName(uri.LocalPath);
    string thisAttachment = "attachment; filename=" + filename.ToString();
    Response.ContentType = "image/jpeg";
    Response.AppendHeader("Content-Disposition", thisAttachment.ToString());
    Response.TransmitFile(strDirectFilePath.ToString() + "/photos/1/" + filename.ToString());
    Response.End();
</code></pre>

<p>The C# only has the filename that is initially set Onload and it appears that the jQuery has not changed the src.</p>

<p>I need to get the current filename so I the user can download the proper image file.</p>

<p>Help!</p>
