htmlgenericcontrol

ASP.NET: Setting the Style of an HTML element Programatically

Hi! I'm generating a menu with a Repeater control bound to an XmlDataSource. <asp:Repeater ID="myRepeater" runat="server" DataSourceID="myDataSource" onitemdatabound="myRepeater_ItemDataBound" onitemcreated="myRepeater_ItemCreated"> <HeaderTemplate> <ul class="menu_list"> </HeaderTemplate> <ItemTemp...

Accessing a HtmlGenericControl on a MasterPage from a ContentPage

Hi there, so I've got the following structures; Start.master (Start.master.cs) Contains a Method DoSomething(string Text) { _MyHtmlControl.InnerText = Text; } And the HtmlGenericControl ID'ed *MyHtmlControl Page.aspx (Page.aspx.cs) Calls the Method via new Start().DoSomething("Test"); Doing so gives me the following error:...

Self closing Html Generic Control?

I am writing a bit of code to add a link tag to the head tag in the code behind... i.e. HtmlGenericControl css = new HtmlGenericControl("link"); css.Attributes["rel"] = "Stylesheet"; css.Attributes["type"] = "text/css"; css.Attributes["href"] = String.Format("/Assets/CSS/{0}", cssFile); to try and achieve something like... <link rel...

Adding 2 HTMLGenericControl script with src attribute not working

I have asp.net 2.0 c# application. I have 2 scripts I want to add to a user control's control collection. Instead of adding them one after another, it only opens one script tag and throws the 2 src strings together as strings string tagLinks = "/Resources/Javascript/js/taglinks.js"; HtmlGenericControl scriptTagLinks = new HtmlGenericCo...

apply css for a HTML Generic control like <UL> and <LI> in asp.net

hai guys, I dont know how to apply css for a HTML Generic control like <UL> and <LI> given runat="server" in asp.net.... I am finding the <li> in a master page from a content page... Once i found that control i want to apply css... <ul id="mainMenu" runat="server" style="width:350px;"> <li id="mainHome" runat="server"><a title="Home...

How do I register a server side click on an HTMLGenericControl?

I'm looking for a reliable mechanism to generate a server side postback handler for an HTMLGenericControl such as an li element. I have some markup that I do not wish to change and would prefer to treat this in the same fashion as a standard .Net server control. Also, I know I can use a template based control to place some .Net contr...