Friday, May 27, 2011

ASP.NET @ Page directive

Every ASP.NET generally begins with the @ Page directive. This defines page-specific attributes used by the ASP.NET page parser and compiler and can be included only in .aspx files. By default, Visual Studio creates a page directive as shown below (when you use the default web application template):

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>


This directive can be used only in Web Forms pages. You can include only one @ Page directive per .aspx file. Further, you can define only one Language attribute per @ Page directive, because only one language can be used per page.The Page directive is made of many attributes. Let’s review a few of the important ones:


Title
Specifies a title for the page that is rendered within the HTML <title> tags in the response. The title can also be accessed programmatically as a property of the page.


Language
Specifies the language used when compiling all inline rendering (<% %> and <%= %>) and code declaration blocks within the page. Values can represent any .NET Framework-supported language, including Visual Basic, C#, or JScript. Only one language can be used and specified per page.


MasterPageFile
Sets the path to the master page for the content page or nested master page. Supports relative and absolute paths.


AutoEventWireup
Indicates whether the page's events are autowired. true if event autowiring is enabled; otherwise, false.


CodeBehind
Specifies the name of the compiled file that contains the class associated with the page. This attribute is not used at run time. This attribute is used for Web application projects. The CodeFile attribute is used for Web site projects.


Inherits
Defines a code-behind class for the page to inherit. This can be any class derived from the Page class. This attribute is used with the CodeFile attribute, which contains the path to the source file for the code-behind class. The Inherits attribute is case-sensitive when using C# as the page language, and case-insensitive when using Visual Basic as the page language.


If the Inherits attribute does not contain a namespace, ASP.NET checks whether the ClassName attribute contains a namespace. If so, ASP.NET attempts to load the class referenced in the Inherits attribute using the namespace of the ClassName attribute. (This assumes that the Inherits attribute and the ClassName attribute both use the same namespace.)


In addition to the attributes generated by default, you should also know about the following properties. They are a favorite of interviewers (they are either obscure, or ASP.NET 4 specific or they just like it).


ClientIDMode
Specifies the algorithm to use to generate ClientID values for controls. The default value is Predictable. The default value for controls is Inherit. Therefore, the default algorithm for controls in a page is determined by the ClientID setting of the page. A different default value can be set in the pages element of the Web.config file. For more information about the algorithms, see the ClientIDMode class.


ContentType
Defines the HTTP content type of the response as a standard MIME type. Supports any valid HTTP content-type string.


EnableEventValidation
Enables validation of events in postback and callback scenarios. true if events are being validated; otherwise, false. The default is true.


Page event validation reduces the risk of unauthorized postback requests and callbacks. When the enableEventValidation property is set to true, ASP.NET allows only the events that can be raised on the control during a postback request or callback. With this model, a control registers its events during rendering and then validates the events during the post-back or callback handling. All event-driven controls in ASP.NET use this feature by default.


It is strongly recommended that you do not disable event validation. Before disabling event validation, you should be sure that no postback could be constructed that would have an unintended effect on your application.


EnableSessionState
Defines session-state requirements for the page. true if session state is enabled; ReadOnly if session state can be read but not changed; otherwise, false. The default is true. These values are case-insensitive.


EnableViewState
Specifies whether view state is maintained across page requests. This value is true if view state is maintained, or false if view state is not maintained. The default is true.

122 comments:

  1. Thank you so much..i have to really helpful for your sharing information..

    Information Training in Chennai | Oracle DBA Training in Chennai

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. i gain the knowledge of and industry oriented coaching available from greens technology chennai in Adyar may visit.Sharepoint Training In Chennai

    ReplyDelete
  4. once again sharing this informative blog .It uses a graphical notation to construct data integration solutions and is available in various versions may visit greens technology chennai in adyaroracle dba training In Chennai

    ReplyDelete
  5. Very nice blogs!!! i have to learning for lot of information for this sites...
    android Training in Chennai | Oracle Training in Chennai

    ReplyDelete
  6. Latest Govt Bank Jobs 2016

    This is awesome blog with smart content, Nice to see your post. Thanks...........

    ReplyDelete
  7. What great post thanks for amazing sharing with lots of applications Company About Us

    ReplyDelete
  8. thanks for sharing this information..
    Best SEO training in hyderabad all modules are clearly solved and practice with guide.seo training in hyderabadAnd clearly getting knowledge of seo.

    ReplyDelete
  9. WONDERFUL ARTICLE, REALLY GOOD INFORMATION AND NICE EXPLANATION...KEEP IT UP.

    ReplyDelete
  10. Excellent post. I like your blog. Thanks for sharing.

    ppc training in chennai

    ReplyDelete
  11. Thank you so much..i have to really helpful for your sharing information..
    best informatica training institute

    ReplyDelete
  12. i have to really helpful for your sharing information.. the best shell-perl training in chennai

    ReplyDelete
  13. i have to really helpful for your sharing information.. the best websphere training in chennai

    ReplyDelete
  14. This was actually what i was looking for, and i am glad to came here! Thank you very much
    angelfire
    wikidot
    mywapblog
    page
    inube
    tumblr

    ReplyDelete
  15. Great post, This is very useful, Thanks for sharing and keep updating your post.
    Ladies Hostel in Kodambakkam

    ReplyDelete
  16. On this give maneuver: tandum-heart and soul collapsing ward, crystal clear adi inside period of time of
    brand new unimportant; for any shining, kobe Bryant, initially the emperor incarnate elect; period is the
    abbreviation, on playoffs multiple better running footwear…
    My Web : we like to honor numerous other world wide web web pages around the web,
    Penangkal Petir Mueven though they arent linked to us, Penangkal Petir by linking to them.

    ReplyDelete
  17. A pioneer Institute owned by industry professionals to impart vibrant, innovative and global education in the field of Hospitality to bridge the gap of 40 lakh job vacancies in the Hospitality sector. The Institute is contributing to the creation of knowledge and offer quality program to equip students with skills to face the global market concerted effort by dedicated faculties, providing best learning environment in fulfilling the ambition to become a Leading Institute in India.

    cha jaipur
    management college in jaipur
    management of hospitality administration jaipur
    cha management jaipur
    Best hotel college in jaipur
    Best management college in jaipur

    ReplyDelete
  18. Great articles,first of all Thanks for writing such lovely Post! Earlier I thought that posts are the only most important thing on any blog.... Android Training in Chennai
    Selenium Training in Chennai
    Hadoop Training in Chennai

    ReplyDelete
  19. The blog gave me idea about Page directive and the information about the attributes in page directive were very much useful. My sincere thanks for sharing this post
    Dot Net Training in Chennai

    ReplyDelete
  20. Thank you so much for sharing this worth able content with us. The concept taken here will be useful for my future programs and i will surely implement them in my study. Keep blogging article like this.
    dot net training in chennai

    ReplyDelete
  21. Thank you for sharing.If anyone want to become an Dotnet certified professional reach TIS Academy, which offers best Dot Net Training in Chennai with years of experienced professionals. For more details about courses..
    Hadoop Training in Chennai

    ReplyDelete
  22. The blog gave me idea about the functional Programming and the features of functional programming are explained in an understandable manner Thanks for sharing this valuable post
    dotnet training in chennai

    ReplyDelete
  23. really you have posted an informative blog. it will be really helpful to many peoples. thank you for sharing this blog. before i read this blog i didn't have any knowledge about this but now i got some knowledge.
    dot net training in chennai

    ReplyDelete
  24. Interesting and attractive article, very useful to me.. thanks for sharing your information..


    Dot Net Training in chennai | Dot Net Training institute in chennai

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete
  26. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
    dot-net training in chennai

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. I enjoy what you guys are usually up too. This sort of clever work and coverage! Keep up the wonderful works guys I’ve added you guys to my blog roll.
    diploma in fire and safety course in chennai

    ReplyDelete
  29. Thank you for sharing the information. This is very valuable information. We are one of the leading software development company at chennai. Pls call +91 - 44 - 4294 9615 to schedule demo or send email to info@sphinaxinfosystems.com
    Our site:Sphinax info systems

    ReplyDelete
  30. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition. Dotnet developer
    Authorized Dot Net training in chennai

    ReplyDelete
  31. Thanks The information which you provided is very much useful and easy to learn as well... keep rocking and updating... looking further..
    Austere Technologies |Internet Of Things

    ReplyDelete
  32. Great article, really very helpful content you made. Thank you, keep sharing.

    Application Quality Managment Services | Austere Technology Solutions

    ReplyDelete
  33. Really great blog, it's very helpful and has great knowledgeable information.

    Best Software Security Services | Austere Technology Solutions

    ReplyDelete
  34. Nice Blog, Thanks for sharing this valuable information. Keep sharing like this.

    Dot Net Training in Chennai

    ReplyDelete
  35. Great post! Wonderful information, Thanks for sharing with us.

    Selenium Training in Chennai

    ReplyDelete
  36. Thanks for sharing this wonderful blog. Helpful article ! Kindly visit us @ Chocolate gift box

    ReplyDelete
  37. All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
    RPA Training in Chennai
    Selenium Training in Chennai
    RPA course
    Robotic Process Automation Certification
    Selenium testing training in chennai
    Selenium course

    ReplyDelete
  38. This comment has been removed by the author.

    ReplyDelete
  39. My spouse and I love your blog and find almost all of your post’s to be just what I’m looking for.
    safety course in chennai

    ReplyDelete
  40. Looking for best TNPSC study materials to prepare for the examination? Make use of our samacheer kalvi books and other study guide to learn from experts. TNPSC One Time Registration

    ReplyDelete
  41. It was really a nice experience to be on your blog. Get Osha online safety training course from Safetraining.com. For more visit here osha training online

    ReplyDelete
  42. Great Post. Thanks for sharing this valuable information with us..

    Website Development Company in Delhi

    ReplyDelete
  43. As yet utilizing this customary time, Trinidad has the biggest fair, with day by day occasions for about a month paving the way to Shrove Tuesday. Jamie Foxx

    ReplyDelete
  44. Proper construction courses are available online who provides the WHMIS training courses to employees for safely working at the construction site. You can opt for professional Traffic Control Person Course for more information.

    ReplyDelete
  45. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing.. i Want to share Some data regarding the websphere training videos with free bundle videos is provided.

    ReplyDelete
  46. Great Article. Thank you for sharing! Really an awesome post for every one.

    IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    JavaScript Training in Chennai

    JavaScript Training in Chennai


    ReplyDelete
  47. This comment has been removed by the author.

    ReplyDelete

  48. Wow. That is so elegant and logical and clearly explained. Brilliantly goes through what could be a complex process and makes it obvious.I want to refer about the best websphere training videos and websphere admin training

    ReplyDelete
  49. So do yourself an enormous kindness and ensure the point hasn't been secured at this point before writing anything. Wikipedia page creation services

    ReplyDelete
  50. This blog clearly illustrates the ASP.NET @ Page directive with nice explanation. Thanks for sharing the blog and keep updating regularly! Visit: website development company in Chennai | seo company in Chennai

    ReplyDelete
  51. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
    machine learning course training in guduvanchery

    ReplyDelete
  52. thank you my friend http://www.azarchat.net

    ReplyDelete
  53. Salesforce versatility include likewise has makes an effect in its convenience, with respect to any developing business Salesforce can meet the intricacy and volume taking care of assumption and necessity of the business.
    Salesforce training with job support in Pune

    ReplyDelete
  54. best logo design companies
    Hey buddies, such a marvelous blog you have made I’m surprised to read such informative stuf

    ReplyDelete
  55. This blog gives useful insights into digital marketing. For those who want to learn professionally, Login360 digital marketing course in Chennai seems like a good option. https://login360.in/digital-marketing-classes-in-chennai/ call number
    +91 87546 87537

    ReplyDelete
  56. Nice explanation of the ASP.NET Page Directive. Many beginners overlook how important this line is in Web Forms, since it controls key settings like the programming language, code-behind file, and event wiring for the page. Understanding directives helps developers see how ASP.NET compiles and processes .aspx pages behind the scenes. Clear tutorials like this make learning the framework much easier for students and new developers. Sharing technical guides effectively through a digital marketing course can also help reach a wider developer audience.

    ReplyDelete
  57. Nice explanation of the ASP.NET Page Directive. It’s useful for beginners to understand how directives control page behavior, compilation settings, and language configuration in ASP.NET applications. Learning these fundamentals helps developers build structured and maintainable web projects. Anyone interested in expanding their development skills can also explore professional training like **Java course Chennai**, **Python course**, **Data Science course**, **Data Analyst course**, **Full Stack Development**, and **UI/UX course from Login360 to strengthen modern tech skills.

    ReplyDelete
  58. Nice explanation of the ASP.NET Page directive and how it controls page-level settings like language, code-behind files, and compilation options. Understanding directives is important because they influence how ASP.NET pages are processed and executed on the server. Articles like this are very helpful for beginners preparing for programming interviews or learning web development concepts. The blog itself focuses on programming interview preparation and ASP.NET topics that help developers strengthen their fundamentals.
    For those expanding into broader development skills, training programs like **Java Course Chennai**, **Python Course**, **Data Science Course**, **Data Analyst Course**, **Full Stack Development Course**, and **UI/UX Course** from Login360 can help learners build strong technical careers.


    ReplyDelete
  59. For anyone looking to build a strong foundation in design and user experience along with technical skills, this detailed resource on
    UI/UX design course syllabus can be really helpful. It covers essential concepts needed to grow in today’s digital space.

    Looking forward to more valuable content like this!

    ReplyDelete
  60. ASP.NET Page Directive defines page settings like language and configuration for processing the page – learn more with UI UX design course online

    ReplyDelete
  61. Really enjoyed reading this! The Figma UI/UX Course is perfect for improving design skills. Developers can check the Full Stack Developer Course in Chennai too.

    ReplyDelete
  62. Excellent article for aspiring developers and designers. Joining a Python course in Kochi and reviewing the UI/UX design course syllabus can help students understand both functionality and user experience.

    ReplyDelete
  63. Thank you for sharing this informative explanation about the ASP.NET @ Page directive. The way you described its role in defining page-specific attributes for the ASP.NET page parser and compiler is very helpful for beginners learning web application development. Tutorials like this make it easier for developers to understand how ASP.NET pages are structured and managed within Microsoft Visual Studio.

    For students and professionals who want to build strong technical and digital skills, I would also recommend checking out PDMTI – Pune Digital Marketing Institute. They provide practical training in digital marketing, SEO, analytics, and industry-focused learning programs that are useful for career growth in today’s technology-driven world.

    ReplyDelete
  64. Excellent explanation and very well-organized content. The article was educational and easy for readers to connect with.
    I also came across this useful Data Analytics Course in Coimbatore for aspiring professionals.
    This Data Analytics Beginners Course is highly recommended for beginners.

    ReplyDelete
  65. Intellimindz offers professional training in Playwright, SAP FICO, Red Hat OpenShift, Inplant Training for EEE, Rebar Detailing, ACCELQ, RPA, WordPress, ANSYS, and AutoCAD 3DS in Salem. These courses provide hands-on learning through real-time projects, expert mentoring, certification guidance, and placement support to help learners gain practical skills and build successful careers in software, automation, engineering, cloud, and enterprise technologies.
    Playwright Training in Salem

    SAP FICO Training in Salem

    Red Hat OpenShift Training in Salem

    Inplant Training in Salem for EEE

    Rebar Detailing Course in Salem

    ACCELQ Training in Salem

    RPA Training in Salem

    WordPress Training in Salem

    ANSYS Training in Salem

    AutoCAD 3DS Training in Salem

    ReplyDelete
  66. Intellimindz offers industry-focused training programs in Gurgaon to help learners develop expertise in software development, automation, enterprise technologies, and engineering applications. The courses include EPLAN, ETL Testing, IBM RPA, IDMC, Java, JIRA, JMeter, Linux Shell Scripting, Mainframe Administration, and MATLAB Simulink Training. Each program is designed with hands-on practical sessions, real-time projects, and an industry-oriented curriculum to equip students and working professionals with job-ready technical skills. Guided by experienced trainers and supported with career-focused learning, Intellimindz enables learners to strengthen their expertise and advance confidently in today's competitive IT and engineering industries.
    EPLAN Training in Gurgaon

    ETL Testing Training in Gurgaon

    IBM RPA Training in Gurgaon

    IDMC Training in Gurgaon

    Java Training in Gurgaon

    JIRA Training in Gurgaon

    JMeter Training in Gurgaon

    Linux Shell Scripting Training in Gurgaon

    Mainframe Admin Training in Gurgaon

    MATLAB Simulink Training in Gurgaon

    ReplyDelete
  67. Explore IntelliMindz Bangalore training programs offering industry-focused courses in AI, Apigee, Application Security, AWS Cloud Security, IoT, NetApp, Oracle NetSuite, Playwright Automation, Spring Boot, and SQL. Gain hands-on skills, expert mentorship, and real-time projects designed to boost your career in cloud, development, automation, and enterprise technologies for high-demand IT roles.

    AI Training in Bangalore

    Apigee Training in Bangalore

    Application Security Training in Bangalore

    AWS Cloud Security Training in Bangalore

    IoT Training in Bangalore

    NetApp Training in Bangalore

    Oracle NetSuite Training in Bangalore

    Playwright Automation Training in Bangalore

    Spring Boot Training in Bangalore

    SQL Training in Bangalore

    ReplyDelete
  68. Power BI Training in Madurai

    Tally Training in Madurai

    VLSI Training

    Anaplan Training in Madurai

    Playwright With JavaScript Training in Madurai

    Product Management Training in Madurai

    SAP VIM Training in Madurai

    Data Engineering Training in Madurai

    Mendix Training in Madurai

    Red Hat OpenShift Training in Madurai Power BI Training in Madurai** helps learners develop skills in data visualization, reporting, and business intelligence. **Tally Training in Madurai** provides practical knowledge in accounting, finance management, and business operations. **VLSI, Anaplan, Playwright With JavaScript, Product Management, SAP VIM, Data Engineering, Mendix, and Red Hat OpenShift Training in Madurai** offer industry-relevant learning with hands-on practice, expert trainers, and real-time concepts. These training programs help beginners and professionals enhance technical skills and build successful career opportunities in modern IT domains.

    ReplyDelete
  69. Intellimindz offers industry-focused training in Azure Databricks, Quantum Computing, Alteryx, AS400, Dell Boomi, Power BI, Tally, Anaplan, Playwright with JavaScript, and Product Management in Hyderabad. These courses provide practical skills, real-time project experience, and expert guidance to help learners build strong careers in technology, analytics, automation, finance, and business management.

    Azure Databricks Training in Hyderabad
    Quantum Computing Training in Hyderabad
    Alteryx Training in Hyderabad
    AS400 Training in Hyderabad
    Dell Boomi Training in Hyderabad
    Power BI Training in Hyderabad
    Tally Training in Hyderabad
    Anaplan Training in Hyderabad
    Playwright with JavaScript Training in Hyderabad
    Product Management Training in Hyderabad

    ReplyDelete