views:

11

answers:

0

I have pages with special characters in the title for proper typography, for example it says Exchange ‘07 Groups" with a proper apostrophe, not a single quote. The HTML entity for the apostrophe is ‘

So, I've found that if I set the page title from VB, the title displays just fine, but as soon as an update panel updates that HTML entity gets re-encoded and displays incorrectly as "Exchange ‘07 Groups"

So here's my code where I simply set the page title, then an update panel, and a button to update it...

<script runat="server">
    Protected Sub Page_Load(...) Handles Me.Load
       Page.Title = "Exchange &#8216;07 Groups"
    End Sub

    Protected Sub uxLnkDoClick(ByVal sender As Object, ByVal e As System.EventArgs)
        uxLitLoaded.Text = "Loaded!"
    End Sub
</script>

<!DOCTYPE html>
<html>
<head runat="server"></head>
<body>
<form id="form1" runat="server">
    <asp:ScriptManager runat="server"></asp:ScriptManager>    
    <asp:UpdatePanel runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:LinkButton runat="server" ID="uxLnkDo" OnClick="uxLnkDoClick" Text="Do Something" />
            <asp:Literal runat="server" ID="uxLitLoaded" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="uxLnkDo" />
        </Triggers>
    </asp:UpdatePanel>
</form>
</body>
</html>

What can be done about this?

related questions