Saturday, September 23, 2006

Use a *.ascx files

Hello, in this article we learn how to use the *.ascx files.
General information.
the ascx files are a codes, but not a pages in your site just a part of a one or more pages.
How to write this file?
To write an ascx files you use the text editor you use to write aspx files and you cam write code in aspx, html and all the codes you wont (like a aspx file). when you save the file you need to give it a ascx ending, not aspx ending, like this: FileName.ascx
How to use ascx files?
to use a ascx files we use this code in the start of the page:
<%@ Register TagPrefix="GM" TagName="style" Src="style.ascx" %>
TagPrefix was the NikeName of the tag we use.
TagName was the name of the tag we use
Src was the url of the ascx file we use.
and when you wont to pot the code from the ascx file in the page, use this code:
<Gm:style id="GMstyle" runat="server" />
Gm is the NikeName I give to the previous code we use
id is the id of the code, its not change nothing
runat you need to put in all of the codes we use.
Do you find a error on my article? do you wond to add somethin to my article? send to my email to nimrod95@gmail.com
Success!!!



No comments: