Introduction
Him will you have a website
which you need to repeatedly use a group of controls that record layout that
group of controls on these pages may be copying and pasting from one page to
the other that work for one of that group of controls had some code it needed
to run in reaction to some user of it in that case what you really need is some
way to create your own single control that contains all those controls that.
You could then
drop onto a webpage and have it run some code like a normal control what you
can do that you can create a user control that is basically a conglomeration of
other controls in addition you can also create a custom control which is a
control like those you find a little box in this section will investigate user
controls in the next section will investigate creating custom controls.
User Control 1
First are user controls these
are really like a little page that you embed within other pages these must have
a.ASC X extension and you design them as if they were a normal page you can add
code to react to events and then you can treat them as a reusable entity there
really are intended for use within a single site however that you can create a
custom control a custom control is created from scratch these acts and feel
like built-in server controls because they are the same thing as built-in
server controls all.
The server
controls that are built in to the toolbox are actually Microsoft provided
custom controls these each inherit from a base class and that added members as
necessary the result is an assembly which contains the control of a custom
controls only job really is to render output just like a standard built-in
control its job is to spit out HTML when the page is rendered in this section
will begin by looking at creating a simple user control imagine that you want
some standard user interface design.
And you liked
implemented across all the pages in your website perhaps your standard menu or
footer or hitter on every page you could of course critical master page but
that's not the point here let's take a look of example I've already created
where I have thought of information in a user control how does get there by
right clicked on my project chose add new item and then shows Web user control
I'm a bit footer is CX 40 Dundas was canceled for now here is forgot is the X
if I look at this markup you'll see that it looks like a page really is very
much like a page except that has a control directive instead of a page
directive all we have on your right now is a style sheet link and then a
horizontal rule and some text for looking design it's not totally overwhelming
it's just text okay.
0 comments:
Post a Comment