Saturday, May 10, 2008

Helpful Points

1. Master Pages are not available in ASP.NET 1.1
2. Datareader can be provided as datasource for GridView in web applications only, but paging and sorting will be difficult. Also data cannot be updated.
3. In ADO.net for Command Object you have 3 methods
a.ExecuteReader - Select statements
b.ExecuteNonQuery - DML statements(Insert,Update and Delete)
c.ExecuteScalar - Returns a single value from Aggragate functions like SUM,AVG,COUNT etc
4. machine.config settings are applicable to all the applications running on that server, web.config settings are applicable to only that application
5. An application can havemore than 1 web.config file, but they should be in different directories of that web application also the sub directory that uses it must be a virtual directory.
6. One website can have 20 cookies with 4kb per cookie.
7. To Maintain viewstate of Dynamic controls, bind them in Init event. because if done in Page Load, it would have already set default values.
8. There are three types of JIT compilers
a. Pre: This JIT compiles the whole application
b. Econo: This compiles the modules called at RunTime
c. Normal: This compiles modules called at runtime and keep it in cache
9. Caching is the technique of persisting data in memory for immediate access to requesting program calls.
10. This is considered as the best way to increase performance of the application
11. Caching is of 3 Types
a. Output Caching : Caches the whole page.
b. Fragment Caching : Caches only a part of the page.
c. Data Caching: Caches the data.

12. Authntication is giving access to the site
13. Authorization is giving access to perform some operations in site
14. Request.ServerVariables["SERVER_SOFTWARE"] gives which version of IIS application is using.
15. Permanent cookie can be created from following code
HTTPCookie c = new HTTPCookie ("MyCookie", "MyText");
c.Expires = DateTime.MaxValue;
Respon.Cookies.Add(c);
16. In ADO.NET data is sent in XML format hence easily sent across firewalls whereas in other languages data is sent in binary format which firewall poses problems
17. When AutoEventWireup is true ASP.NEt need not require events to specify event handlers like Page_Init, Page_Load. Means handles keyword not required in VB.
In the case where AutoEventWireup attribute is set to false (by default), event handlers are automatically required for Page_Load or Page_Init. However, when we set the value of the AutoEventWireup attribute to true, the ASP.NET runtime does not require events to specify event handlers like Page_Load or Page_Init.
18. ASP.NET application can be run without WEB.CONFIG since all the settings required for an ASP.NE application is available in MACHINE.CONFIG
19. WEB.CONFIG if present for any application overrides settings in MACHINE.CONFIG for that application.
20. Garbage Collector is mainly used for Automatic Memory Management. Monitor leaked or unused memory objects that are loaded into memory. Garbage Collector releases memory objects. Cannot say when this runs. but can be called programmatically
system.gc.collect(); but not recommended
21. Reflection is used for Late Binding of Objects in .NET. By using reflection one can use COM components and create objects of them at Runtime. It invokes properties and objects of that COM.
22. DataSet.Clone() creates new instance of same object.
23. DataSet.Copy() Copies content of data to another object without creating new instance
24. Web parts allows the user to customize how site looks. Present only in 2.0
25. Web Services used SOAP and HTTp protocols. message is first converted to XML and serializes and sent through HTTP protocol to the server. In Server again it deserializes and from XML file it gets info it wanted. As message is sent as XML it is platform independant.
Remoting allows us to enjoy the same power of web services when the platform is same. We can connect directly to server over TCP and send binary data without having to do lots of conversation.
26.


ASP.NET Web Services

.NET Remoting

Protocol

Can be accessed only over HTTP

Can be accessed over any protocol (including TCP, HTTP, SMTP and so on)

State Management

Web services work in a stateless environment

Provide support for both stateful and stateless environments through Singleton and SingleCall objects

Type System

Web services support only the datatypes defined in the XSD type system, limiting the number of objects that can be serialized.

Using binary communication, .NET Remoting can provide support for rich type system

Interoperability

Web services support interoperability across platforms, and are ideal for heterogeneous environments.

.NET remoting requires the client be built using .NET, enforcing homogenous environment.

Reliability

Highly reliable due to the fact that Web services are always hosted in IIS

Can also take advantage of IIS for fault isolation. If IIS is not used, application needs to provide plumbing for ensuring the reliability of the application.

Extensibility

Provides extensibility by allowing us to intercept the SOAP messages during the serialization and deserialization stages.

Very extensible by allowing us to customize the different components of the .NET remoting framework.

Ease-of-Programming

Easy-to-create and deploy.

Complex to program.

No comments: