473,224 Members | 1,485 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,224 software developers and data experts.

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 1608
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.Control
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.Control

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?frame=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.Control
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.Control

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?frame=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.microsoft.com (Steven Cheng[MSFT]) wrote in message news:<l3**************@cpmsftngxa07.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.Control
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.Control

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?frame=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.microsoft.com (Steven Cheng[MSFT]) wrote in message news:<l3**************@cpmsftngxa07.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.Control
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.Control

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?frame=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
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...
5
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...
4
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...
6
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...
4
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...
1
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...
1
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...
9
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...
2
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...
5
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into 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.