Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > is this a bug?

Reply
Thread Tools

is this a bug?

 
 
Agustin Sanchez
Guest
Posts: n/a
 
      07-17-2003
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="dDwtMTMxMTg2MTY5MDs7PtayKb39twSNIGG4wPQIiuN w/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


 
Reply With Quote
 
 
 
 
Alvin Bruney
Guest
Posts: n/a
 
      07-18-2003
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" <(E-Mail Removed)> wrote in message
news:031401c34d64$f94d7fe0$(E-Mail Removed)...
> 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="dDwtMTMxMTg2MTY5MDs7PtayKb39twSNIGG4wPQIiu Nw/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
> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments