usercontrols

ASP.NET GridView, enabling/disabling buttons after paging

I have successfully implemented my GridView now, but, as always, the whole ASP.NET life cycle thing is bothering me. I can't figure out why this doesn't work. I have bound the GridView's OnPageIndexChanged as such: protected void GridView_PageIndexChanged(object sender, EventArgs e) { // Enable/disable the previous/next buttons. ...

Prevent obsolete properties being added to the designer files

In one of the user controls in our project we have an obsolete property looking like : [Browsable ( false )] [Obsolete ( "Not currently supported on this control" )] public bool DeferPropertyValueUpdates Every time I edit a form that contains this control, Visual Studio will put this property into the .designer file. This then ca...

ASP.NET - Placement of @ Register directive

In the past I have always placed my <%@ Register ... %> directive(s) at the top of my .aspx pages just below the @ Page directive. I recently found out that I can place this register directive ANYWHERE in the .aspx page and still have it function correctly. We are wondering if there is any problem people can foresee with placing these ...

Adding a ServiceReference programmatically during async postback

Is it possible to add a new ServiceReference instance to the ScriptManager on the Page during an asynchronous postback so that subsequently I can use the referenced web service through client side script? I'm trying to do this inside a UserControl that sits inside a Repeater, that's why adding the ScriptReference programmatically during...

Is it possible to seperate data and presentation by using dedicated renderable UserControl?

Hello. For SharePoint, I want to have custom E-Mail body for workflow tasks. However i wan't to format email's using my custom ASCX user controls. (I can see them or modify using Visual Studio WYSIWYG). Ideally I could render that UserControl as string and it works. I`v found a solution, but it requires HttpContext.Current != null in o...

When Should You Extract a UserControl in WPF

Hi, At our work we have a controversy going on where some people want to create user controls that combine frequently used controls like a label and a text box, or a label and a image control. That is, something like this: <StackPanel Orientation="Horizontal"> <Image Source="/Someimage/Somewhere.gif"/> <Label>Some text, hyperli...

Reusable ASP.NET User Control Library : Virtual path provider or ascx/aspx copy ?

I have a ASP.Net web application that I want to use as a reusable user control library in other web applications. One solution for this problem is to use what Scott Guthrie has described here: http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx that is to copy ascx/aspx files (without their code-behind) in the web applicatio...

If I cannot use OnPreInit in Controls, how can I add my controls dynamically on the right time?

Hi, I want to have a user control which will add some checkboxes in a asp.NET panel dynamically. Simply I was believing I can do that easily in control's OnPreInit method. But the thing is I have learn that I cannot use and override OnPreInit method on Controls; it is only used for pages. I do not want to solve this from the page by c...

Separating UI from Data Access in ascx user control

What is the "best practice" for designing ascx user controls regarding separating the UI from the Data Access? Should my user control use 3 tier archetecture as in my projects or can I do the data acess from within the user control? ...

how to write a custom control in c# to work with any windows text processor application?

I am trying to write a custom control in c# using windows api which should interact with any windows text based application. for e.g. notepad I had looked at tinyspell and it works like anything. can any one suggest how to get started? also if u know how tinyspell would work, plz help me. u can find tinyspell here http://www.tinyspell...

WPF - automatically relocating children when parent resizes

I have a container whose size can change. I will by dynamically creating instances of a user control and adding them to that container. the size of the user control is fixed. what I want to do is, fit the most number of user controls in the container. I think a good approach is to add the children horizontally until there is no more sp...

How to make a GridView component with DateTimePicker using Asp.net?

Hi, I need to build a GridView component which contains a DateTime picker.How can i do this? ...

How to use a ControlDesigner to Allow docking to Left and Right Only

Is there a way to create a controldesigner to allow for docking to left and right sides only? Instead of top, bottom, fill, etc... Thanks. ...

Passing in content to ASP.NET user control

Hello, I have a UserControl named BreadCrumb. I would like to pass in information to this user control like so (Similar to DropDownList items): <uc:BreadCrumb runat="server" id="HeaderBreadCrumb"> <AddLevel Name="Home" Url="~/Default.aspx" /> <AddLevel Name="About Us" Url="~/AboutUs.aspx" /> </uc:BreadCrumb> Thanks to any hel...

VB.NET - WinForms - Prevent UserControl's resources being copied into the Form's local resource

I have a simple windows Forms application where in I have a usercontrol called "MyControl" derived from PictureBox. In this MyControl, I have the following code : Sub New() MyBase.New() Me.BackgroundImage = My.Resources.MyImage 'This is a project resource image End Sub Now when I drag and drop this MyControl into a form, I get ...

Asp.Net: Returning a DataSet from a Class

Hi all, I've decided to start another thread based on the responses I got in this thread: http://stackoverflow.com/questions/1980404/asp-net-returning-a-reader-from-a-class I was returning a reader, but members have suggested I'd be better off returning a Dataset instead and also try to seperate the data access tier from the presentati...

ASP.NET UserControl Help

i have a user control that i made, and i place two instances of that control on the same page... when i interact with the first control, it updates the elements (using ajax) of the first userControl, as it should. but when i do the same thing with the second userControl, it updates the elements on the first userControl as opposed to itse...

ASP.NET MVC - How to achieve reusable user controls and maintain DRY?

First post so please be gentle :) When creating user controls in ASP.NET MVC, what is the best way to structure the code so that the controllers that invoke views that use the user controls do not all have to know so much about the controls? I would like to know a good way to maintain DRY while using user controls in ASP.NET MVC. Pleas...

Why doesn't my jQuery UI datepicker work for postbacks when it works fine on initial page loads?

I've been trying to integrate the jQuery UI Datepicker into our ASP.NET WebForms application. The application uses master pages to provide a common look to all pages, and all of the content pages are built inside the ContentTemplate of an UpdatePanel. I've created a user control to wrap the datepicker's functionality and allow setting ...

User controls in PHP with parameters

i am new to .php. I would like to know what are all the ways we can create User Controls (How we do it in asp.net). This found with include in php, but i need to pass parameters to it and use those parameters in that php include file. ...