473,769 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User control from Form to ASP.NET application

I have a user control written in C#. This user control uses some of my
mixed mode C++ libraries.

My user control is currently residing on a .NET Windows Form.
Everything works nicely. Now I am trying to use this control on a ASP
web page. I use the wizard (VS 2003) to create an ASP application and
drop my control onto the ASP page, I get :

"Operation cannot be completed"

I have checked and all of my C++ libraries are in the bin directory of
my ASP application. This shouldnt be a dependency issue. Anyone know
what is causing this? I have no idea even how to debug the situation.
The error is very vague.

Thanks...

Drew
Nov 18 '05 #1
5 1633
Hi Drew,
Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, I understand that you've made a custom control which
references some Mixed c++ dlls. The control can be used in Winform
correctly. Then, you'd like to use it in a ASP.NET web page. However, when
you try to add it onto a web page, you encountered the
"Operation cannot be complete" error.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

If my understanding is correct, I'd like to query some further info on this
issue:
1.The UserControl you created is a winform control derived from
System.Windows. Forms.Control , isn't it? If not, would you please describe
it more detailed?

2. If it's a winform control, do you mean to directly use a winform control
in webpage(in IE browser) or just want to add a Such custom control in a
web page?

In dotnet, there are two different kinds of controls:
1. the winform controls which are derived from the
System.Windows. Forms.Control
These controls are used in winform application.

2. the web controls which are derived from the System.Web.UI.C ontrol
These controls are used in ASP.NET web pages.
Also, you can create your own custom web controls which derived from the
System.Web.UI.C ontrol

However, since the two kinds of controls are quite diferent from each
other(in their internal implement mechanism). They are not able to used in
other's enviroment (such as using web control in winform or using winform
control in web page are not generally recommended).
If you want to create some custom controls which can be used in ASP.NET web
page. You can have a view on the following tech articles in MSDN:

#Developing ASP.NET Server Controls
http://msdn.microsoft.com/library/en...lopingwebforms
controls.asp?fr ame=true

Please check out the preceding suggestions to see whether they are helpful.
If you have any quesitons or if you feel my suggestion not quite
appropriate for your situation, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2
Hi Drew,
Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, I understand that you've made a custom control which
references some Mixed c++ dlls. The control can be used in Winform
correctly. Then, you'd like to use it in a ASP.NET web page. However, when
you try to add it onto a web page, you encountered the
"Operation cannot be complete" error.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

If my understanding is correct, I'd like to query some further info on this
issue:
1.The UserControl you created is a winform control derived from
System.Windows. Forms.Control , isn't it? If not, would you please describe
it more detailed?

2. If it's a winform control, do you mean to directly use a winform control
in webpage(in IE browser) or just want to add a Such custom control in a
web page?

In dotnet, there are two different kinds of controls:
1. the winform controls which are derived from the
System.Windows. Forms.Control
These controls are used in winform application.

2. the web controls which are derived from the System.Web.UI.C ontrol
These controls are used in ASP.NET web pages.
Also, you can create your own custom web controls which derived from the
System.Web.UI.C ontrol

However, since the two kinds of controls are quite diferent from each
other(in their internal implement mechanism). They are not able to used in
other's enviroment (such as using web control in winform or using winform
control in web page are not generally recommended).
If you want to create some custom controls which can be used in ASP.NET web
page. You can have a view on the following tech articles in MSDN:

#Developing ASP.NET Server Controls
http://msdn.microsoft.com/library/en...lopingwebforms
controls.asp?fr ame=true

Please check out the preceding suggestions to see whether they are helpful.
If you have any quesitons or if you feel my suggestion not quite
appropriate for your situation, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
Hi Steven,

No it is not a winform. It is a user control. I am able to drop that
user control onto a winform and it works perfectly. Now when I drop
this same user control onto an ASP page, I get the error previously
stated.

v-******@online.m icrosoft.com (Steven Cheng[MSFT]) wrote in message news:<l3******* *******@cpmsftn gxa07.phx.gbl>. ..
Hi Drew,
Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, I understand that you've made a custom control which
references some Mixed c++ dlls. The control can be used in Winform
correctly. Then, you'd like to use it in a ASP.NET web page. However, when
you try to add it onto a web page, you encountered the
"Operation cannot be complete" error.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

If my understanding is correct, I'd like to query some further info on this
issue:
1.The UserControl you created is a winform control derived from
System.Windows. Forms.Control , isn't it? If not, would you please describe
it more detailed?

2. If it's a winform control, do you mean to directly use a winform control
in webpage(in IE browser) or just want to add a Such custom control in a
web page?

In dotnet, there are two different kinds of controls:
1. the winform controls which are derived from the
System.Windows. Forms.Control
These controls are used in winform application.

2. the web controls which are derived from the System.Web.UI.C ontrol
These controls are used in ASP.NET web pages.
Also, you can create your own custom web controls which derived from the
System.Web.UI.C ontrol

However, since the two kinds of controls are quite diferent from each
other(in their internal implement mechanism). They are not able to used in
other's enviroment (such as using web control in winform or using winform
control in web page are not generally recommended).
If you want to create some custom controls which can be used in ASP.NET web
page. You can have a view on the following tech articles in MSDN:

#Developing ASP.NET Server Controls
http://msdn.microsoft.com/library/en...lopingwebforms
controls.asp?fr ame=true

Please check out the preceding suggestions to see whether they are helpful.
If you have any quesitons or if you feel my suggestion not quite
appropriate for your situation, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4
In other words I cannot use a winform control in an ASP page. Ill read
the article you mentioned for more information. Thank you.

v-******@online.m icrosoft.com (Steven Cheng[MSFT]) wrote in message news:<l3******* *******@cpmsftn gxa07.phx.gbl>. ..
Hi Drew,
Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, I understand that you've made a custom control which
references some Mixed c++ dlls. The control can be used in Winform
correctly. Then, you'd like to use it in a ASP.NET web page. However, when
you try to add it onto a web page, you encountered the
"Operation cannot be complete" error.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

If my understanding is correct, I'd like to query some further info on this
issue:
1.The UserControl you created is a winform control derived from
System.Windows. Forms.Control , isn't it? If not, would you please describe
it more detailed?

2. If it's a winform control, do you mean to directly use a winform control
in webpage(in IE browser) or just want to add a Such custom control in a
web page?

In dotnet, there are two different kinds of controls:
1. the winform controls which are derived from the
System.Windows. Forms.Control
These controls are used in winform application.

2. the web controls which are derived from the System.Web.UI.C ontrol
These controls are used in ASP.NET web pages.
Also, you can create your own custom web controls which derived from the
System.Web.UI.C ontrol

However, since the two kinds of controls are quite diferent from each
other(in their internal implement mechanism). They are not able to used in
other's enviroment (such as using web control in winform or using winform
control in web page are not generally recommended).
If you want to create some custom controls which can be used in ASP.NET web
page. You can have a view on the following tech articles in MSDN:

#Developing ASP.NET Server Controls
http://msdn.microsoft.com/library/en...lopingwebforms
controls.asp?fr ame=true

Please check out the preceding suggestions to see whether they are helpful.
If you have any quesitons or if you feel my suggestion not quite
appropriate for your situation, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5
Hi Drew,

Thanks for your response. As I mentioned in last reply. Generally, we
should use different type of control in different kinds of applications.
In winform application, we use windows control(we can create such control
by windows control library project). In ASP.NET web application, we use web
controls(which can be created by web control library). They're quite
different. Please check out the tech articles I provided last time.

Also, here is some further tech articles in ASP.NET QuickStart on Web
usercontrol and server control:
#Web Forms User Controls
http://samples.gotdotnet.com/quickst...bpagelets.aspx
#ASP.NET web custom control
http://samples.gotdotnet.com/quickst...authoring.aspx

If you have any questions, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6

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

Similar topics

1
4026
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the same way a menu does. To do this my control needs to get notified when the user tried to click off of it. The Leave and LostFocus events of the UserControl work most of the time but not always. For example, if they click on a part of the form...
5
3161
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access the code variable that are supposed to be linked to the contained controls. It runs fines when everything is contained in a single web form project. What do I need to do to make it work from a class library?
4
1415
by: DotNetJunkies User | last post by:
I have created a User Control (a Pareto Chart) using C#. It works great in .Net Windows Apps, but I also need to use it in a Web Application (to view in IE). Everything I read on this seems to be talking about Web Controls (although the terms "Web Control" and "User Control" seem to be used interchangeably). Can I use this Control in IE even though its not a Web Control? Whats the alternative? The Control project is fairly extensive, using...
6
3814
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many user get used to click "enter" key to submit a form. How can I use "enter" key to submit/postback in ASP.NET. Thank, Guoqi Zheng
4
2515
by: louise raisbeck | last post by:
Resending this as own topic as didnt get answer from original. Would be grateful for a response from anyone that knows. Thanks. Hi there, I found your post really helpful..but i wondered if, once I have exposed a public property containing the value of a textbox in a user control..how do I grab this from the calling page? I cant think of the syntax, since my page doesnt know the contents of the class (and therefore, the public...
1
1935
by: Lucien Dol | last post by:
Hi all, Can someone help me with this, please? I've got a user control that (amongst other controls) contains a textbox. The textbox has its Anchor property set to "Left, Top, Right", meaning that it will stretch automatically when the control is resized on a form or other user control. When in design mode I look at the control by itself (rather than dropped on a form) the control has a certain size (let's call this SizeA).
1
2295
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP message but this only goes to the form and I want it in the user control that maybe very much removed from the form's knowledge; i.e. the form may launch a 3rd party form that, upon a call back, decides to launch other form that has my user control...
9
2434
by: timnels | last post by:
I have an issue where I have a user control that is launched into a floating form. At some point later, I allow the user to "unfloat" the user control by reparenting it on a split container in another form. Problem is if I wake a tooltip when the window is floated, and then try the same thing when it is reparented, the app crashes with " Cannot access a disposed object.Object name: 'Form'. Presumably, this is a result of the tooltips...
2
15071
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels...
5
1930
by: =?Utf-8?B?U2FsYW1FbGlhcw==?= | last post by:
Hi, I have a user control which I like to use in several projects (winforms) in the same solution. Inside lets say Winapp1 , When adding a reference to this control, I can dynamically or statically create it and when running the application it is correctly drawn on the form. But when I take out the reference to this control in Winapp1, reference it in a utility project, then reference the utility project in Winapp1 or Winapp2, instantiate...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5299
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.