Home All Groups Group Topic Archive Search About

Help: Why <mobile:label> doesn't render HTML tag?

Author
28 Dec 2005 3:07 PM
Hongbo
Hi,

I have a mobile form:
===
<body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
    <mobile:Form id=Form1 runat="server">
    <mobile:label runat="server" id="lblT" />
    </mobile:Form>
</body> 
===

In the code behind page, I have:
===
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label lblT;

private void Page_Load(object sender, System.EventArgs e)
{
lblT.Text="<a href=\"/default.aspx\">default</a>";
}
===

But when I run the page, the mobile:label displays the source code of the hyperlink as:
   <a href=\"/default.aspx\">default</a>

It seems that mobile:label doesn't render HTML tag.

Would you please tell me why mobile:label behave like this? Are there ways that can
allow mobile:label to render HTML tag properly?

Thank you

Hongbo

Author
28 Dec 2005 5:06 PM
Bruce Barker
because a label is for rendering text, not html controls. use a link, or generic

-- bruce (sqlwork.com)
  "Hongbo" <hon***@goodoffices.com> wrote in message news:ulrupA8CGHA.4016@TK2MSFTNGP11.phx.gbl...
  Hi,

  I have a mobile form:
  ===
  <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
      <mobile:Form id=Form1 runat="server">
      <mobile:label runat="server" id="lblT" />
      </mobile:Form>
  </body> 
  ===

  In the code behind page, I have:
  ===
  protected System.Web.UI.MobileControls.Form Form1;
  protected System.Web.UI.MobileControls.Label lblT;

  private void Page_Load(object sender, System.EventArgs e)
  {
   lblT.Text="<a href=\"/default.aspx\">default</a>";
  }
  ===

  But when I run the page, the mobile:label displays the source code of the hyperlink as:
     <a href=\"/default.aspx\">default</a>

  It seems that mobile:label doesn't render HTML tag.

  Would you please tell me why mobile:label behave like this? Are there ways that can
  allow mobile:label to render HTML tag properly?

  Thank you

  Hongbo

Bookmark and Share