admin管理员组

文章数量:1415137

How do I escape apostrophes / single quotes in ASP XML?

<asp:Button ID="myButton" runat="server"
    OnClientClick='confirm("How do you escape this apos'trophe?")' />

How do I escape apostrophes / single quotes in ASP XML?

<asp:Button ID="myButton" runat="server"
    OnClientClick='confirm("How do you escape this apos'trophe?")' />
Share Improve this question edited Aug 24, 2012 at 14:55 Craig Ringer 326k80 gold badges735 silver badges813 bronze badges asked Apr 15, 2010 at 19:27 Joe PhillipsJoe Phillips 51.3k33 gold badges108 silver badges166 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6
<asp:Button ID="btnClone" runat="server" OnClick="btnClone_Click"
    OnClientClick="confirm('How do you escape this apos\'trophe?')" />
<asp:Button ID="myButton" runat="server"
    OnClientClick='confirm("How do you escape this apos&#39;trophe?")' />

本文标签: aspnetEscape apostrophe in aspx fileStack Overflow