Wednesday, December 29, 2010

"CompilationMode" attribute in Page

Asp.net website allow developer to configure whether page is compile or not.in page directive
<%@ Page Language="C#" CompilationMode="Never" %>
The attribute can have 3 possible values.
Always: This is default value the name is suggest that page is compile alway this is not good for  scalability of website.
Never : This name suggest the page is never compile means It will also prevent compilation to an assembly,If a page contains a script block or code construct that requires compilation, ASP.NET will return with an error and the page will not run.
Auto : value means that Asp.Net will only compile the page if required.
set this attribute in your wesite The main benefit is scalability.  In large web sites, this can avoid the need to compile high number of pages into assemblies.  Instead of compiling, these "no-compile" pages are processed by it's corresponding control builder which is preserved in memory for the life of the application.
if you want to apply this to an already existing web application it’s much easier to set the CompilationMode to Auto in the web.config depending on the size of the web application.
<system.web>
<pages compilationMode="Auto">
</pages>
</system.web> 

Hope it will help you,Thank You for your time to reading,

Kirti M. Darji

Saturday, December 25, 2010

Permanent Redirect is new feature ASP.NET 4.0

This blog I will show you permanent redirection new feature in asp.net 4.0.first we consider why we need permanent redirection of page. the scenario is create on case when you application have two page like product and product detail page in your site,when you go from product page to product detail page using Response .Redirect option,In versions prior to ASP.NET 4.0 that case extra round trip to server first it goes to product page extra round trip (using 302 found) then it goes to product detail page,
overcome this extra round trip issue ASP.NET 4.0 introduce RedirectPermanent() helper method which avoids a round trip and is a permanent redirect (HTTP 301)

Use it as shown below:
Response.RedirectPermanent("ProductDetail.aspx");

you can also see video here know more about PermamentRedirect

I hope it will help you guys,Happy codding.
Thank You

Kirti M.Darji

Monday, December 6, 2010

New feature in silverlite 5 beta

Hello Guys...

silverlite firestarter event announced nex release of silverlite 5, it's beta will release be available on first half of next year and  the finale release will ship in second half of 2011.
following are new features in silverlite 5.


Premium media experiences (improve media support and rich UI capabilities)
hardware decode and presentation of H264 improve performance for lower-power devices to render high-defination using  video GUI support.
Digital rights management advancements allow seamless switching between DRM media sources.
Improved power awareness prevents the screen saver from being shown while watching video and allows the computer to sleep when video is not active.
Business Application Development


Text improvements make it possible to build rich magazine-style text layouts:

  • Multicolumn text and linked text container allow text to flow around other elements.
  • Text clarity is improved with Pixel Snapping.
  • Text layout performance is significantly improved.
  • OpenType support has been enhanced.
Model View ViewModel (MVVM) and Databinding enhancements allow more work to be done more easily via XAML
  • Debugging support now allows breakpoints to be set on a binding, so you can step through binding failures.
  • Implicit DataTemplates allow templates to be created across an application to support a particular type by default.
  • Binding in style setters allows bindings to be used within styles to reference other properties.
  • The DataContextChanged event is being introduced.
  • Markup extensions allow code to be run at XAML parse time for both properties and event handlers, enabling cutting-edge MVVM support.

Silverlight 5 performance improvements include:

  • Reduced network latency by using a background thread for networking.
  • XAML parser improvements that speed up startup and runtime performance.
Graphics improvements:
  • Graphics Processing Unit (GPU) accelerated 3-D application programming interface (API) provides rich graphics on the Web for building advanced data visualizations and rich user experience (UI).
  • Immediate mode graphics API allows direct rendering to the GPU.


References
http://www.microsoft.com/silverlight/future/

Hope it will help you.
Thank You,
Kirti M.Darji

Sunday, December 5, 2010

What is MVC architecture and it's advantages

MVC is Software design pattern use in software engineering, Intension of MVC architecture is provide a flexibility and improve performance of application by separating it in three different layers.
(M) Model 
(V)View 
(C)controller.

Model:

It is use to manage the data and behavior of application by respond to request of application. Information like (Domain information Model or Application information model) the model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that Govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser. The model by itself has no visual representation It includes the validation rules, It does not know how to display the information it contains. As MVC architecture the model information can be divided into two categories
Domain information Model
Domain information model includes that information concerned with the 
problem domain for Example if we have railway reservation system so train schedules, prices, Seating arrangement and credit card numbers would domain information.
Application information Model
Application information model is any information that is used by the application but is not part of the problem domain. If Railway reservation is example then error messages is part of application domains. In the information model         change view should automatically change.
Controller:
Whenever the user sends a request for something then it always go through    the controller. The controller is responsible for intercepting the requests from  view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller
is responsible for directing the appropriate view to the user. In  GUIs, the views and the controllers often work very closely together.
After the action has been taken on the data, the controller is responsible for    directing the appropriate view to the user.
View:
The view provides a visual representation of the information contained in the model, it’s represents the presentation of the application. The view object       refers to the model. It uses the query methods of the model to obtain the       contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view's to maintain the     consistency in its presentation when the model changes.
A view depends on the information contained within its model. Examples of views are input fields, text editors, and even entire windows.  
The views know of the model and will interact with the model. View to model  communication and Model and controller to communicate with view via events.
Example,    if a button is clicked an action message might be sent to a model object in order to get something done.         
 
 Advantages of MVC Architecture:
1. Reusable: 
When the problem recurs, there is no need to invent a new solution; we just have to follow the pattern and adapt it as necessary.
2. Expressive: 
By using the MVC design pattern our application becomes more expressive.
3. Easier support for new types of clients: 
To support a new type of client, you simply write a view and controller for  itand wire them into the existing enterprise model. 
So, that all about MVC , hope it may help you lot!!!
Happy Coding with MVC!!
Thank You
Kirti M Darji