Questions tagged [web-controls]

Web controls are classes that allow you to create Web server controls on a Web page

Web controls are classes that allow you to create Web server controls on a Web page. Web server controls run on the server and include form controls such as buttons and text boxes. They also include special-purpose controls such as a calendar. Because Web server controls run on the server, you can programmatically control these elements. Although Web server controls are rendered as HTML, their object model does not necessarily reflect HTML syntax.

586 questions
36
votes
8 answers

Multi-select dropdown list in ASP.NET

Do any good multi-select dropdownlist with checkboxes (webcontrol) exist for asp.net? Thanks a lot
Jan Remunda
  • 7,840
  • 8
  • 51
  • 60
30
votes
5 answers

ASP.NET CheckBoxList DataBinding Question

Is it possible to DataBind an ASP.NET CheckBoxList such that a string value in the data becomes the label of the check box and a bool value checks/unchecks the box? On my asp.net webform I have a CheckBoxList like this:
Matthew Sposato
  • 1,635
  • 1
  • 11
  • 13
20
votes
3 answers

Easy way to AJAX WebControls

I've got a web application that I'm trying to optimize. Some of the controls are hidden in dialog-style DIVs. So, I'd like to have them load in via AJAX only when the user wants to see them. This is fine for controls that are mostly literal-based…
tags2k
  • 82,117
  • 31
  • 79
  • 106
19
votes
4 answers

What's the difference between Render and RenderControl in WebControl creation?

I've recently learned to write my own WebControls, but I'm still hazy on the difference between Render and RenderControl. I started out using Render, but at some point I started using RenderControl, which I now use exclusively. If I'm forming a…
Michael Itzoe
  • 1,949
  • 4
  • 29
  • 49
17
votes
15 answers

How to remove span tag from WebControl when rendered

When using an ASP.NET CheckBox (and in out case, inherited from a CheckBox) it renders a span around the checkbox input control, this span control is affecting jQuery scripts. Is it possible to remove this span when rendering?
Mark Redman
  • 24,079
  • 20
  • 92
  • 147
15
votes
5 answers

Base class includes field but type not compatible with type of control

The base class includes the field 'lbl', but its type (web.App_Code.CustomLabelControl) is not compatible with the type of control (web.App_Code.CustomLabelControl). I had done many custom controls before the same way but today I ran into this…
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178
13
votes
1 answer

Adding styles and scripts to ASP.NET web controls (ascx) without repeating inclusion directives

Consider to develop a web control (ASP.NET). What you would really like to do is styling and developing this control in a very good way, here's a very good way to do this (this is how I would like to do, further in this question I will explain why I…
Andry
  • 16,172
  • 27
  • 138
  • 246
13
votes
7 answers

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

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…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
11
votes
1 answer

Why don't all System.Web.UI.WebControl classes with Text properties implement ITextControl?

I'm curious why only some System.Web.UI.WebControl controls implement certain interfaces when they have the same properties of an interface. For instance, there are plenty of controls that have a Text property but only the following implement…
jrummell
  • 42,637
  • 17
  • 112
  • 171
10
votes
4 answers

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…
Patrik Hägne
  • 16,751
  • 5
  • 52
  • 60
9
votes
6 answers

Is it possible to add a web user control to a class library?

I'm looking at building some web user controls with an eye toward re-use, but I can't seem to add a Web User Control in my class library in VS2008. Is there a way to work around this problem, or is there a better approach to creating reusable…
JoshRivers
  • 9,920
  • 8
  • 39
  • 39
9
votes
1 answer

App.config v.s. Web.config: which has priority?

Suppose a project has both App.config and Web.config files with some conflicting information. Are there any rules which of the files has higher priority? Or an application has to disregard both of them and throw an exception?
user2341923
  • 4,537
  • 6
  • 30
  • 44
9
votes
1 answer

Difference between a WebControl and a CompositeControl?

I have been looking around on the web and found some articles about the topic, but i still can't figure out the difference between them. I have the code show below, if i inherit from a CompositeControl it works perfectly but not if i inherit from a…
Patrick
  • 5,442
  • 9
  • 53
  • 104
9
votes
7 answers

When creating a web control should you override OnLoad or implement Page_Load

When you create a new web user control in visual studio it by default adds the Page_Load event. What is the advantage to using this rather than overriding the base OnLoad event on the control? Is it just that the Page_Load event fires before…
Glenn Slaven
  • 33,720
  • 26
  • 113
  • 165
8
votes
1 answer

define Custom Event for WebControl in asp.net

I need to define 3 events in a Custom Control as OnChange, OnSave, and OnDelete. I have a GridView and work with its rows. Can you help me and show me this code?
mpourbafrani
  • 109
  • 1
  • 2
  • 7
1
2 3
39 40