Can I place a User Control (not Web Control) in IE

F

Faizan Ahmed

You seems a little confused with the term Web Controls. Let me clear things
for you
Controls are of following types

1. Windows Controls
1.a Windows Controls (e.g. TextBox, Button etc.)
1.b Win User Controls (the one u made)
2. Web Controls
2.a ASP.NET Server Controls (e.g. TextBox , Button etc. the ones used in
web forms)
2.b Web User Controls (the one u need to make)

All the control types that are listed on the top are not interchangeable, so
if you made a superb Win User Control and u want to use it on your web
applications, you cant do so. You'll need to make a similar Web User
Control.

I hope this helps


DotNetJunkies User said:
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 several windows forms, datagrids, and GDI+ for drawing the
chart onto the User Control. thanks.engine supports Post Alerts, Ratings, and Searching.
 
D

DotNetJunkies User

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 several windows forms, datagrids, and GDI+ for drawing the chart onto the User Control. thanks.
 
E

Enrique Santa Cruz

You can use a WebUserControl in any WebForm. Your WebApplication can use any
controls from System.Web not from System.Forms these controls are used for
different targets one is windows the other is web.

Enrique
 
K

Kevin Spencer

I can understand your confusion, especially since it seems that web
application development must be new to you. The term "User Control" is used
to mean different things in different contexts. Basically, the generic idea
of "User Control" is a Control that is defined by the developer, rather than
part of the pre-existing platform Controls. Some of the confusion arises due
to Microsoft's naming of a specific type of System.Web.UI.Control as a
"UserControl." This refers specifically to a templated control which, like
System.Web.UI.Page, has 2 components: A Template file and a CodeBehind
class. However, in ASP.Net, there are 3 other distinctions of Controls.
First, there is the base class, System.Web.UI.Control. From this, 2 other
namespaces of classes of Controls are derived: HtmlControls and WebControls.

Note, however, the parent NameSpace: System.Web.UI. A Windows Form Control
is in the NameSpace of System.Windows.Forms.Control. As you can see, these
are completely un-related in terms of NameSpace and functionality. A Windows
executable is an application that operates in the local machine environment.
An ASP.Net application is an application that operates in the context of a
web server. And never the twain shall meet. The similarities are due to the
fact that both types of Controls are defined as Controls because they are UI
components, but beyond that they share nothing in common. A Windows Form
Control renders by drawing to a graphic device. A Web Control renders by
emitting HTML to a stream.

So, bottom line: You can't use your Windows Form Control in an ASP.Net
application. The alternative is to create a System.Web.UI.Control which
renders itself to an HTML document by emitting HTML.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

DotNetJunkies User said:
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 several windows forms, datagrids, and GDI+ for drawing the
chart onto the User Control. thanks.engine supports Post Alerts, Ratings, and Searching.
 
K

Kevin Spencer

Just want to make a small correction. In my original post (quoted below) I
said "From this, 2 other namespaces of classes of Controls are derived:
HtmlControls and WebControls." While this is certainly true, some might
point out that there are other NameSpaces under System.Web.UI.Control. I
simply omitted them, as I thought they were irrelevant to the discussion.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top