Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 553
ryanthescot Avatar asked Jul 11 '12 15:07

ryanthescot


2 Answers

For me, it was because I was using the CSS Friendly Control Adapters. Since my primary motivation for installing them was for the menu control adapter, I've disabled the login control adapter.

  • Open the CSSFriendAdapters.browser in the App_Browsers folder.
  • Comment out the LoginAdapter, like so:

    <!--<adapter controlType="System.Web.UI.WebControls.Login" adapterType="CSSFriendly.LoginAdapter" />-->
    

There's probably a way to get the advantages of the CSS adapter without the italics.

like image 154
LockeCJ Avatar answered Nov 10 '22 12:11

LockeCJ


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.

like image 37
ryanthescot Avatar answered Nov 10 '22 12:11

ryanthescot