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

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


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.

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Nov 18 '05 #1
4 1390
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

"DotNetJunkies User" <User@-NOSPAM-DotNetJunkies.com> wrote in message
news:e9****************@tk2msftngp13.phx.gbl...

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.

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup
engine supports Post Alerts, Ratings, and Searching.

Nov 18 '05 #2
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" <User@-NOSPAM-DotNetJunkies.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...

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.
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup

engine supports Post Alerts, Ratings, and Searching.
Nov 18 '05 #3
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" <User@-NOSPAM-DotNetJunkies.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...

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.
---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup

engine supports Post Alerts, Ratings, and Searching.
Nov 18 '05 #4
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

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e0**************@TK2MSFTNGP15.phx.gbl...
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" <User@-NOSPAM-DotNetJunkies.com> wrote in message
news:e9**************@tk2msftngp13.phx.gbl...

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.

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup

engine supports Post Alerts, Ratings, and Searching.

Nov 18 '05 #5

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

Similar topics

1
by: .Net Newbie | last post by:
I am relatively new to .Net and have been coding an intranet site for my employer for a couple of months. I am currently stuck coding in a text-editor called EditPlus without access to the VS.Net...
3
by: Joe Au | last post by:
How to place the web user controls on the web form freely the location I want? Especially, if I get more than one web user controls. Thanks. Joe.
4
by: pei_world | last post by:
in asp or php, we can use inner output command to print out text or other thing inside out web page. I want to know how to do this in asp.net. I know user control with placesholder can do, but if...
2
by: ALI-R | last post by:
Hi I've created a bunch user comtrols for the footer,header,navigation bar of a webpage ,I have two problems: 1) All the controls are in the folder "Control" of the root and all the images...
2
by: Bryan ZM | last post by:
I saw a sample app at the VS live conference in San Francisco this year, they had a gridview control on a web form, but when .net 2.0 was detected on the PC it actually rendered a .net form control...
2
by: Andrew | last post by:
Hello, friends, I have a couple of web user controls, and I put it in my .net web page. But, they alway went to the top of the design window, no matter how I dragged-dropped them. (looks silly,...
1
by: Andrew | last post by:
Hi, friends, This drove me nuts: I had two web user controls: header.ascx and copyright.ascx. I planed to put them on each .aspx pages: Header on the top, and Copyright at the bottom. ...
3
by: JimCinLA | last post by:
I use a place holder to load different user controls on an .aspx page. Let's call this default.aspx. Each user controls contains about a dozen different ASP.Net controls. My question is, how...
3
by: RvGrah | last post by:
I have a user control with eight text boxes, if I start typing in the first text box in the tab order all is well, but if I mouse click into another box and start typing the text goes into the frst...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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...
0
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
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...

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.