-1

i wants to add Single Quote to string value Received from object

sb.Append("<input type='button' id='buyNow_"+i+"' class='GetQuote' onclick='return getProposerSection('"+ objResponse.objQuoteDetails[i].PlanName+ "')'/>"

2 Answers2

0

The easiest way is this:

sb.Append("<input type='button' id='buyNow_"+i+"' class='GetQuote' onclick='return getProposerSection(\""+ objResponse.objQuoteDetails[i].PlanName+ "\")'/>"

Notice the double quotes at the beginning and end of your attribute value.

Fabio Milheiro
  • 7,649
  • 16
  • 55
  • 89
0

Use backslash ("\") character for escaping the character

check link How do I write a backslash (\) in a string?

Community
  • 1
  • 1
BornToCode
  • 199
  • 1
  • 7