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. 

```
$('#ContentPlaceHolder1_photoSpotImage').attr('src', src.replace(/-thumbs/, ''));

```

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. 

```
<asp:LinkButton runat="server" PostBackUrl="" ID="link2TheDownload" Text="+ download it" onclick="link2TheDownload_Click"></asp:LinkButton>

```

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

```
    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();

```

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

I need to get the current filename so I the user can download the proper image file.

Help!