is this a bug?

A

Agustin Sanchez

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
 
A

Alvin Bruney

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top