P
Patxi
I repost this due to a mismatxh with Subject...
Hi,
I've created a class inheriting System.Web.UI.Page, and all this stuff I
was doing worked until now...
I want to setup some 'global' meta values, doing this:
I tested in my class contructor...
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("href", "~/newstyle.css");
this.Header.Controls.Add(link);
I have this error on an aspx.cs inheriting my class instead of
System.Web.UI.Page:
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 176: link.Attributes.Add("href", "~/newstyle.css");
Line 177: this.Page.Header.Controls.Add(link);
It would be really nice if I could render all meta stuff in my base
class without calling it from page.aspx.cs...
P.S.: if i put the code in Page_Load method of my base class, nothing
happens...
TIA
Hi,
I've created a class inheriting System.Web.UI.Page, and all this stuff I
was doing worked until now...
I want to setup some 'global' meta values, doing this:
I tested in my class contructor...
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("href", "~/newstyle.css");
this.Header.Controls.Add(link);
I have this error on an aspx.cs inheriting my class instead of
System.Web.UI.Page:
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Source Error:
Line 176: link.Attributes.Add("href", "~/newstyle.css");
Line 177: this.Page.Header.Controls.Add(link);
It would be really nice if I could render all meta stuff in my base
class without calling it from page.aspx.cs...
P.S.: if i put the code in Page_Load method of my base class, nothing
happens...
TIA