ASCX

  • Thread starter Thread starter A-PK
  • Start date Start date
A

A-PK

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
 
..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.
 
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
 
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
 
Back
Top