ASP.NET

1. ASP.NET Introduction 2. Comp of .Net Framework 3.5 3. Sys.Req for VS 2008 4. ASP.NET Envrmnt Setup 5. VS2010 Ultimate Sys.Req 6. Installing VS 2010 7. VS 2012 Sys.Req 8. Installing VS Exp 2012 9. Start the VS 2008 10. Application Life Cycle 11. Page Life Cycle 12. Page Life Cycle Events 13. ASP.NET Example 14. Event Handling 15. Default Events 16. Server Side 17. Request Object 18. Response Object 19. Server Controls 20. Server Controls Properties 21. Server Controls Methods 22. HTML Server Controls 23. Client Side 24. ASP.NET Basic Controls 25. TextBox Control 26. CheckBox Controls 27. RadioButton Controls 28. ListBox Control 29. HyperLink Control 30. Image Control 31. BulletedList Control 32. ASP.NET Directives 33. Implements Directive 34. Master Type Directive 35. Page Directive 36. PreviousPage Type 37. Managing State 38. Control State 39. Cookies 40. Query Strings 41. Server-Side State 42. Session State 43. Validation Controls 44. Required FieldValidator 45. Range Validator 46. Compare Validator 47. RegularExpressionValidator 48. Custom Validator 49. Validation Summary 50. Data Source Control 51. AdRotator Control 52. Calendar Control 53. Calendar Control Example 54. Panel Control 55. Panel Control Example 56. Multi Views Control 57. MultiView & View controls 58. MultiView Control Example 59. FileUpload Control 60. FileUpload Control Eg 61. AJAX Control 62. UpdatePanel control 63. UpdateProgress Control 64. Custom Controls 65. Custom Control Eg 66. Personalization 67. Create Simple Profile 68. ADO.NET 69. ADO.NET Objects 70. DataTable 71. DataRow 72. DataColumn 73. Object Example 74. Error Handling 75. Tracing Errors 76. Debugger 77. Security 78. Authentication 79. Authorization 80. LINQ 81. LINQ Query Operators 82. LINQ Example 83. Caching 84. Data Caching 85. Output Caching 86. Object Caching 87. Web Services 88. Create Web Services Eg 89. Web & Machine.config 90. Settings Schema 91. ASP.NET Deployment 92. XCopy Deployment 93. Web Setup Project 94. ASP Interview Part 1 95. ASP Interview Part 2 96. ASP Interview Part 3 97. ASP Interview Part 4 98. ASP Interview Part 5 99. ASP Interview Part 6
Pr.Pg Next Pg

ASP.NET- Web.config and Machine.config tutorials

  • .NET configuration files are well-formed XML files whose vocabulary is understood by the . NET runtime.

  • The .NET runtime reads these configuration files into memory as necessary to set the various .NET run-time parameters, and these parameters are cumulative.

  • For example, web.config is loaded when ASP.NET applications are started, but the first configuration file the server examines is machine.config.

 

Machine.Config

  • Machine.config sets the default .NET application behaviors for the entire computer.

  • The default .NET configuration for your computer is declared in a file named machine.config. You can find machine.config in the directory C:\Windows\Microsoft.NET\Framework\vxxxxx\Config (where xxxxx is the .NET version; the current release at the time of this writing is 4.5 and the directory name of the beta version at the time of this writing is v4.5.21006).

  • Recent .NET versions have improved the machine.config arrangement. Versions 1.x of .NET lumped all of machine.config into a single file—even comments and configuration information for systems not in use on the specific computer With version 2.0, machine.config was trimmed down substantially.

  • The comments were moved to a separate file named machine.config.comments, and separate browser definition capability files were moved to separate configuration files. This is important to know because the machine.config comments are sometimes more useful as documentation for configuring .NET than the regular online documentation is. As you configure various ASP.NET applications, the machine.config comments should be the first place you look for information. Version 4.0 of the machine.config file is only a little bit larger than its 3.0 predecessor.

 

Configuration Section Handlers:

  • At the top of machine.config you can see a number of configuration section handlers. Each handler understands a specific vocabulary for configuring .NET. Whereas machine.config controls the settings for the entire computer, ASP.NET applications rely on files named web.config to manage configuration. You see much more about web.config shortly.

  • However, for now here is an example of what you might find in a File for a specific application:

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<system.web>

<authentication mode="Forms" />

<sessionState mode="SQLServer" cookieless="UseUri" timeout="25" />

</system.web>

</configuration>

 

  • This small segment tells the ASP.NET runtime to use Forms Authentication to authenticate users of this site. The configuration information also tells ASP.NET to use SQL Server to manage session state, to allow session state information to expire after 25 minutes, and to track session information using a session ID embedded in the request Uniform Resource Identifier (URI).

  • You can see from the above example, that configuring ASP.NET relies on the ability of the runtime to understand some keywords. In this case, the keywords authentication mode and Forms tell ASP.NET how to manage authentication

  • ASP.NET must correctly interpret sessionMode, SQLServer, cookieless, UseURI, and timeout to know how to manage an application’s session state.

  • The .NET components that understand these vocabularies are listednnear the top of machine.config.

<configuration>

<configSections>

<section name="appSettings"

type="{entire strong assembly name here...}"

restartOnExternalChanges="false" />

<section name="connectionStrings"

type="{entire strong assembly name here...}" />

...

<sectionGroup name="system.web"

type="{entire strong assembly name here...}">

<section name="authentication"

type="{entire strong assembly name here...}"

allowDefinition="MachineToApplication" />

<section name="sessionState"

type="{entire strong assembly name here...}"

allowDefinition="MachineToApplication" />

...

</sectionGroup>

</configSections>

</configuration>

 

Web.Config

  • Microsoft Visual Studio 2010 introduces a new feature: separate configurations for debug and release versions of your application. Earlier versions of Visual Studio provided only a single web.config file, and the debug and release versions of the application shared the same settings.

  • In Visual Studio 2010, when you generate a Web application, Visual Studio provides three configuration files: web.config, web.debug.config, and web.release.config. Settings shared by the debug and release versions go in web.config. Settings specific to the debug or release version (such as the Trace setting) go in the respective web.config files.

  • To override the default settings, you simply need to include a file named web.config in the application’s virtual directory.

  • For example, the following code sets up the Web application to which it applies. The configuration file turns on Forms Authentication and tracing, for example.

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<system.web>

<authentication mode="Forms" />

<trace enable=true/>

</system.web>

</configuration>

  • An application can run without a Web.config file, you cannot debug an application without a Web.config file.

 

The Connection Strings

  • The Connection strings show the availability of the database connection strings to the website.

  • For example, the below example shows the connection beween web pages and the Employee Database:

 

<connectionStrings>

<add name=”EmployeesConnectionString”

connectionString=”Provider=Microsoft.Jet.OLEDB.4.0;

Data Source= C:\ \ databinding\ App_Data\ Employees.mdb

ProviderName=”System.Data.OleDb” /><

</connectionStrings>

 

Pr.Pg border                                              Next Pg