Please navigate to the bottom of the page for Table of Contents

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.

153 comments:

  1. I gone through your article, its really interesting. Dot net is most used programming language for creating highly dynamic desktop and web application. Dot net programming language has created massive revolution in software development industry. Best Dot Net Training

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

    Information Training in Chennai | Oracle DBA Training in Chennai

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

    ReplyDelete
  4. Excellent information with unique content and it is very useful to know about the information based on blogs. Hadoop Training in Chennai

    ReplyDelete
  5. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.SAP Training in Chennai

    ReplyDelete
  6. Wonderful tips, very helpful well explained. Your post is definitely incredible. I will refer this to my friend.SalesForce Training in Chennai

    ReplyDelete
  7. very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.Oracle DBA Training in Chennai

    ReplyDelete
  8. This is really an awesome article. Thank you for sharing this.It is worth reading for everyone. Visit us:
    Oracle Training in Chennai

    ReplyDelete
  9. fantastic presentation .We are charging very competitive in the market which helps to bring more oracle professionals into this market. may update this blog . Datastage Training In Chennai

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

    ReplyDelete
  11. 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
  12. i wondered keep share this sites .if anyone wants realtime training Greens technolog chennai in Adyar visit this blog..performance tuning training In Chennai

    ReplyDelete
  13. Usually I am able to add links to other websites or pages within Informix Training In Chennai

    ReplyDelete
  14. Thanks for sharing this informative blog. If anyone wants to get Struts Training In Chennai

    ReplyDelete
  15. It was really a wonderful article and I was really impressed by reading this blog.Oracle sql plsql Training In Chennai

    ReplyDelete
  16. This page is dedicated for our Greens Technologies Reviews by our students. Please give your reviews here, Qlikview Training In Chennai

    ReplyDelete
  17. I like this post, and i learn new software product. thank to share with us Oracle Rac Training In Chennai

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

    ReplyDelete
  19. Latest Govt Bank Jobs 2016

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

    ReplyDelete
  20. Really awesome blog. Your blog is really useful for me.
    Thanks for sharing this informative blog. Keep update your blog.
    Oracle Training In Chennai

    ReplyDelete
  21. I am reading ur post from the beginning, it was so interesting to read & i feel thanks to you for posting such a good blog, keep updates regularly.Best Hadoop Training Institute In Chennai

    ReplyDelete
  22. Best Java Training Institute In ChennaiThis information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic..

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

    ReplyDelete
  24. 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
  25. WONDERFUL ARTICLE, REALLY GOOD INFORMATION AND NICE EXPLANATION...KEEP IT UP.

    ReplyDelete
  26. Great post....Thank you for posting the great content……I found it quiet interesting, hopefully you will keep posting such blogs…
    If you Want more seo course in chennai

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

    ppc training in chennai

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

    ReplyDelete
  29. 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
  30. Wonderful blog.. Thanks for sharing informative blog.. its very useful to me..

    iOS Training in Chennai

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

    ReplyDelete
  32. 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
  33. Thank you for this valuable information. I have got some important suggestions from it. I'm working in Brave Technologies Private Limited. We provides lowest price of ERP Software for our clients. Contact us on info@bravetechnologies.in.ERP software Chennai

    ReplyDelete
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
    iOS App Development Company
    iOS App Development Company

    ReplyDelete
  42. 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
  43. This comment has been removed by the author.

    ReplyDelete
  44. 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
  45. This comment has been removed by the author.

    ReplyDelete
  46. Incredible post. Articles that have significant and savvy remarks are more agreeable, at any rate to me. It’s fascinating to peruse what other individuals thought and how it identifies with them or their customers, as their point of view could help you later on.

    PSD to Wordpress
    wordpress website development

    ReplyDelete
  47. Wonderful post. I am learning so many things from your blog.keep posting.
    PHP Online Training | Pega Online Training | Oracle Soa Online Training

    ReplyDelete
  48. 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
  49. 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
  50. 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
  51. 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
  52. Great article, really very helpful content you made. Thank you, keep sharing.

    Application Quality Managment Services | Austere Technology Solutions

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

    Best Software Security Services | Austere Technology Solutions

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

    Dot Net Training in Chennai

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

    Selenium Training in Chennai

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

    ReplyDelete
  57. Your article gives lots of information to me. Thanks for sharing.
    acca course in hyderabad | ISFS

    ReplyDelete
  58. Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.
    Air Hostess Training in Chennai | Air Hostess Training Institute in Chennai | Air Hostess Academy in Chennai
    Air Hostess Courses in Chennai |Best Air Hostess Training Institute in Chennai | Cabin Crew Course in Chennai

    ReplyDelete
  59. 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
  60. Information from this blog is very useful for me, am very happy to read this blog Kindly visit us @ Christmas Gift boxes | Wallet Box

    ReplyDelete
  61. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
    iosh safety course in chennai

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

    ReplyDelete
  63. 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
  64. Nice post. I learned some new information. Thanks for sharing.

    Article submission sites
    Technology

    ReplyDelete
  65. 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
  66. 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
  67. Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles. I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here! Good luck for the next!
    mobile application development training online
    mobile app development course
    mobile application development course
    learn mobile application development
    mobile app development training
    app development training
    mobile application development training
    mobile app development course online
    online mobile application development

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

    Website Development Company in Delhi

    ReplyDelete
  69. 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
  70. 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
  71. 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
  72. 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
  73. In recent years, Ubisoft has somewhat modified the direction of development of a number of its franchises, that specialize inmassive open-world games. and also the different day, the top of Ubisoft, Yves Guillot, aforementioned that the corporate wasabout to continue within the same spirit, and explained why.

    You may read more on — Blockcrux
    If you recall the recently proclaimed and last free games from Ubisoft, you'll be able to simply notice a very importantsimilarity in them: Assassin’s Creed Odyssey, The Division two, so much Cry New Dawn, Ghost Recon Breakpoint, Watch Dogs Legion and even the cartoon Gods & Monsters – of these ar games with an oversized open world. Of course, this is often no accident.
    In a spoken communication with Games trade, the top of Ubisoft, Yves Guillot, explained that this was no accident: the corporate is deliberately increasing the dimensions of games, and it's not about to come back to a lot of chamber stories like Assassin’s Creed Unity. a lot of exactly, Ubisoft can tell similar stories, however not as separate games. consistent with Yves Guillot, why unharness a game for fifteen hours if you'll be able to unharness a bigger project for sixty hours, which canembrace identical 15-hour story?

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

    ReplyDelete

  75. 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
  76. Hello Admin!

    Thanks for the post. It was very interesting and meaningful. I really appreciate it! Keep updating stuffs like this. If you are looking for the Advertising Agency in Chennai | Printing in Chennai , Visit Inoventic Creative Agency Today..

    ReplyDelete
  77. 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
  78. 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
  79. 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
  80. Thanks for sharing this, I actually appreciate you taking the time to share with everybody.
    Data Science Training In Hyderabad

    ReplyDelete
  81. Thanks for sharing this, I actually appreciate you taking the time to share with everybody.
    Data Science Training In Hyderabad

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

    ReplyDelete
  83. 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
  84. best logo design companies
    Hey buddies, such a marvelous blog you have made I’m surprised to read such informative stuf

    ReplyDelete