473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Loading UserControl From Web Component Library Posted

Hello,

i have developed a web componenet library project, which
access the usercontrol that resides in another web
application. In my component, I load the control like
this:

Dim uCtrl As New UserControl
uCtrl.LoadControl("/intranet/myfile.ascx")
uCtrl.ID = "NestedGrid"
uCtrl.Visible = False

Now, when I use the component in my webform and try to
cast the usercontrol to a class, then it returns me the
error:

Specified cast is not valid.

Here is how I cast the control from my ItemCommand:

Dim ctrl As UserControl = AADataGridStores.Items
(nOpenedItem).Cells(0).FindControl("NestedGrid")
'Dim ctrl As Object = AADataGridStores.Items
(nOpenedItem).Cells(0).FindControl("NestedGrid")
Dim obj As New myfileClass
obj = CType(ctrl, myfileClass)

I am 100% sure that this is the correct class, because I
added it. I dont understand why I getting the above error.
Can anybody help me out?

Thanks
Nov 19 '05 #1
0 794

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

Similar topics

0
by: Anonymous | last post by:
Hello, i have developed a web componenet library project, which access the usercontrol that resides in another web application. In my component, I load the control like this: Dim uCtrl As...
0
by: Anonymous | last post by:
Hello, i have developed a web componenet library project, which access the usercontrol that resides in another web application. In my component, I load the control like this: Dim uCtrl As...
4
by: Tim B | last post by:
Hi, Previously I was loading my .NET Usercontrol like this : <OBJECT id="Obj" classid="Viewer.dll#Viewer.Viewer" width=105 height=20 VIEWASTEXT><param name="DONOTHING" value="1"> </OBJECT> ...
4
by: Adam Biser | last post by:
My apologies if this has been discussed before, but using Google and also searching the newsgroup has not given me any insight to this problem. I'm experiencing some strange behavior when I copy...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.