• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
ASP.NET 4.5 webforms

ASP.NET 4.5 webforms



Describes latest changes on asp.net 4.5.

Describes latest changes on asp.net 4.5.



Total Views
Views on SlideShare
Embed Views



1 Embed 1

http://ebenezarjohnpaul.blogspot.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    ASP.NET 4.5 webforms ASP.NET 4.5 webforms Presentation Transcript

    • ASP.NET 4.5 Web FormsNew features Brij Bhushan Mishra MVP-ASP.NET/IIS http://brijbhushan.net @brij_bhushan
    •  Earlier Version’s Data Control Strongly typed data controls Model Binding ◦ Selecting data ◦ Filtering Data ◦ Custom value Provider ◦ Editing Data ◦ Validations ◦ Custom validation Support for HTML Encoding
    •  Data controls in earlier versions  Late bound Eval/Bind methods  Does not provide navigational support  Missing Compile time checking
    •  ASP.NET 4.5 introduces ItemType property with Data controls ◦ Now define the type of model to your data controls ◦ Item will be strongly coupled with model ◦ Provides intellisence support, compile time checking and navigational support as well ◦ There are two new typed variable introduced that is used in Data-binding expressions Item and BindItem. ◦ Item is used in one-way data-binding expressions while BindItem is used two way binding
    •  One way binding – Two way Binding
    •  Assign a property SelectMethod with the public method name written at code behind ◦ It should return IEnumerable or IQueryable object
    •  Automatically binds the data to the control No need to assign the DataSource property and no need to call DataBind method Automatically supports Paging and sorting ◦ Handled by the SQL server with the help underlying LINQ provider
    •  Can have filtering parameters in Select Method Parameters fetch value from the given Value providers. Some value providers are ◦ Query string ◦ Session ◦ Cookies ◦ Controls ◦ Form Values etc We can write custom Value Providers as well.
    •  Create your own value provider by implementing IValueProvider interface ◦ GetValue method should return an object of type ValueProviderResult which should contain the value
    •  Create your own custom attribute by Implementing ValueProviderSourceAttribute Override GetValueProvider which should return the instance of CustomValueProvider
    •  Data controls provide the following Properties to support this feature ◦ InsertMethod ◦ UpdateMethod ◦ DeleteMethod
    •  Model Binding supports Validation with the help of Data Annotations from System.ComponentModel.DataAnnotations namespace
    •  If your control is model bound on the Type these validation rules are fired Page object has a new ModelState property ◦ ModelState.IsValid returns true if there is no validation errors ◦ Provide list of all errors
    •  ASP.NET introduced new Property ‘ShowModelStateErrors’ in ValidationSummary control. Display all the model validation errors
    •  Can write your custom validation attribute by implement ValidationAttribute Override IsValid method write the validation logic in it.
    •  ASP.NET 4.5 provides support to encode the data in data binding expressions. Add a colon (:) to the end of the <%# prefix that marks the data-binding expression