web-user-controls

Dynamically added controls in Asp.Net

I'm trying to wrap my head around asp.net. I have a background as a long time php developer, but I'm now facing the task of learning asp.net and I'm having some trouble with it. It might very well be because I'm trying to force the framework into something it is not intended for - so I'd like to learn how to do it "the right way". :-) M...

When to enable/disable Viewstate

I generaly disable viewstate for my ASP.net controls unless I explicitly know I am going to require view state for them. I have found that this can significantly reduce the page size of the HTML generated. Is this good practice? When should be enabled or disabled? ...

ASP.NET: How do I create radio buttons and databind them in a DetailsView?

I have a TemplateField in a DetailsView and its input should be one of a few choices in a lookup table. Currently it's a text field, but I want it to be a group of radio buttons, and it should work in both insert and edit mode (the correct current value should be selected in edit mode). How do I create mutually exclusive radio buttons a...

When would you use a Web User Control over a Web Custom Control?

Can someone explain when to use each of these? They almost seem interchangeable in many cases. The Custom Control gets added to the toolbar while the User Control (ascx) can not. The Custom Control does not get rendered in the Designer while the User Control does. Beyond that, how do you choose which is the right one to use? Als...

Passing int array as parameter in web user control

I have an int array as a property of a Web User Control. I'd like to set that property inline if possible using the following syntax: <uc1:mycontrol runat="server" myintarray="1,2,3" /> This will fail at runtime because it will be expecting an actual int array, but a string is being passed instead. I can make myintarray a string and p...

do i need to unregister events in asp.net

I have a web user control that contains several other (web user) controls and subscribes to events the children raise. I saw someone somewhere in a similar situation providing Dispose() on the containing control and unregistering the events it had subscribed to. Isn't it all going to be blown away when the request processing complete...

JQuery DatePicker bundled control can't be included in other controls

I've been tasked with implementing a Date/Time selector for several areas of our web project, and instructed to use a control that another developer created as part of it. The control I'm working on is supposed to allow the user to choose a date from a calendar, choose a format for the display of that date (from several pre-defined form...

Can you get SkinID Autocompletion in ASCX Controls

Working in VS 2008 When working on on ASPX file in Source mode, if i've specified a StyleSheetTheme in the page directive of the file, then Visual Studio will provide me with AutoCompletion lists of the possible skinID values for a control e.g. <asp:Button ID="myButton" runat="server" SkinID=" //Having typed this much, I'll get an in...

Can I nest Templates in a Web User Control?

I want to do something like this: <MyTemplate> <span><%# Container.Title %></span> <MySubTemplate> <span><%# Container.Username %></span> </MySubTemplate> </MyTemplate> Assuming I have a list of Titles that each have a list of Usernames.. If this is a correct approach how can I do this or what is a better way? ...

Difference between User Control and Custom Control?

What are the differences between User Control and Custom Control in ASP.NET ...

Why is an InsertParameter not getting its value, but only on the server?

I have a page which consists of a formview containing several Web User Controls (WUCs.) The WUCs get a value from the parent page using a public property, which is stuffed into a HiddenField. I just finished another WUC to manage yet another aspect of a company. It allows you to insert a new record (this is a different table) tied b...

How do I register event handlers for a web user control in my code behind?

I'm having a problem setting up an event on a form. Here's the setup: I was given a page with two controls, two different versions of a form for the end-user to fill out- standard and advanced. The two forms have different code and javascript, so the original dev put them in separate web user controls. Aside from the controls is a LinkB...

Can you update a web user control without updating the entire site?

I have a website which uses a web user control... well, basically all over the place. It's even included in other web user controls. So I thought I could just upload the new source and it would recompile on the fly and be fine, but instead every page or control that uses it complains about a type mismatch. Because it is used in so man...

How to create Java Custom Web Controls?

This question was originary in my head as "Can I use AWT controls in a Servlet?", which will show all my ignorance on the subject. I am new to JAVA technologies but after a bit of reading, I seem to understand AWT controls directly hook up the OS GUI elements so there is no way to use or extend JPanels, JButtons and so forth in a Servl...

javascript and asp.net web user controls

I have a web user control that generates the following html on the client. I want to reference a specific RadioButton control using JavaScript. I am not sure how to do this as the RadioButton ID is generated by asp.net. For example I give the RadioButton ID = 1_RadioButton asp.net generates an ID = ctl00_ContentPlaceHolder1_Mate...

How can I import a .ascx file into a .aspx page using tag registering?

Hi, I have this set up... <%@ Register TagPrefix="UserControl" TagName="UserLogin" Src="~/admin/Authentication/Login.ascx" %> <%@ Register TagPrefix="UserControl" TagName="UserRegister" Src="~/admin/Authentication/Register.ascx" %> Then later on in the same file I use the tags... ...

What is the best way to split up MVC controller functionality?

Hi, When making Controllers, what are the best ways to split it up? If I have an admin section that has a bunch of .ascx web user controls underneath it and a few .aspx pages. Should I have one AdminController? Or should I have a Controller for each individual admin pages/web user controls? It seems as though being responsible for a s...

ASP.NET User Controls - Problem adding multiple instances programmatically?

Hi, I have created a user control which basically consists of 3 text boxes. I want to allow the user to click a hyperlink which will add a new instance of the user control onto a PlaceHolder. This seems to be working as I populate one of the text box controls with a random number which changes whenever I click the hyperlink. However, it...

Web User Controls, Javascript and Script Managers

Is there a way to only add a script manager to your Web User Control if there is not one already on the page (on the main page or if you are using the Web User Control multiple times)? Same question about adding javascript files to the page, many times I have controls that add the javascript into the head of the page for the control. ...

How do I use the same Web User Control in two different DotNetNuke (DNN) modules?

I am developing a number of modules for a client that will share some user interface functionality using a common Web User Control to provide the UI. When I wrote the first module and added in the .ascx file, all was fine. When I add the same control to the second module, I get the following error: DotNetNuke.Services.Exceptions.Modu...