webcontrols

Developing and using a custom ASP.NET web control in a single solution

Hello everyone, I have a solution with a web site and also a class library with a control which inherits from the WebControl class. When I place the control in the toolbox and use it in the web site, I can no longer build the solution - Visual Studio (the compiler) complains about the class library DLL being used by another process (whi...

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 bad habit I'd like to nip it in the bud now before I get set in my ways. ...

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 web control is designed to encapsulate a child custom web control together with OK and Canc...

Disable viewstate loading for child controls

I have a lot of web controls created dynamically in an ASP.NET page. In certain postback scenarios (when I click a LinkButton), I want to skip the loading of the old tree of web controls and immediately generate the new tree. Unfortunately, when I generate the new tree, the viewstate of the old tree is loaded into it. I want to be able ...

ASP.NET WebControl and rendering contained children

Hey all. I'm looking to create a WebControl that can house markup inside it, and do its own dynamic creation of child controls. The issue I'm having is that I can't (yet) render the controls housed in the markup (see example below) separate from the child controls I create. I'm aware I need to set up the class with these 2 flags: [Par...

ASP.NET - Dynamically added button contains extra value property

So, I'm trying to dynamically add a button to a site to give the user of an idea of what they are adding to a form. However, when it renders a new button, it keeps providing the value property as "" and ignoring the attribute that I add. I've attempted to fix this to no avail, including removing the value attribute before adding in my ve...

Set <asp:content> content in C#

Hi there! I'm currently learning to use MasterPages and ContentPlaceHolders in ASP.NET 3.5 and C# - and right now, I'm desperately trying to edit the contents of an asp:Content-Control through my programming code. Background is this; As soon as a Button is pressed, I want the asp:Content to be cleared and filled with dynamic generated ...

Creating a collapsable area in ASP.NET

hi there! currently i've built a collapseControl which behaves similar to a label (associatedControlID) to control the collapse-state of a control. following control i'd like to build: i thought of something like: put my already build collapsableControl and some other control (eg. panel) together to get a collapsableArea. first t...

using web control

Hi, I have a basic question. I have created a MVC project. I made a change to the LogOn.aspx. Instead of HTML textbox control, I used an asp's text box control for the UserName text box. I tried to debug this, and i foung that the UserName parameter is being received as null in LogOn (POST)action. Can anyone please explain what's the rea...

asp:button Created Programmatically: EventHandler does not fire

I am writing a SharePoint web part which will have a simple ASP.NET form. I am using HtmlTextWriter to render the controls. The problem I have is that my button does not seem to be triggering the EventHandler I have assigned it. I initially declared the button in the CreateChildControls method, and wired the event handler: { ...

Custom formatting of validation errors & control tree issues - ASP.NET

Hi, I have a WebControl library I'm using to render out our stylized form elements. The library also contains some overriden validators, so that when used together, I can render out some nicer validation HTML/CSS than the default validator's red-star-next-to-a-field. Namely, I'd like to highlight the entire line. At its most basic leve...

Custom property for asp.net webcontrol

I have a navigation (menu) control I am working on using a siteMapProvider. I want the developer using the control to be able to exclude nodes from the siteMapProvider at run-time. Here is the markup that I want them to use <mymenu:navigation runat="server" id="nav1"> <excludeNodes> <node>/site1</node> <node>/site2</node>...

Client populating server collections at runtime

I am adding to a List of DateTime objects on the server every time a date is selected on a Calender control by the client, and in turn highlighting all the selected dates on the control. I'm able to highlight (change back-color) of dates instantiated in the List on page load, and the first selected date by the client. However further d...

prevent hyperlink control from reordering navigateurl attribute

I created a hyperlink control extended from HyperLink, but I do not know how to override the navigateurl property, the problem is: im using a jquery library that depends on the url to look like this #TB_inline?height=285&amp;width=510&amp;inlineId=contactUsContent problem with .net is that it reorders this into: ../controls/?height=2...

asp.net xml editor control

All, I am looking for an asp.net xml editor control. Not a WYSIWYG editor like freetextbox or a javascript syntax highlighter but something that would make editing xml in the browser a bit easier than just as text in a textarea. maybe some non-editable areas, collapsable nodes, xsd validation etc. any ideas? ...

Page.FindControl from WebServerControl

Hi All, I use a WebServerControl "CheckBoxCounter", which has the following method. But the method is unable to find the CheckBoxList on the page. I'm searching for an answer for nearly a day now... can you help me... The WebServerControl is in a namespace "AWT.AID.Services", but there is no namespace for the ASPX page / code Behind,...

VS2008 navigation bar not showing page controls

In my old job I used to use the navigation bar in visual studio 2008 to select a control and then the event from the members drop-down to automatically create the event in the code for me to implement. Now at my new job, in my visual studio 2008 I no longer see page controls in the navigation bar. I only see the page class and associat...

How to get the set/real value of the Visible property in Asp.Net.

The Get of the Visible property of a control recursively looks up the tree to indicate if the control will be rendered or not. I need a way to see what the "local" visible value of a control is regardless of what its parent controls are set to. i.e. Whether it itself was set to true or false. I have seen this question, How to get the “...

Graphics in ASP.Net (c#)

I need help with my latest asp.net project. It involves graphics. I need to draw a circle and have several lines going from the middle to the edge (radius). This is the part I know how to do. The next part is the part I don’t know how to do and would appreciate some advice. The users need the ability to grab the lines with their mouse an...

The name 'GridView1' does not exist in the current context

hi all, I have two files named as TimeSheet.aspx.cs and TimSheet.aspx ,code of the file are given below for your reference. when i build the application im getting error "The name 'GridView1' does not exist in the current context" even thought i have a control with the id GridView1 and i have added the runat="server" as well. Im not a...