Sunday, 17 May 2015

Advantages of Asp.net MVC :



1.Provides clean separation of concerns(SOC).

2.Enables the full control over the rendered HTML.

3.Enables TEST DRIVEN DEVELOPMENT(TDD).

4.Easy Integration with javascript framework.

5.Following the design of stateless nature of the web.

6.RESTFULL urls that enables SEO.

7.No ViewState and postBack events.

Friday, 15 May 2015

Remove extra spaces at the end of column in sql server




Similarly we can remove the Line Feed and Carriage return. We assume that tab,
line feed and carriage returns are not acceptable characters anywhere in a string.
So we can finally create our whitespace removal function as:


CREATE FUNCTION DBO.TRIM(@STR NVARCHAR(MAX))

RETURNS NVARCHAR(MAX)

BEGIN

declare @TAB nvarchar(2), @LF nvarchar(2), @CR nvarchar(2),@NL varchar(2)

set @TAB = char(9)

set @LF = char(10)

set @CR = char(13)

set @NL = char(13)+char(10)

return replace(replace(replace(replace(LTRIM(RTRIM(@STR)), @TAB, “), @NL, “), @LF, “), @CR, “)

END

Thursday, 14 May 2015

Sub-Types of ActionResult in Asp.mvc4


ActionResult is an abstract class that can have several sub types.
 (or )
ActionResult is a general type that can have several subtypes .

ActionResult SubTypes :

1.ViewResult : Renders a specified    view to the response stream.

2.PartialViewResult : Renders a   Specified partial view to the   response stream.

3.EmptyResult : An empty Response is   returned.

4. RedirectResult : Performs an HTTP   redirection to a specified URL.

5.RedirectToRouteResult : Performs   an HTTP redirction to a URL that    is determined by the routing                                                   engine,based on given route data.

6.JsonResult : Serializes a given   ViewData object to JSON format.

8.JavascriptResult : Returns a piece  of javascript code that can be   executed on the Client

9.ContentResult : Writes content to   the response stream without    requrining a view .

10.FileContentResult : Returns a  File to the Client.

11.FileStreamResult : Returns a file to the client,which is provided by a stream.

12.FilePathResult : Returns a file to the Client.