Hey everyone, I've run into a strange issue while trying to pass string parameters to a JavaScript function from the code behind. Here is the current code snippet that I believe is causing the problem:
thumbnail = "<a href = 'javascript:RemovePirctureDetail(" + field1 + ",'" + tempname + "');' class='label label-default' rel='tooltip'>Remove</a>";
When I view this in the browser, the result looks like this:
<a href="javascript:RemovePirctureDetail(4673," download.jpg');'="" class="label label-default" rel="tooltip" data-original-title="" title="">Remove</a>
It seems that for some reason, the string parameter is causing the HTML formatting to become incorrect. The desired result should be:
<a href="javascript:RemovePirctureDetail(4673, 'download.jpg');" class="label label-default" rel="tooltip" data-original-title="" title="">Remove</a>
I have tried sending the quotation marks differently from the code behind by using /', but that did not solve the issue either. Does anyone know how I can fix this problem? Any help would be greatly appreciated.
Thank you.