10

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.

Steve B
  • 36,818
  • 21
  • 101
  • 174
ryanthescot
  • 327
  • 4
  • 16
  • Are you using some sort of template for your pages? The Access Key is typically blank by default. – mellamokb Jul 11 '12 at 15:59
  • you put the first letters within `` tags... – Steve B Jul 11 '12 at 16:01
  • SteveB: *Really*? Did you read the question? – mellamokb Jul 11 '12 at 16:01
  • Do you have any control adapter in your project (*.browsers files) or a custom jquery plugin ? – Steve B Jul 11 '12 at 16:04
  • I'm not using a template but I'm using a few jquery plugins (cycle and jcarousel) but im sure they are not doing anything with the login control – ryanthescot Jul 11 '12 at 16:17
  • when you saw your webform in desinger mode still the starting character is Italic ? and also try Asp.Net label control in your login control instead of using HTML Label. – Waqar Janjua Jul 11 '12 at 16:32
  • no in designer mode the characters are not in italics. i find it strange that other examples i have seen of using the asp:login code do not have italics. – ryanthescot Jul 12 '12 at 09:21

3 Answers3

2

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.

LockeCJ
  • 558
  • 1
  • 4
  • 21
1

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.

ryanthescot
  • 327
  • 4
  • 16
0

You may want to check the AccessKey property of the login control and the individual controls pasted within the login section such as Label, TextBox and buttons. By removing the AccessKey value should fix the issue.

Learner
  • 11
  • 2