is this a bug?

Discussion in 'ASP .Net Web Controls' started by Agustin Sanchez, Jul 17, 2003.

  1. I made the following test page to set the text of the LABEL1 control
    (asp:Label). But the text is not displayed unless I set it as static text.
    If I assign a script to the property, nothing is displayed. Any ideas?

    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false"
    Inherits="WebUI.CRM.net.Controls.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm1</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema"
    content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="WebForm1" method="post" runat="server">
    <asp:LinkButton Runat="server" id="LinkButton1">
    <asp:Label id=Label1 Runat="server" Text='<%#"TEST"%>'>
    </asp:Label>
    </asp:LinkButton>
    </form>
    </body>
    </HTML>

    If I view the source code for the generated page:


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm1</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema"
    content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form name="WebForm1" method="post" action="webform1.aspx?env=defaultdev"
    id="WebForm1">
    <input type="hidden" name="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE"
    value="dDwtMTMxMTg2MTY5MDs7PtayKb39twSNIGG4wPQIiuNw/hFE" />

    <script language="javascript">
    <!--
    function __doPostBack(eventTarget, eventArgument) {
    var theform = document.WebForm1;
    theform.__EVENTTARGET.value = eventTarget;
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }
    // -->
    </script>

    <a id="LinkButton1"
    href="javascript:__doPostBack('LinkButton1','')"><span
    id="Label1"></span></a>
    </form>
    </body>
    </HTML>


    You see the label is implemented as a SPAN, but no text is set to it.


    Thanks in advance.

    Agustin Sanchez
     
    Agustin Sanchez, Jul 17, 2003
    #1
    1. Advertising

  2. Agustin Sanchez

    Alvin Bruney Guest

    bug??
    not sure, usually some psycho at MS conveniently forgets to put it in.
    Anyway the work around is to click once on the label control, then click
    again. Note, this is not a double click just two separate clicks and the
    cursor will appear inside the label control allowing you to type.
    On second thought it probably is a missing feature.

    "Rob" <> wrote in message
    news:031401c34d64$f94d7fe0$...
    > The text attribute for Label control is not available at
    > design time. This attribute is avaialble only at run time.
    > You can set this value at run time as Label1.text = "Text
    > Here"
    >
    >
    > >-----Original Message-----
    > >I made the following test page to set the text of the

    > LABEL1 control
    > >(asp:Label). But the text is not displayed unless I set

    > it as static text.
    > >If I assign a script to the property, nothing is

    > displayed. Any ideas?
    > >
    > ><%@ Page language="c#" Codebehind="WebForm1.aspx.cs"

    > AutoEventWireup="false"
    > >Inherits="WebUI.CRM.net.Controls.WebForm1" %>
    > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0

    > Transitional//EN" >
    > ><HTML>
    > > <HEAD>
    > > <title>WebForm1</title>
    > > <meta name="GENERATOR" Content="Microsoft Visual Studio

    > 7.0">
    > > <meta name="CODE_LANGUAGE" Content="C#">
    > > <meta name="vs_defaultClientScript"

    > content="JavaScript">
    > > <meta name="vs_targetSchema"
    > >content="http://schemas.microsoft.com/intellisense/ie5">
    > > </HEAD>
    > > <body MS_POSITIONING="GridLayout">
    > > <form id="WebForm1" method="post" runat="server">
    > > <asp:LinkButton Runat="server" id="LinkButton1">
    > > <asp:Label id=Label1 Runat="server" Text='<%#"TEST"%
    > >'>
    > > </asp:Label>
    > > </asp:LinkButton>
    > > </form>
    > > </body>
    > ></HTML>
    > >
    > >If I view the source code for the generated page:
    > >
    > >
    > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0

    > Transitional//EN" >
    > ><HTML>
    > > <HEAD>
    > > <title>WebForm1</title>
    > > <meta name="GENERATOR" Content="Microsoft Visual Studio

    > 7.0">
    > > <meta name="CODE_LANGUAGE" Content="C#">
    > > <meta name="vs_defaultClientScript"

    > content="JavaScript">
    > > <meta name="vs_targetSchema"
    > >content="http://schemas.microsoft.com/intellisense/ie5">
    > > </HEAD>
    > > <body MS_POSITIONING="GridLayout">
    > > <form name="WebForm1" method="post"

    > action="webform1.aspx?env=defaultdev"
    > >id="WebForm1">
    > ><input type="hidden" name="__EVENTTARGET" value="" />
    > ><input type="hidden" name="__EVENTARGUMENT" value="" />
    > ><input type="hidden" name="__VIEWSTATE"
    > >value="dDwtMTMxMTg2MTY5MDs7PtayKb39twSNIGG4wPQIiuNw/hFE" /
    > >
    > >
    > ><script language="javascript">
    > ><!--
    > > function __doPostBack(eventTarget, eventArgument) {
    > > var theform = document.WebForm1;
    > > theform.__EVENTTARGET.value = eventTarget;
    > > theform.__EVENTARGUMENT.value = eventArgument;
    > > theform.submit();
    > > }
    > >// -->
    > ></script>
    > >
    > > <a id="LinkButton1"
    > >href="javascript:__doPostBack('LinkButton1','')"><span
    > >id="Label1"></span></a>
    > > </form>
    > > </body>
    > ></HTML>
    > >
    > >
    > >You see the label is implemented as a SPAN, but no text

    > is set to it.
    > >
    > >
    > >Thanks in advance.
    > >
    > >Agustin Sanchez
    > >
    > >
    > >.
    > >
     
    Alvin Bruney, Jul 19, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John

    Re: BUG? OR NOT A BUG?

    John, Sep 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    591
  2. RedEye
    Replies:
    2
    Views:
    617
    Jason Kester
    Dec 13, 2005
  3. Michel Joly de Lotbiniere

    Bug Parade Bug 4953793

    Michel Joly de Lotbiniere, Nov 30, 2003, in forum: Java
    Replies:
    4
    Views:
    672
    Michel
    Dec 2, 2003
  4. DarkSpy
    Replies:
    4
    Views:
    917
    tom_usenet
    Jun 27, 2003
  5. Steve Holden
    Replies:
    1
    Views:
    423
    Behrang Dadsetan
    Jul 2, 2003
Loading...

Share This Page