webcontrols

ASP.NET GridView postback not setting posted controls' values

When adding an EditItemTemplate of some complexity (mulitple fields in one template), and then parsing the controls from the RowUpdating event, the controls that were manually entered by the user have no values. My guess is there is something going on with when the data is bound, but I've had instances where simply adding and attribute t...

WebControl in website project

I have created a website project in VS2008 and in the appcode folder I have created a class deriving from System.Web.UI.WebControls.WebControl. I need to use this control in one of my webforms. I can't figure out how to. ...

Webforms and jQuery, how to match the ID's?

Hi, I want to use jQuery with asp.net webfoms. Do I need to get a special toolkit so the .net controls spit out friendly Control ID's? Reason being, I don't want to write javascript referencing my html ID's like control_123_asdfcontrol_234. Has this been addressed in version 3.5? (I remember reading you have to get some special dll ...

asp.net wiki user control

I'm writing a asp.net web application in which I want the users to be able to apply simple formatting to the text they enter in text areas. One of the possibilities is to use a javascript wisywig editor (like tinymce). However, to keep the text html-clean and readible, I'd prefer that the users have to do the formatting themselves in ex...

ASP.NET WebControl for displaying revisions or differences of content

I would like to display the differences between versions of the same content. Initially I rolled out my own WebControl, however the differencing algorithm I came up with was slightly naive. Does anyone know of any .Net code or a WebControl out there on the Internets that might be of use? The implementation that stackoverflow uses, is ju...

How do I make my ASP.NET server control take an embedded code block as a property value?

I have a custom server control with a property of Title. When using the control, I'd like to set the value of the title in the aspx page like so: <cc1:customControl runat="server" Title='<%= PagePropertyValue%>' > more content </cc1:customControl> When I do this, however, I am getting the exact String <%= PagePropertyValue%> being di...

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...

Fluent interface for rendering HTML

Rendering HTML with the HtmlTextWriter isn't incredibly intuitive in my opinion, but if you're implementing web controls in web forms it's what you have to work with. I thought that it might be possible to create a fluent interface for this that reads a bit more like the HTML it outputs. I would like to know what people think of the synt...

Can you use an ASP.NET web control (ASCX) to render XML?

Off the top of my head, I don't see any reason why you couldn't structure an ASP.NET custom web control (ASCX file) to output only XML. If you avoid using controls in the System.Web.UI namespace, and just use XML tags and sub-controls, which also render only XML, you should end up with a perfectly valid XML document being rendered. Am ...

ASP.NET: Can GridView be used to create a hierarchy?

Hi, We are using the GridView controls in some pages of our project which we dont want to change drastically, would it be possible to create a hierarchy in a gridview? Can this be achieved by using a GridView inside a Gridview to get the parent - child relation? ...

How do I make a property of custom control to be a generic type ?

I have created a custom ASP.NET control ( derived from WebControls.TextBox). I want to add a property to that control which will be of a type. This property will actually always be some type of enum . So when in the designer I look at the properties window of that control - I want to be able to assign value to that property by a selec...

ASP.NET TextBox Control - Get the default text value in code behind?

Hi all! I have been spying the MSDN and can't see a property/method for TextBox that allows you to get the default text value that was set on a field; I want to be able to compare the current txtMyTextBox.Text to the default value (like this psuedo code shows): var myValue = (String.Compare(txtMyTextBox.Text, txtMyTextBox.DefaultText) ...

Can anybody recommend a Bar Code web server control?

Can anybody recommend a Bar Code web server control for formats 39 and 128 formats? UPDATE: I posted this after being given a choice of 3 controls we'd never heard of. I was hoping to get a recommendation from somebody who is using something that is popular, stable and a commercial product. It looks like we will just go with one of th...

IHierarchicalDataSource, Hierarchy structure, ASP.NET

I am building a hierarchy structure from scratch and I am trying to determine the best route to take. I found the following link below from another StackOverflow question: Nested Set Model I like the idea of nested sets and have begun to build my database, based on this pattern. I am now unsure how to query the data out in such a w...

ASP.NET SiteMap control invalid XHTML -title contains &

Hi all, I'm using the .SiteMap file and Sitemap control to create a sitemap on a page. The title of the page in the Web.sitemap is: "Out & About". When the page renders, the ampersand is shown as an & (Out & About) in the source, this obviously then causes validation errors. Any ideas how I can force good ol' .net sitemap to encode t...

When does a control in a programmatically added TemplateField have its' ID property set?

I have a TemplateField that is dynamically added to a custom GridView. void ITemplate.InstantiateIn(System.Web.UI.Control container) { switch (_templateType) { case ListItemType.Header: if (this.ParentGridView.ShowDeleteHeaderImage) { Image hImg = new I...

How to easily use complex HTML "templates" from designer in a library user control in ASP.NET (VB.NET)

I have some HTML that I got from a designer, from witch I made a "template" in an .ascx Web User Control about like below. Now I would like to put it into a library. How can I do this in a nice way (Without concatenating strings etc.) (There should be more parameters) <div style="clear:both;margin-top:50px;"></div> <div> <div cla...

Photo Gallery Service for Asp.NET

Hi I need to add photo support for my Application. Searching the site I found reference to nGallery. Any other. I use ASP.NET MVC. Thanks ...

ASP Hyperlink control text wrapping

I'm trying to get the text within the ASP Hyperlink control to NOT wrap when it is placed within a html table as below: <table style="width: 320px" class="noLines"> <tr><td style="width: 300px"> <asp:HyperLink Target="_self" ID="frmSuggest" Text ="Click Click Click Click Click" Visible="false" runat="server"></asp:HyperLink> </td></tr...

.net dropdownlist align text

I am trying to align the text in my .net dropdownlist to the right. Using CssClass I am able to align text to the right in Firefox. IE doesn't not align text to the right it aligns to the left. I have read that IE 6 doesn't support this. Is this true? I am using IE7 but most of my users will be in IE 6 so, both need to work. <asp...