Questions tagged [servercontrols]

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

213 questions
1
vote
3 answers

How to assign Datatypes for the DropDownList bounded with List of Items

I have a DropDownList bounded with List of Items from the SqlDatasource. The List of Items in the DropDownList are bounded based on the following query SELECT COLUMN_NAMES FROM INFORMATION_SCHEMA.COLUMNS WHERE (TABLE_NAME = 'RESULT') My…
Shrivatsan
  • 105
  • 1
  • 18
1
vote
1 answer

CompositeDataBoundControl - databound values overwritten before event is fired due to DummyDataSource

I have a custom servercontrol that inherits from CompositeDataBoundControl. I have three templates: one header template, one footer template and one item template. The item template can contain a checkbox that I use to decide if I should delete the…
1
vote
3 answers

What is the proper way to maintain state in a custom server control?

This works, but is it the proper way to do it??? I have a custom server control that has an [input] box on it. I want it to kinda mimic the ASP.NET TextBox, but not completely. When the textbox is rendered i have a javascript that allows users to…
schmoopy
  • 6,419
  • 11
  • 54
  • 89
1
vote
0 answers

show/hide groups of controls based on role, ASP/jquery

I've seen folks with similar questions, and there's a very good answer that has to do with building a control adapter. But my situation is a little different: I have an ASP/VB.NET 2010 site with about 2 dozen pages. Those pages contain up to 40…
Brian Link
  • 105
  • 2
  • 9
1
vote
1 answer

Page.ClientScript.RegisterClientScriptBlock and nested server controls

I'm using Page.ClientScript.RegisterClientScriptBlock on PreRender in a nested Server Control environment. The script does not get written to the page, does anyone know why this happens? protected override void OnPreRender(EventArgs e) { …
BK.
  • 365
  • 4
  • 13
1
vote
1 answer

Web controls lifecycle problems: A page, a grid and a dialog (containing a dynamic control whose type depends on the selected row in the grid)

I have a web page with a GridView. The GridView contains a list of Question objects. Each Question has a QuestionType. When the user clicks on the Question control, an Ajax modal popup appears containing a Dialog custom web control. The Dialog…
J M
  • 1,877
  • 2
  • 20
  • 32
1
vote
4 answers

Server control event does not fire correctly

First of all, I found a few similar questions. One of them is here , which does not have correct answer. I'm writing custom server control, which has Text property and Click event. Everything woks fine (Click event is firing and sender object has…
Vano Maisuradze
  • 5,829
  • 6
  • 45
  • 73
1
vote
1 answer

Developing custom asp.net server control rendering scripting code

I have a server control as below: [DefaultProperty("ContentKey")] [ToolboxData("<{0}:ContentRating runat=server>")] public class ContentRating : WebControl { [Bindable(true)] …
xkcd
  • 2,538
  • 11
  • 59
  • 96
1
vote
3 answers

ASP.NET, Trigger codebehind eventhandler with anchor tag

Is it possible to call an eventhandler codebehind, using an anchor tag? I've tried different things, but it doesn't seem to work. I've tried writing my tag like this: with no…
Soeren
  • 1,023
  • 4
  • 22
  • 41
1
vote
1 answer

ScriptManager.RegisterExpandoAttribute isn't working for ajax

I'm creating a server control, which has a property that I am adding as an expando attribute. It works on the initial page load, but after a partial postback, it stops working. My expando attribute is gone. The class is a class derived from a…
Eric
  • 930
  • 1
  • 6
  • 14
1
vote
1 answer

Server control losing mousedown event handler on callback

I have a composite server control that contains a div to which I attach a right click event handler in the Render method (simplified for clarity): protected override void Render(HtmlTextWriter writer) { base.Render(writer); writer.write(@" …
1
vote
1 answer

ASPxClientListBox loses values and the first item can not be selected

On a server control I have a DevExpress ASPxClientListBox which is populated dynamically on the client. The server does not need to know anything about it but it is initialized on the server. Normally this server control does not have any…
Soenhay
  • 3,958
  • 5
  • 34
  • 60
1
vote
2 answers

getting value from custom control

I have written an ASP.NET server control. View state works perfectly, but when I'm trying to get a value of a control on my custom control with its public instant method, it brings me an exception that there are not control with that ID.
TIKSN
  • 615
  • 1
  • 6
  • 24
1
vote
1 answer

Using ServerController and Update Panel update not working

So, I have a repeater that displays a list of custom functions on a remote server. The repeater displays as follows. serverName serviceName serviceStatus Button1 Button2 ---------------------------------------------------------- Carolina …
user1250570
  • 55
  • 1
  • 6
1
vote
2 answers

asp.net custom server control - how to tell if postback ocurred because of this control

I have a custom asp.net server control (actually a specialized version of a checkbox). I want to do some processing on a postback but only if the postback was a result of this control being clicked (with autopostback being set to true). What is…
Paul Hyman
  • 81
  • 1
  • 7