CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: NewsGroup Date Entered: 9/12/2006 4:19:36 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 122 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
lassor
Asp.Net User
Page.LoadControl bug9/12/2006 4:19:36 PM

0

Control a = Page.LoadControl("~/controls/MegaCtrl.ascx");

Control b = (MegaCtrl) a;

MegaCtrl.ascx has codebehind MegaCtrl.cs and MegaCtrl.designer.cs with class MegaCtrl.

fires exception who knows workaround for this?

Thank you

vcsjones
Asp.Net User
Re: Page.LoadControl bug9/12/2006 10:00:16 PM

0

You are causing a cast exception. it isn't a bug, but rather you just overlooked something. You are casting a to MegaCtrl but it is defined as Control, and there probably isn't an implicit cast. So your code should look like this: 
Control a = Page.LoadControl("~/controls/MegaCtrl.ascx");
MegaCtrl b = (MegaCtrl)a;
 Or you could simplify it to one line:  
MegaCtrl mc = (MegaCtrl)Page.LoadControl("~/controls/MegaCtrl.ascx");
 
Cheers,
       Kevin Jones


2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual Basic.NET unleashed Authors: Paul Kimmel, Pages: 757, Published: 2002
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1464, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005

Web:
Page.LoadControl bug - ASP.NET Forums Control a = Page.LoadControl("~/controls/MegaCtrl.ascx"); ... You are causing a cast exception. it isn't a bug, but rather you just ...
Possible UserControl OutputCache bug in Page.LoadControl? - ASP ... Possible UserControl OutputCache bug in Page.LoadControl? .... Control newControl = Page.LoadControl(modulesPath + controlNode.InnerText); ...
ComponentArt Forums - Show Post ID = "InnerSpan" ' need to give explicit ID to avoid minor bug in 2007.1 Dim uc1 As UserControl = Page.LoadControl("PageOptions.ascx") ...
possible bug in SPFolder? -getting InvalidOperationException when ... ID, SPContext.Current.Site.RootWeb). Dim tbToolbar As ToolBar = DirectCast(Page. LoadControl("~/_controltemplates/toolbar.ascx"), ToolBar) ...
CodeProject: Strongly typed LoadControl in ASP.net. Free source ... Aug 1, 2007 ... First you have to call LoadControl passing it the file path to the . .... of that code when he or she fixed a bug that had been found in one of them. ... Well, at least, it builds and the page is displayed correctly. ...

Page.LoadControl bug - ng.asp-net-forum ... Page.LoadControl bug, > ROOT > NEWSGROUP > Asp.Net Forum > visual_studio. vs_2005_web_application_projects, Date: 9/12/2006 4:19:36 PM, Replies: 1, ...
OutputCache does not work with ascx - ng.asp-net-forum ... Possible UserControl OutputCache bug in Page.LoadControl? - ASP ... <%@ OutputCache VaryByParam="none" Duration="43200" %> It still does not ...
Add usercontrol to webpart - ng.asp-net-forum ... Is it a bug, or I do something wrong? .... Use Page.LoadControl() to create an instance of a Control from an .ascx file. ...
Dotfuscator Newbie Quesiton, how to properly use the Dotfuscator ... page.loadcontrol bug · web site administration tool · export gridview to excel · how do you change a profile? application variable ...
Custom Webpart does not show webbrowsable properties defined in ... Page.LoadControl(control, null);. if (m_UserControlInstance == null). throw new GadgetException(String. .... possible bug deleting module definitions? ...






how to make use of ticket.userdata?

strange authetication implementation

security questions

how to store userid of logged-in user to be used in all other pages?!

active directory membership - get all users list?

forms authentication problem - the worst of all

using profile groups

web.config non-ascii character passwords.

createuserwizard.help me...

clientcertificate works using vs built-in server, not iis

formsauthentication.redirectfromloginpage not working

could not work out asp.net website admin tool

runtime error when accessing sql server from asp.net apps

membership.getallusers() returns isapproved value of allusers true at all times for odac 11g

a user field auto collect information...

you are not authorized to view this page

one common login for more then one web applications

aspnet password reset help

redirecting a user once signed in....

retrieving user's display name form activedirectory not working in firfox and mac

restrict user to view a certain area of the page on the bases of his rights

need to create users remotely

help help help, the security of my site is in danger!!!!

running application in medium trust mode

redirectfromloginpage is not redirecting...

irregular behavior: access is denied to images and css files

retrieving the userid on a webform

authenticate users against a asp.net role-based model

what's wrong with this decrypt stream length?

authenticate user on domain without user supplying name and password

   
  Privacy | Contact Us
All Times Are GMT