WebControl

  • Thread starter Thread starter Henrry Pires
  • Start date Start date
H

Henrry Pires

Hello to all

I'm trying to make a webcontrol. I need to put on it 4 butons and one label
but i have no idia how to make it. I already wrote some windowsformrs
controls and it is very diferent from webcontrols. Can any one give me an
idia how to make it?

Thanks in advance
 
If you are asking how to make Web User Controls, then its simple. Add a New
Item to your project and choose the Web User Control Template. Add your
controls to the design area and there you go. There are a few things to
watch out for, but you should do some reading for that.

If however, you are referring to a Web Custom Control which is rendered (
You are in complete control of the visual UI ) then you need to create one
of those and override the Render member function of the base class. These
controls are far more tricky to get right than a simple Web User Control
because you have to do most of the work in the code.

I suggest you google the subject up and do some reading first and then come
back with specific questions as asking generalised questions like you have
tend to illicit little in the way of replies, because you are almost asking
someone to give you a complete tutorial on the subject.

However, I hope that I have been of some help to you in at least pointing
you in the right direction, Im a novice myself and know little about the
subject. Im probably way down low on the learning curve but Im striving each
day to learn more.
 
Why everythingin ASP is so hard?

Thanks

Mr Newbie said:
If you are asking how to make Web User Controls, then its simple. Add a
New Item to your project and choose the Web User Control Template. Add
your controls to the design area and there you go. There are a few things
to watch out for, but you should do some reading for that.

If however, you are referring to a Web Custom Control which is rendered
( You are in complete control of the visual UI ) then you need to create
one of those and override the Render member function of the base class.
These controls are far more tricky to get right than a simple Web User
Control because you have to do most of the work in the code.

I suggest you google the subject up and do some reading first and then
come back with specific questions as asking generalised questions like
you have tend to illicit little in the way of replies, because you are
almost asking someone to give you a complete tutorial on the subject.

However, I hope that I have been of some help to you in at least pointing
you in the right direction, Im a novice myself and know little about the
subject. Im probably way down low on the learning curve but Im striving
each day to learn more.
 
This is ASP.NET , not ASP. It's not hard, it's just different, and
sometimes it can be overwhelming like many new things. But if you stick with
it, you will be ok.
 
It's not all that hard, but it's a lot of stuff to know/remember.

Just keep at it, learning a bit every day, and you'll learn what you need.

<practical mode>
In a way, I'm kinda glad it is, because if this was too easy,
who would pay us the big bucks we want to get for our work ?
</practical mode>




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 
Well I'm entering in the ASP.Net world, I come from windows forms that's why
i find so hard ASP


Programing client side and server side some times is confuse. And takes a
lot of work to do some kind of simple things.

:-(

Thanks
 
It is completely different. One of the things you have trouble with when
switching is the fact that you have to preserve things between posts back to
the server which is something you dont need to wory about with windows forms
because once you instantiate an object it stays put until you tell it
otherwise or close the form.

You'll be fine, and there are loads of really good folks here with lots of
experience in ASP.NET to help you. Unfortunately I as my name suggests I'm
still a newbie, but I hope to shed that in the next few months or so.
 
Yes, it's difficult. The major differences are due to several things:

1. A Windows Form operates continuously in a single area of memory for the
lifetime of the application. A Web Page operates across a TCP/IP network,
where the client-side browser and the server don't share any memory in
common, but can only pass messages back and forth. In addition, as HTTP is
stateless, each Request re-creates the Page class. Each instance of the Page
class is brand-new, like shutting down your Windows Form and restarting it.

2. A Windows Form has persistent memory. HTTP, on the other hand, is
stateless. Each Request/Response happens without any memory of any
Request/Response that previously happened. It's like 2 senile men trying to
carry on a conversation. Neither one can remember the last thing the other
said. So, ASP.Net has to resort to tricks to emulate some form of continuity
of memory. The 2 senile men pass notes back and forth to remind each other
of the last thing they said. This is done via a combination of the available
resources: Cookies, hidden form fields, temporary server memory storage in
Session, QueryStrings, etc.

3. Any network application works via network messaging; in the case of
ASP.Net, it is HTTP across a TCP/IP network. Therefore, there is no
guarantee that the data sent by either side will make it to the other, or
that it will make it intact.

4. When a user using a Windows Forms app is done, he closes it, freeing up
memory. An ASP.Net application is a service that must serve many users at
any given time, and doesn't shut down unless there are no users, and a
sufficient amount of time has passed. Therefore, there is no way for a user
to tell the server to de-allocate any memory associated with his Session.
The server waits for a Request for about 20 minutes, and if the user has not
made one, shuts down that client Session all by itself. Otherwise, every
user would accumulate more and more memory on the server, and create a very
fast memory leak.

Knowing all of this, you have 2 choices. You can go back to the nice, safe,
and relatively easy sandbox of Windows Form programming (something most of
us dream about from time to time!), or you can accept the challenge, and
move forward with ASP.Net.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
Well said !

I have made the switch now, and I'm probably not going back as there are far
more jobs out there for ASP.NET than there are for Windows Forms
Applications as far as I can tell.

I thought Smart Applications would bite into the web based stuff but it does
not seem to have made the inroads we thought it would. Mobile Smart Apps
might be the exception in time.
 
I have made the switch now, and I'm probably not going back as there are
far more jobs out there for ASP.NET than there are for Windows Forms
Applications as far as I can tell.

I think you're right on that point, Mr. N.

As for Smart devices and Mobile apps, I think the infrastructure needs a bit
more beefing up, and then we'll see a massive growth in that market.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
I've been tring tofind anything usefull to help me to make a web custom
control. Can any one give me a link or something to help me, Like a
tutorial.
 
Back
Top