Click here to Skip to main content
15,886,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to write Server.HtmlEncode


success: function (result) {
                   var doc = '';
                   $.each(result, function (i, val) {
                       doc = doc + '<li><a onclick="setOfferDocument(\''+val.CompanyName + '\')"  class="link-download" href="javascript:void(0)" >' + companyName + '</a><br /></li>'
                   });


What I have tried:

doc = doc + '<li><a onclick="setOfferDocument(\'' + @Server.HtmlEncode(val.CompanyName) + '\')"  class="link-download" href="javascript:void(0)" >' + companyName + '</a><br /></li>'




but this is giving me error
Posted
Updated 19-Apr-17 2:12am
Comments
Nirav Prabtani 19-Apr-17 4:09am    
What kind of error you are getting, Elaborate more...

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900