Groups | Blog | Home
all groups > asp.net webcontrols > march 2004 >

asp.net webcontrols : ASCX


Ken Cox [Microsoft MVP]
3/29/2004 10:21:17 PM
There's a tutorial on user controls here:

http://www.dotnetjunkies.com/quickstart/aspplus/doc/webpagelets.aspx

[quoted text, click to view]
Scott M.
3/29/2004 10:27:56 PM
..ascx files are UserControls. UserControls are like fragments of a page
that can be used over and over again inside of other pages.

You create .ascx pages the same way you create .aspx pages only the
declaration lines are a bit different. Just open up one of those .ascx
files you've come across and take a look.

[quoted text, click to view]

johndoe NO[at]SPAM driver.net
3/30/2004 2:12:12 AM
Assuming you hav a ASP.NET Project open and are using VS.NET
just go to Project -> Add User Control
Double click on the new ASCX file that you have and then you will be taken
to CodeView namely the Page_Load Section

protected override void Render(HtmlTextWriter writer)
{
writer.WriteLine("This Line Will be placed where my control is
situated");
base.Render (writer);
}

Compile and make sure there are no errors.
Then Go to the Web Form you wish to use the control on.
With the Solution Explorer open drag the ASCX file onto your WebForm File
Switch to HTML View and move the Control in the exact position you want it

Hope that helps.



right click and synchronoize Class View -> expand the class and
[quoted text, click to view]

A-PK
3/30/2004 10:50:00 AM
Hi, I have notice some file with extension *.ascx

Could someone tell me more about it.
I am currently got a fully done web project, but the files with extension
*.aspx
Is there any way to compile such file to *.ascx.

Or perhaps someone could tell me how to create *.ascx
some useful reference would be great if got.

thank you

A-PK
3/30/2004 2:26:27 PM
i found the ASP.NET Portal sample is great.
i am thinking to write in some ascx coding, and use the Add Module there to
add the new ascx file that I have created. but i have no idea how to do it.
could you guide me ?

how do make a ascx file that is similar to ASP.net portal sample one

[quoted text, click to view]

AddThis Social Bookmark Button