ascx

Customization of ASCX user controls

We have a little situation thats kinda got out of hand latly. Our web application is built upon several ASCX user controls. All of them is available to customize (pointing to another ASCX-path). What we do when we customize is to make a copy of the source ASCX and make some changes. Now the problem, when there have been much commits to ...

Usercontrol losing Viewstate across Postback

I have a user control which uses objects as inner properties (some code is below). I am having trouble with setting the attribute of the Step class programmatically, when set programmatically it is being lost across postback which would indicate something to do with Viewstate (?). When setting the property of the Step class declarati...

List of Objects to be used on ascx view with Inherits data already loaded MVC...

I have an object list being loded from a database to a drop down list. The Model loads the data to the Controller. The aspx view includes an ascx view. The ascx view already inherits data from another Project. I cannot set my List object in the ascx page. Can this be done? Model ... string List = dr["example"].ToSt...

problems with user control page

I am starting to give up troubleshooting this issue I had... I had an .ascx page and had the following user control in it: <td> <Club:DatePicker ID="dp1" runat="server" /> </td> however in my code behind when I tried to write methods: public System.DateTime startDateTime { get { ...

Control within ascx is null when ascx is added from codebehind

I am having difficulties how to construct my question, but if I have to put it simply the situation is that I have categories of products. I have an aspx with a repeater on the left that lists the categories. And I want the products to be listed on the right. Category number is variable so I made an ascx with a DataList in it. When I try...

Configure OutputCache for ASCX from web.config's cache profiles

Hello, To configure aspx pages' OutputCache from one place, there is a great tool which is the CacheProfile attribute in <%@ OutputCache %> associated with a custom cache profile defined in the web.config : <caching> <outputCacheSettings> <outputCacheProfiles> <add name="myProfile" duration="300" /> </ou...

Graphical designer for asp.net controls.

Hi, I'm searching a graphical designer, better than visual studio designer for asp.net typical and ajax controls. Visual studio designer (VS 2010 B2) very often don't handle with html code and shows nothing. Is there any better tool for writing code behind and design graphically controls for asp.net web sites? ...

Website written in C# and ASP.NET MVC is compiling ASCX pages with Visual Basic

I am developing a website in ASP.NET MVC using C#. It works fine on my machine, however when I load it to the production server it generates an error trying to present the home page. The error is caused by the fact that the ASP system is compiling the .ascx pages using Visual Basic, which, of course, does not work since all of the code...

sharing web user controls across projects.

I've done this using a regular .cs file that just extends System.Web.UI.UserControl and then included the assembly of the project that contains the control into other projects. I've also created .ascx files in one project then copied all ascx files from a specified folder in the properties->Build Events->Pre-build event. Now what I wan...

Adding Event Handler to DropDownList inside GridView - how to?

Hi, I have DropDownList inside GridView. Now I would like to add event handler for dropdownlist which would react on SelectedIndexChanged. I'm nesting DropDownList inside GridView by using RowDataBound event for GridView. (http://www.highoncoding.com/Articles/169_DropDownList_Inside_GridView__Method_1_.aspx) Can anybody help me, and tel...

Is it possible to modify ASP.NET to no longer require runat="server"?

I know why runat="server" is currently required (ASP.NET why runat="server"), but the consensus is that it should not be required if you incorporate a simple default into the design (I agree of course). Would it be possible to modify, extend, decompile and recreate, intercept or otherwise change the behavior of how ASP.NET parses ASPX a...

aspx include vs ascx

I have many aspx page includes in my web form. I want to convert them to user controls. Just wanted to confirm whether there is any performance gain in doing so? I have 50 pages in which the aspx page is included. ...

How to provide translations for items in a ASP.Net custom web control (.ascx)?

How do I go about providing localised text for items in a custom web control? I had thought that I just need to add meta.resourcekey tags to the control items and then define and fill some resource files called mycontrol.ascx.[lang].resx but that doesn't seem to work. e.g. MyControl.ascx <asp:Label ID="Label1" meta:resourcekey="Label...

Javascript code in ASP.NET MVC Partial Views (ASCX) or not?

Is there a "best practice" for placing Javascript code when you have many partial views and JS code that's specific to them? I feel like I'm creating a maintenance nightmare by having many partial views and then a bunch of independent Javascript files for them which need to be synced up when there is a partial view change. It appears, f...

Stopping Intellisense from outputting Assembly directive by default

I'm using ASCX files quite extensively in my latest project and I've come across an annoyance - when I go to type: <%= Something %> Due to Intellisense I get the following when I type the equals sign: <%@ Assembly= %> This happens anywhere in the file, which is strange as the top of the file is the only place I would ever want such...

Calling jquery function from ascx not working

Hi Guys, I'm having a problem with the following situation. I have an ascx which contains a submit button for a search criteria and I am trying to call a validation function in a js file I've used throughout the site (this is the first time I'm using it in an ascx). Now I've just tried this: <script type="text/javascript" src="js/jqu...

How do I register my ascx control that I built in another assembly?

So I built an assembly Dash.dll that I referenced in Admin --- in Dash.dll I had an ascx file. I was hoping I could then register that ascx in my Admin project and just add it to my aspx page but I cannot figure how to do this in the <%@Register part... Help? Thanks T ...

.NET website: Get the output of .ascx from jQuery

In MVC .NET application we can easily use PartialView to print the output of an ASCX file. For example, I have Book.ascx file, I could have this in the controller public ActionResult Book(int id) { BookModel model = new BookModel() { bookId = id }; return PartialView("Book", model); } which returns the output of Book.ascx Is the...

Can a Web User Control (.ascx) use a CSS file for styling?

Here's the source of a blank .acsx file I created called LogOnBox. <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LogOnBox.ascx.cs" Inherits="ECommerce.Views.Shared.LogOnBox" %> I want to drag some labels, and textboxes etc and give them style using a CSS file. How can I associate a CSS to an acsx file? ...

accessing controls in an aspx page

Hello, We have some code which is designed to build up a key/value pair of controls on a ASP.NET webforms page and their values. We use the "Controls" collection and recursion to build up this key/value pair. The only issue is that ascx controls don't appear to come back in the "Controls" collection. Instead we get the controls on the ...