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.

7
  • Are you using some sort of template for your pages? The Access Key is typically blank by default.
    – mellamokb
    Commented Jul 11, 2012 at 15:59
  • you put the first letters within <em> tags...
    – Steve B
    Commented Jul 11, 2012 at 16:01
  • SteveB: Really? Did you read the question?
    – mellamokb
    Commented Jul 11, 2012 at 16:01
  • Do you have any control adapter in your project (*.browsers files) or a custom jquery plugin ?
    – Steve B
    Commented Jul 11, 2012 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 Commented Jul 11, 2012 at 16:17

3 Answers 3

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.

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.