User-1853544428 posted
Hi,
I have written a control, which is located in ~/lukrsControls/mainMenu/myControl.ascx.
Inside of this control i do this in page_load event:
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink link = new HtmlLink();
link.Href = "lukrsControls/mainMenu/mainMenu.css";
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
head.Controls.Add(link);
This code adds a link to my css inside head element. The problem is, that I would like to remove this part of the path -> lukrsControls/mainMenu/, with some funtion that would generate this part of the link if you know what I mean.
(this way, my control could be used in any directory)
For example, I have a hyperlink in the same class and its NavigateUrl property is "Default.aspx?id=". When I start the application, the link automatically gets "lukrsControls/mainMenu". But the HtmlLink for my head doesn't.
I would really appreciate any help...
Thanks,
LP, Lukrs