Search code examples
asp.net.netitalics

why are the first characters in my asp login labels in italics?


I can't work out why the first characters of all the labels on my asp login forms are showing in italics:

enter image description here

The code looks like this:

<asp:login DestinationPageUrl="blah.aspx" runat="server" usernamelabeltext="Email Address" ></asp:login>

When I inspect it using firebug it shows that the first characters are being enclosed in tags, like so:

<label for="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_wwContentArea_ctl03_UserName">
<em>E</em>
mail Address
</label>
...
<label for="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_wwContentArea_ctl03_Password">
<em>P</em>
assword:
</label>

Does anyone know what may be causing this? I thought it might have been something to do with access keys (if I press alt+e then it focuses to the email text box) but I cant work out how to stop this.


Solution

  • I can't answer why it was doing it, but I've managed to work around it.

    With the line of code still as follows:

    <asp:login DestinationPageUrl="/schools/what-works/whatworkssearch.aspx" runat="server" usernamelabeltext="Email Address"></asp:login>
    

    This is what the control looked like in designer view:

    enter image description here

    Although there are no italics shown, it was being rendered with the first characters in italics as I described in my question. To get around this I converted the control to a template like so:

    enter image description here

    This created a template that shows the labels for the login fields and therefore I could remove the italics tags.

    Although this doesn't answer why it was behaving like this for the single line of code, it shows how to get around it.