N
Neo Geshel
Just moved to C# from VB.NET, frustrated to hell and back by inability
to get much-copied (from about 20+ different resources) literal example
to work.
Master Page content:
<meta name="keywords" content="<asp:Literal ID="ltrlKeywords"
Runat="server" />"></meta>
Code-Behind:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
public partial class MySiteMaster : System.Web.UI.MasterPage{
protected void Page_Load (object sender, EventArgs e){
ltrlKeywords.Text="This is a test";
}
}
Resulting error:
Compiler Error Message: CS0117:
'System.Web.UI.HtmlControls.HtmlGenericControl' does not contain a
definition for 'Text'
Why did I use a literal instead of focusing on the <meta> itself?
Because I am using XHTML 1.1, and I cannot have any residual ID
attributes hanging around (a meta element does not have an ID attribute,
and making the meta have a runat="server" causes the ID to remain in the
element after ASP.NET is finished with it)
This error keeps occurring, even when I do cut-and-paste examples form
such big-name books as Wrox ASP.NET 2.0 Pro.
This is making me tear my hair out, and I have precious little of it
left on top. Please help!!!
TIA
...Geshel
--
*********************************************************************
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL†(all uppercase).
*********************************************************************
to get much-copied (from about 20+ different resources) literal example
to work.
Master Page content:
<meta name="keywords" content="<asp:Literal ID="ltrlKeywords"
Runat="server" />"></meta>
Code-Behind:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
public partial class MySiteMaster : System.Web.UI.MasterPage{
protected void Page_Load (object sender, EventArgs e){
ltrlKeywords.Text="This is a test";
}
}
Resulting error:
Compiler Error Message: CS0117:
'System.Web.UI.HtmlControls.HtmlGenericControl' does not contain a
definition for 'Text'
Why did I use a literal instead of focusing on the <meta> itself?
Because I am using XHTML 1.1, and I cannot have any residual ID
attributes hanging around (a meta element does not have an ID attribute,
and making the meta have a runat="server" causes the ID to remain in the
element after ASP.NET is finished with it)
This error keeps occurring, even when I do cut-and-paste examples form
such big-name books as Wrox ASP.NET 2.0 Pro.
This is making me tear my hair out, and I have precious little of it
left on top. Please help!!!
TIA
...Geshel
--
*********************************************************************
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL†(all uppercase).
*********************************************************************