image onclick event is not working
-
using System.Web.UI.WebControls; Image thumbImage = new Image(); thumbImage.Attributes.Add("onclick", "window.location.href='" + @"\images\" + filePath + "';"); but the resulting page is giving following error: Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /thumbdb/imagesWaterlilies.jpg
-<>-shoaib-<>-
-
using System.Web.UI.WebControls; Image thumbImage = new Image(); thumbImage.Attributes.Add("onclick", "window.location.href='" + @"\images\" + filePath + "';"); but the resulting page is giving following error: Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /thumbdb/imagesWaterlilies.jpg
-<>-shoaib-<>-
-
use this thumbImage.Attributes.Add("onclick", "window.location.href='" + @"..\images\" + filePath + "';");
the problem is that after "window.location.href", browser discardes all the "\" characters. For example the resulting url after following statement is.. thumbImage.Attributes.Add("onclick", "window.location.href='" + @"..\images\" + filePath + "';"); http://localhost:4258/thumbdb/..imagesWaterlilies.jpg You can view that after images there is no any "\" character.
-<>-shoaib-<>-