473,473 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

read ascx file from desktop application

Hello

I am trying to write a #C windows desktop application that loadsan ascx file contents (user control) from file, initiates it andthen registers to database everything it finds. I tried thatway:

1 Page page=new Page();
2 Control control=page.LoadControl(virtualPath);
3 string debug = control.ID;

but I got NullReferenceException on the 2nd line.

From earlier posthttp://www.dotnet247.com/247reference/msgs/29/148858.aspx
I found out that to create a control dynamically, one first needsto include className into the ascx and to register the controlin page. My brand new dynamically created page object of courselacks that registration and I guess that's why the LoadControlmethod does not work.

Is anybody able to explain, how to properly look up the contentsof an ascx file?

I would appreciate if you sent all answers directly to***************@just.ee as well.

Thanks in advance,

Kristjan

--------------------------------
From: Kristjan Sander

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>xUkaIAn1MEaIrdi5SegYnA==</Id>
Jul 21 '05 #1
0 1211

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kristjan Sander | last post by:
Hello I am trying to write a #C windows desktop application that loads an ascx file contents (user control) from file, initiates it and then registers to database everything it finds. I tried that...
4
by: Rob Meade | last post by:
Hi all, I have just put together our organisations 'template' for our web applications and have created 7 .ascx files which when dropped into my template file work perfectly...however, I have a...
2
by: Holger (David) Wagner | last post by:
Hi all, I'd like to have several "skins" for an application that are "structurally different" (i.e. controls at different locations, some controls visible only in a particular "skin"). The...
1
by: Kristjan Sander | last post by:
Hello I am trying to write a #C windows desktop application that loads an ascx file contents (user control) from file, initiates it and then registers to database everything it finds. I tried that...
0
by: Kristjan Sander | last post by:
Hello I am trying to write a #C windows desktop application that loads an ascx file contents (user control) from file, initiates it and then registers to database everything it finds. I tried that...
0
by: mortb | last post by:
My problem is with a XML file that resides on my windows 2003 web server. I have this user control which I include on every page in my applicaiton. The control makes it possible for the users to...
6
by: tshad | last post by:
I have an ascx file I am using to include my logos and heading information for all my pages. It was working fine up until now. I decided to set up an admin folder inside of my main folder and...
0
by: Kristjan Sander via .NET 247 | last post by:
Hello I am trying to write a #C windows desktop application that loadsan ascx file contents (user control) from file, initiates it andthen registers to database everything it finds. I tried...
3
by: Steven Nagy | last post by:
Hi all, ASP.NET : Framework 2.0 - C# A recent addition to my code generater will create GridView's and ObjectDataSource's in a control (ASCX). So the code gen creates an ascx, ascx.cs,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.