htmlcontrols

Creating HTMLControls versus outputting a string of HTML

I was recently trying to explain to a programmer why, in ASP.Net, they should create HTMLControls instead of creating HTML strings to create Web pages. I know it is a better way of doing things, but I really couldn't give concrete reasons, other than, "This way is better." If you had to answer this question, what would your answer be? ...

How to create HTML output without a) databinding or b) using Response.Write?

Kind of related to my other question - I've only ever used HTMLControls with runat="server" and WebControls grudgingly, preferring to have control over the markup that gets generated (including the ids of the elements, etc.). What's your suggestion for, say, iterating over the contents of a collection and generating a table or list with...

Text search in an AIR HTML Control

What are the different options available for implementing a text search in an AIR HTML control? I could think of the following two: Implement by injecting a custom javascript - the downside is the script may interfere with ones already loaded with page Implement an HTML scrapper and then parse this text in Actionscript, and then using ...

Customized button text for file upload

How do I change the button text of file upload HTML control from default "Browse" to anyother text? ...

Setting value in html control in code behind without making server control

Setting value in html control in code behind without making server control <input type="text" name="txt" /> <%--Pleas note I don't want put runat=server here to get the control in code behind--%> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> Code behind protected void Page_Load(object sende...

ASP .NET confusion - server controls

I have read through the information in this question: http://stackoverflow.com/questions/22084/asp-net-aspxxx-controls-versus-standard-html but am still rather confused. The situation was I was asked to do a web project where I made a wizard. When I was done with the project everyone asked why I had used an <asp:Wizard...>. I thought th...

Changing middle mouse behavior in Adobe AIR HTML Control?

I'm using the Flex 4/Adobe AIR mx:HTML control in a project and I'm trying to figure out how to change the middle mouse behavior. For some reason the control treats middle mouse clicks and drags exactly the same as left mouse clicks and drags, navigating through links and selecting text -- everything. For my project I need to use the m...

Custom HTMLControl derived from HtmlImage control not visible in VS2008 toolbox

I have a custom control deriving from HtmlImage control which I cant get to show up on toolbox, it says "There are no components in '...\bin\Debug\ImageCustomControl.dll' that can be placed on the toolbox.". Here is the code for the control: namespace ImageCustomControl { public class ImageHtmlControl : HtmlImage { p...

How to enable html select post back apsx page when selection changed?

With asp.NET control dropdownlist, there is a property AutoPostBack, if it is set "True", the whole page will be posted back. If the aspx page include a html element "select" like: <select id="list" name="list" runat="server" DataTextField="Name" DataValueField="ID" ></select> and it data is filled by code-behind. Question is: ...

Cast ASP type object to HtmlControl

Hey'all How do I cast a li dom element as HtmlControl from an ASP type object? I tried it like this: var li = (HtmlControl)sender; I get a InvalidCastException... The thing is, I want to make the li (a tab) clickable, and then update an UpdatePanel... But when I start like this <li id="li" runat="server" onclick="tab2_Click"> FooBa...

ASP.NET The SelectedIndex property is the same in the all HtmlSelect on the page

Hi, I have some HtmlSelect (a'la asp.net's DropDownList) with ID's like Select1, Select2, ..., Select13. I create the static List of items: for (int i = 0; i < tab.Length; i++) _listItems[i] = (new ListItem { Text = tab[0, i], Value = tab[1, i], Selected=false }); then I assign that list for each HtmlSelect control & assign a new Se...

how do i edit a masterpage div from child page?

what's the DIV equivalent to this command? ((Panel)this.Page.Master.FindControl("Panel1")).Style.Add("display", "none"); This works great with a panel but I can't find the variation for doing the same thing with a DIV who's ID I know. anyone know? thanks in advance for the help! ...