Questions tagged [webusercontrol]
255 questions
92
votes
10 answers
How to redirect to home page in JavaScript?
How can I redirect a user to home page?
Example: mywebsite.example/ddfdf/fdfdsf and I want to redirect to mywebsite.example
However I want to do it without typing the static name. How can I do this?
Steven Spielberg
43
votes
10 answers
Calling a method in parent page from user control
I've a user control registered in an aspx page
On click event of a button in the user control, how do i call a method which is there in the parent page's codebehind?
Thanks.

Jeremy Thomson
- 999
- 3
- 16
- 17
23
votes
1 answer
How to add a Templating to a UserControl?
This question has been asked before
Web Forms :: Design Time Support For Custom Templated User Control In VS 2008
VS 2008 Using the ITemplate in a UserControl and getting a design time rendoring error
how to show the controls for web user control…

Ian Boyd
- 246,734
- 253
- 869
- 1,219
17
votes
2 answers
ASP.NET error: The page Y.ascx cannot use the user control X.ascx
I am getting the error below when trying to build the web site project in Visual Studio 2010:
The page '/WebSite/controls/C2.ascx' cannot use the user control '/WebSite/controls/C1.ascx', because it is registered in web.config and lives in the same…

michalstanko
- 579
- 5
- 19
11
votes
5 answers
unable to run oowriter as web user
I have a web server set up on my laptop. I am building a web application which I am accessing through the local network.
I have a php file which contains the following lines:
$command = "/usr/bin/oowriter --invisible --convert-to pdf…

Gaurav Singh
- 287
- 6
- 19
8
votes
3 answers
Load user control programmatically using LoadControl(Type, Object())
I’m adding web user controls to a page dynamically. Using the LoadControl method that only takes a virtual path pointing to the .ascx works pretty nicely. However, the overload of LoadControl that takes a type and an array of parameters is causing…

Jakob Gade
- 12,319
- 15
- 70
- 118
7
votes
4 answers
Get variable value from code behind and use in aspx page control
I got a web user control where I have controls that needs to be fed with some data from variables or properties from the underlying page.
<%@ Control Language="C#" AutoEventWireup="False" CodeFile="Header.ascx.cs"…

Eric Herlitz
- 25,354
- 27
- 113
- 157
7
votes
2 answers
How to hide property of ASP.NET custom control in aspx page?
I'm writing ASP.NET custom control, and I want it to have a few properties which should be visible only from code behind during run-time - I mean, these properties should not be visible both in a designer and in a aspx code of page containing this…

user268580
- 71
- 1
- 2
7
votes
1 answer
C# Webforms User controls in VB.NET
I have an existing VB.NET web project that requires some new screens (webforms). Due to a number of reasons these new screens are to be developed in C#. Having had a read around it appears that this is indeed possible: Adding C# Web Form to VB Web…

TheEdge
- 9,291
- 15
- 67
- 135
6
votes
2 answers
Can i use Asp.Net WebForm User Controls in MVC Site?
I have a website in asp.net 4.0 with 10 pages and 12 user controls.
Now i want to migrate this site in asp.net MVC 4.0; So can I re-use those user controls (that are there in traditional asp.net) and render them using <%= Html.RenderUserControl()…

Jigar Pandya
- 6,004
- 2
- 27
- 45
5
votes
2 answers
Can a ContentPlaceHolder be placed in a Web User Control?
I want to do something like this:
I got this User Control called Base:
some content...
Then i inherit the Base in another User Control and…
The Demz
- 7,066
- 5
- 39
- 43
5
votes
2 answers
Loading ASCX control created dynamically (via code)
I am creating Web User Controls via code (my C# code write-out markup, code-behind and designer files to disk on a callback). The controls are created all fine. I can add them to my web-project and put them on a page.
When I try to load the control…

TheVillageIdiot
- 40,053
- 20
- 133
- 188
4
votes
1 answer
Load New UserControls Dynamically in Parent Page Update Panel Place Holder
Thank you in advance for assistance. It has been too long since I've worked in this, my memory isn't the greatest but I know it can be done.
I have a page, the ask is to never leave the page (no postback) which is why I'm using AJAX and an update…

Autonomic
- 150
- 4
- 15
4
votes
3 answers
Get output cache to work in ASP.net with webusercontrol
I have a webusercontrol with a public int property SelectedCatID. I use this control on other pages and in other controls as follows:
How do I output cache this control…

Tom Gullen
- 61,249
- 84
- 283
- 456
4
votes
2 answers
Using multiple instances of an aspx user control in a aspx page
I am facing a problem in using more than one instance of an aspx user control in a aspx page. This happens when I tried to fetch User control element value through Java script.
User Control Code: