A server control in classic ASP.NET is a component that dynamically renders a segment of markup to the client. Controls can be written in markup or coded, and can be bound to data and participate in different phases of the ASP.NET request-handling lifecycle. Out-of-box examples range from the simple (CheckBox which wraps the HTML input checkbox) and more complex (GridView which can be bound to various data sources and has built-in paging and sorting).
Questions tagged [servercontrols]
213 questions
4
votes
3 answers
Test output from HtmlTextWriter
Quite simply I want to be able to test that a Asp.Net web forms server control is outputting the correct Html as it will be building dynamic content. I'm just starting to create the control and wanted to do it in a TDD style building up the Html…
![](../../users/profiles/53962.webp)
Nathan
- 871
- 1
- 11
- 26
4
votes
3 answers
Content within a user control
I am almost too embarrassed to ask this question, but here we go...
I am not an expert with user controls, and need some design advise regarding trying to achieve a specific desired functionality.
The goal is to have a usercontrol that would…
![](../../users/profiles/245878.webp)
nokturnal
- 2,709
- 3
- 26
- 38
4
votes
1 answer
Creating a simple templated control. Having issues
I'm trying to create a really simple templated control. I've never done it before, but I know a lot of my controls I have created in the past would have greatly benefited if I included templating ability - so I'm learning now.
The problem I have is…
![](../../users/profiles/156490.webp)
James
- 449
- 3
- 7
4
votes
1 answer
ScriptControlDescriptor.AddProperty & Read-Only Properties
I'm creating an ASP.NET Server Control with an associated client-side API.
In my GetScriptDescriptors() method I'm associating a property called "rows"...
descriptor.AddProperty("rows", this.IntRows);
In my client-side API I want my "rows" property…
![](../../users/profiles/295813.webp)
Brett Postin
- 10,721
- 9
- 58
- 93
4
votes
1 answer
ASP.NET Server Controls and <%$ %> params like ConnectionStrings
Is there a complete list of the objects you can tap into with <%$ %> tags in ASP.NET
I know you can do things like <%$ ConnectionStrings:northwind %> in the ConnectionString attribute of the tag.
Can you also do this with Cookies…
![](../../users/profiles/36590.webp)
BuddyJoe
- 64,613
- 107
- 281
- 451
4
votes
1 answer
Is there a performance difference between custom server controls and user controls?
Consider two controls that do basically the same things. For instance, a gridview-like-widget with paging, sorting, and data caching. Both bound with the same 10,000 row data source. One is a custom server control and one is a user control. Is there…
![](../../users/profiles/205753.webp)
Byron Sommardahl
- 12,103
- 14
- 68
- 126
4
votes
4 answers
Always use SUBCLASSES of ASP.NET server controls? If not, why not?
In my pre-ASP.NET development environment, there was a near-universal best practice:
* NEVER use the native controls!
* Instead, subclass ALL the controls, and ALWAYS use the subclassed version.
Why? Because that gave you a hook... one place to…
![](../../users/profiles/224170.webp)
hoytster
- 247
- 4
- 15
4
votes
2 answers
Why do my dynamically added controls loose their values after Postback?
To ask my question I have created an aspx file containing a Button and a DataList with an SqlDataSource:
![](../../users/profiles/1820196.webp)
jannagy02
- 2,213
- 1
- 22
- 42
3
votes
1 answer
How to test asp.net server controls
We have developed a number of ASP.Net server controls and we need to test them. I want to instantiate a control, set some properties, call CreateChildControls and test the control-hierarchy.
I run into a number of problems:
The controls rely on…
![](../../users/profiles/58864.webp)
RandomProgrammer
- 1,500
- 1
- 14
- 23
3
votes
1 answer
ASP.net weekly schedule control
Can anyone recommend a free asp.net control that I can use for the following:
Weekdays Monday-Saturday along the top row
Time of day along left hand side
Template fields for the actual data
Databindable
Cells span the rows based on the start time…
![](../../users/profiles/64334.webp)
Ronnie Overby
- 41,852
- 68
- 257
- 338
3
votes
3 answers
Excel like server side control for ASP.NET
We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist…
![](../../users/profiles/5302.webp)
johnc
- 36,657
- 37
- 96
- 137
3
votes
3 answers
Can I automatically attach to the lifecycle of ANY server-enabled HTML tag?
If a "server-enabled" HTML tag is in a Web form, like this --
-- is there any way for me to attach to its rendering? I assume once they have runat="server", they must have a lifecycle of some kind.
I'd like to attach some code…
![](../../users/profiles/60733.webp)
Deane
- 7,649
- 9
- 51
- 102
3
votes
1 answer
How do you insert a newline character within the RegularExpressionValidator ErrorMessage Field?
Consider this code below:
![](../../users/profiles/6217487.webp)
pointedPenguin
- 65
- 7
3
votes
3 answers
ASP.Net LinkButton CommandArgument property ignores <%= .. %>
I'm trying to do what I thought was a very simple operation to set a property on an ASP.Net LinkButton control but for some reason ASP.Net is ignoring the tags and just passing through the value as a string.
![](../../users/profiles/75658.webp)
sipsorcery
- 28,885
- 23
- 95
- 145
3
votes
3 answers
Are the Internet Explorer Web Controls IE only?
Recently, I came across a set of Internet Explorer Web Controls from Microsoft. These look to me to be older controls from the pre-standards era of Microsoft's asp.net development. I'm curious as to whether or not these controls work well with…
![](../../users/profiles/61164.webp)
Erik Funkenbusch
- 90,480
- 27
- 178
- 274