Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:695672
More Search Options
RSS Available
Matching Posts
Re: User Control Null reference Error after Migration to 2.0
I managed to get it working the way I want with this in the PageLoad handler: If ( Me .ucMyControl Is Nothing ) Then Me .ucMyControl = New ASP.usercontrols_mycontrol_ascx() End If Let me say it SUCKS BIGTIME because: 1) I shouldn't by any mean declare the control dynamically every time I load the page (as I am statically placing it on the markup) 2) My class is called MyControl but the ucMyControl member (which declaration disappeared after the conversion together with all the server controls
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/21/2008
Filed under: user control, migration
Re: User Control Null reference Error after Migration to 2.0
I tried to put something like the pageload handler: If ( Not Me .IsPostBack) Then ucMyControl = New MyControl() End If But I am getting this error: Unable to cast object of type 'MyControl' to type 'ASP.usercontrols_mycontrol_ascx' . This must be a clue for someone who knows how to read it!
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/21/2008
Filed under: user control, migration
Re: User Control Null reference Error after Migration to 2.0
Hi All, I repeated the migration process N times and I am getting consistent results: everything seems to be working fine except the user control in object. I found out something very strange: First time the page is laoded I can programmatically access the user control but If I post it back it crashes, as I told above, BUT if I browse somewhere else in the application then I go back to that page (so I am not doing a post back, but loading the page again from scratch) IT CRASHES . It doesn't make
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/21/2008
Filed under: user control, migration
Re: User Control Null reference Error after Migration to 2.0
Another thing I am noticing: If I hit F12 (go to definition) for the user control in my code behind it jumps always to the same point of the script section in the aspx. I don't know if just the navigation is broken or there's something more to it related to my issue with the user control. At this point I would treasure any suggestion!
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/19/2008
Filed under: user control, migration
Re: User Control Null reference Error after Migration to 2.0
I noticed that in VS2005 if you create a user control you Get "UserControls_" appended to the name you choose. So maybe there's something going on about names: the declaration of the user control as a member of my webform disappeared from my vb file, and it's somewhere hiddend in those asp.usercontrols_MyControlxyd345.vb files, and when I hover of my instance member it tells me is declared as ASP.usercontrols_myControl_ascx. My next shot will be refactor the MyControl class to UserControls_MyControl
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/19/2008
Filed under: user control, migration
Re: User Control Null reference Error after Migration to 2.0
Thanks for answering, Yep that's a typo, but just here when I deleted the control name. I am using the old one (as I pasted above), as far as I know Reference is used to dinamically load the control, but I am statically placing it in the aspx file.
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/18/2008
Filed under: user control, migration
Re: User Control Null reference Error after Migration to 2.0
What d'you mean? I am using: < WAS : NAMEOFCOTNROL id ="controlID" runat ="server" EnableViewState ="True"></ WAS : NAMEOFCOTNROL >
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/18/2008
Filed under: user control
Re: User Control Null reference Error after Migration to 2.0
I put some breakpoints in there and I noticed it works alright the first time the page loads. On the first Post back it throws the error. ViewState of the control is set to ture, but anyway it shouldn't throw Object reference not set to an instance of an object Ring any bells?
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/18/2008
Filed under: user control, migration
User Control Null reference Error after Migration to 2.0
Hi All, I just migrated a project from 1.1 to 2.0 (VS2005 Professional Edition - SP1). Migration went fine, without any errors, just some warnings about resources moved to the proper asp.net folder. The project (now a web site project) compiles, builds and runs but I got some problems with user controls. I had in there a lot of User Controls as ascx files, and now I am suddenly getting Null reference errors for them when I try to access their members/methods from code. I noticed they disappeared
Posted to
Migrating from Visual Studio .NET 2003 to Visual Studio 2005
(Forum)
by
John_Idol
on 4/18/2008
Filed under: user control, migration
Re: Membership Odissey - VS2008 - SQL2005/SQLExpress
OK, I got it working: As the aspnet_regsql created the aspnetdb database on my i mapped the new aspnetdb from Server Explorer and it stopped crashing (probably it was looking for SQlExpress which I have no more). Then I copied the connectionstring from the aspnetdb properties and used it to override for my app the LocalSqlServer connection string: < connectionStrings > < remove name= "LocalSqlServer" /> < add name= "LocalSqlServer" connectionString= "Data Source
Posted to
Visual Studio 2008
(Forum)
by
John_Idol
on 2/23/2008
Page 1 of 5 (50 items) 1
2
3
4
5
Next >
TechNet Edge:
AlignIT IT Manager Podcast #32: Agile Application Lifecycle Management
Channel 9:
Bharat Shah: Microsoft Online Services Overview
ASP.NET:
RIA Services Link Listing #1
Channel 9:
Reactive Extensions API in depth: Merge
TechNet Edge:
Forefront Protection for Exchange customer story
WindowsClient:
Windows Client Developer Roundup for 12/7/2009
WindowsClient:
Introducing the new Bing Maps beta
ASP.NET:
My Presentations in Europe (December 2009)
Channel 9:
Channel 9 Live at PDC09: Dr Jeff Norris, NASA
Channel 10:
Flickr Drive Integrates Flickr into Windows Explorer
Channel 10:
Playfire: A Growing Network for Gamers
Channel 10:
Find the Top iPhone Apps with Bing (Yes, Really!)
Channel 10:
Xbox to Become Emergency Alert System
Channel 10:
Progression of the Iconic Background
WindowsClient:
ASP.NET AJAX 4.0 Data Binding on MSDN Magazine
WindowsClient:
Don’t miss out..
TechNet Edge:
Improving Collaboration with SharePoint - Tech Focus December 2009 Part 1
Channel 9:
Channel 9 Live at PDC09: Scott Guthrie
Channel 10:
Get Discounted Concert Tickets at the New Windows Section 7
Channel 10:
Get Bing Wallpapers on the iPhone
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online