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
(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