ASP.NET MVC Folder Conventions
• App_Data : Contains database files. For example, the App_Data folder might contain a local instance of a SQL Server Express database.
• Content : Contains static content such as images and Cascading Style Sheet files.
• Controllers : Contains ASP.NET MVC controller classes.
• Models : Contains ASP.NET MVC model classes.
• Scripts : Contains JavaScript files including the ASP.NET AJAX Library and jQuery.
• Views : Contains ASP.NET MVC views.
Thursday, September 9, 2010
Introduction to MVC 2 with Visual Studio 2010
Microsoft MVC 2 in Visual Studio 2010
The Microsoft ASP.NET MVC framework is Microsoft’s newest framework for building web applications. The ASP.NET MVC framework was created to support pattern-based software development. In other words, the framework was designed to make it easier to implement software design principles and patterns when building web applications.
An MVC application, a Model View Controller application, is divided into the following three parts:
• Model: An MVC model contains all of an application’s logic. The model includes all of an application’s validation logic, business logic, and data access logic.
• View: An MVC view contains HTML markup and view logic.
• Controller: An MVC controller contains control-flow logic. An MVC controller interacts with MVC models and views to control the flow of application execution. which handle incoming requests, perform operations on the domain model, and choose a view to render back to the user
The Microsoft ASP.NET MVC framework is Microsoft’s newest framework for building web applications. The ASP.NET MVC framework was created to support pattern-based software development. In other words, the framework was designed to make it easier to implement software design principles and patterns when building web applications.
An MVC application, a Model View Controller application, is divided into the following three parts:
• Model: An MVC model contains all of an application’s logic. The model includes all of an application’s validation logic, business logic, and data access logic.
• View: An MVC view contains HTML markup and view logic.
• Controller: An MVC controller contains control-flow logic. An MVC controller interacts with MVC models and views to control the flow of application execution. which handle incoming requests, perform operations on the domain model, and choose a view to render back to the user
Tuesday, September 7, 2010
Adding a VideoBrush in Silverlight
Using a VideoBrush in Silverlight Application
VideoBrush elements are very similar to the ImageBrush. Instead of an image, they define a video MediaElement that is applied as a brush. You can apply them to the properties of Silverlight controls the same way that the ImageBrush is applied.
To apply a VideoBrush to a Silverlight control, you need to define the VideoBrush element just as you do with an ImageBrush. However, different from an ImageBrush, you need to set a SourceName property that points to the x:Name of the MediaElement. Therefore, you also need to define a MediaElement separate from the Silverlight control. If you do not want the video to be displayed outside of the Silverlight control, set the Opacity property of the MediaElement to 0.
Eg:
< MediaElement Source="first.wmv"
x:Name="movie"
Opacity="0"/ >
< TextBox Height="100" Width="150" >
< TextBox.Background >
< VideoBrush SourceName="movie" Stretch="UniformToFill"/ >
< /TextBox.Background >
< /TextBox >
VideoBrush elements are very similar to the ImageBrush. Instead of an image, they define a video MediaElement that is applied as a brush. You can apply them to the properties of Silverlight controls the same way that the ImageBrush is applied.
To apply a VideoBrush to a Silverlight control, you need to define the VideoBrush element just as you do with an ImageBrush. However, different from an ImageBrush, you need to set a SourceName property that points to the x:Name of the MediaElement. Therefore, you also need to define a MediaElement separate from the Silverlight control. If you do not want the video to be displayed outside of the Silverlight control, set the Opacity property of the MediaElement to 0.
Eg:
< MediaElement Source="first.wmv"
x:Name="movie"
Opacity="0"/ >
< TextBox Height="100" Width="150" >
< TextBox.Background >
< VideoBrush SourceName="movie" Stretch="UniformToFill"/ >
< /TextBox.Background >
< /TextBox >
Adding an ImageBrush in Silverlight
Using an ImageBrush in Silverlight Application
ImageBrush elements are similar to the SolidColorBrush. Instead of a solid color, they define an image that is applied as a brush. You can apply them to the properties of Silverlight controls the same way that the SolidColorBrush is applied.
To apply an ImageBrush to a Silverlight control, you need to define the ImageBrush element and set the ImageSource property to an image that has been added to the project. You will likely want to set the Stretch property so that the image appears appropriately in the control.
Eg:
< TextBox Height="200" Width="150" >
< TextBox.Background >
< ImageBrush ImageSource="jobin.jpg"/ >
< /TextBox.Background >
< /TextBox >
ImageBrush elements are similar to the SolidColorBrush. Instead of a solid color, they define an image that is applied as a brush. You can apply them to the properties of Silverlight controls the same way that the SolidColorBrush is applied.
To apply an ImageBrush to a Silverlight control, you need to define the ImageBrush element and set the ImageSource property to an image that has been added to the project. You will likely want to set the Stretch property so that the image appears appropriately in the control.
Eg:
< TextBox Height="200" Width="150" >
< TextBox.Background >
< ImageBrush ImageSource="jobin.jpg"/ >
< /TextBox.Background >
< /TextBox >
Monday, August 30, 2010
Computed Columns
Computed columns in Microsoft SQL Server:
A computed column is based on an expression defined when you create or alter the table, and is not physically stored in the table unless you use the PERSISTED keyword.
A computed column is one defined to be an expression that is executed whenever the column is retrieved. If we use the PERSISTED keyword the expression is being executed while we insert or modify a row.
Syntax:
column_name AS computed_column_expression [ PERSISTED ]
Eg: Non-persisted computed column
CREATE TABLE Student
(
RollNo INT IDENTITY PRIMARY KEY,
Name VARCHAR(25),
Mark1 INT,
Mark2 INT,
Total AS Mark1+Mark2
)
Eg: Persisted computed column
CREATE TABLE Student
(
RollNo INT IDENTITY PRIMARY KEY,
Name VARCHAR(25),
Mark1 INT,
Mark2 INT,
Total AS Mark1+Mark2 PERSISTED
)
A computed column is based on an expression defined when you create or alter the table, and is not physically stored in the table unless you use the PERSISTED keyword.
A computed column is one defined to be an expression that is executed whenever the column is retrieved. If we use the PERSISTED keyword the expression is being executed while we insert or modify a row.
Syntax:
column_name AS computed_column_expression [ PERSISTED ]
Eg: Non-persisted computed column
CREATE TABLE Student
(
RollNo INT IDENTITY PRIMARY KEY,
Name VARCHAR(25),
Mark1 INT,
Mark2 INT,
Total AS Mark1+Mark2
)
Eg: Persisted computed column
CREATE TABLE Student
(
RollNo INT IDENTITY PRIMARY KEY,
Name VARCHAR(25),
Mark1 INT,
Mark2 INT,
Total AS Mark1+Mark2 PERSISTED
)
Thursday, August 26, 2010
Using RadialGradientBrush in Silverlight
Adding a RadialGradientBrush
RadialGradientBrush elements are very similar to the LinearGradientBrush. They define a radial gradient that flows between two or more colors. You can apply them to the properties of Silverlight controls the same way that the LinearGradientBrush is applied.
To apply a RadialGradientBrush to a Silverlight control, you need to define the Radial- GradientBrush element. You can define the center of the gradient radius using the GradientOrigin property. The GradientOrigin is set on a 0 to 1 coordinate system separated by a comma.
You can also define the radius of the gradient in the X and Y planes using the RadiusX and RadiusY properties. These properties are set on a scale where 1 is the Height or Width of the Silverlight control.
Then you also need to define two or more GradientStop elements inside the Radial- GradientBrush. Each GradientStop element needs the Color property set. You can also define the offset between 0 and 1 where that color is set using the Offset property. Silverlight applies the gradient on a radius centered at the GradientOrigin and defined by the RadiusX and RadiusY properties matching the colors at each GradientStop along the way.
Eg:
< Rectangle Height="200" Width="200" >
< Rectangle.Fill >
< RadialGradientBrush >
< GradientStop Color="Blue" />
< GradientStop Color="White" Offset=".5" / >
< GradientStop Color="Blue" Offset=".9"/ >
< /RadialGradientBrush >
< /Rectangle.Fill >
< /Rectangle >
Eg:
< Rectangle Height="200" Width="200" >
< Rectangle.Fill >
< RadialGradientBrush GradientOrigin="0,0" >
< GradientStop Color="Blue"/ >
< GradientStop Color="White" Offset=".5"/ >
< GradientStop Color="Blue" Offset=".9"/ >
< /RadialGradientBrush >
< /Rectangle.Fill >
< /Rectangle >
Eg:
< Rectangle Height="200" Width="200" >
< Rectangle.Fill >
< RadialGradientBrush GradientOrigin=".5,.5" RadiusX=".6" RadiusY=".2" >
< GradientStop Color="Blue"/ >
< GradientStop Color="White" Offset=".5"/ >
< GradientStop Color="Blue" Offset=".9"/ >
< /RadialGradientBrush >
< /Rectangle.Fill >
< /Rectangle >
RadialGradientBrush elements are very similar to the LinearGradientBrush. They define a radial gradient that flows between two or more colors. You can apply them to the properties of Silverlight controls the same way that the LinearGradientBrush is applied.
To apply a RadialGradientBrush to a Silverlight control, you need to define the Radial- GradientBrush element. You can define the center of the gradient radius using the GradientOrigin property. The GradientOrigin is set on a 0 to 1 coordinate system separated by a comma.
You can also define the radius of the gradient in the X and Y planes using the RadiusX and RadiusY properties. These properties are set on a scale where 1 is the Height or Width of the Silverlight control.
Then you also need to define two or more GradientStop elements inside the Radial- GradientBrush. Each GradientStop element needs the Color property set. You can also define the offset between 0 and 1 where that color is set using the Offset property. Silverlight applies the gradient on a radius centered at the GradientOrigin and defined by the RadiusX and RadiusY properties matching the colors at each GradientStop along the way.
Eg:
< Rectangle Height="200" Width="200" >
< Rectangle.Fill >
< RadialGradientBrush >
< GradientStop Color="Blue" />
< GradientStop Color="White" Offset=".5" / >
< GradientStop Color="Blue" Offset=".9"/ >
< /RadialGradientBrush >
< /Rectangle.Fill >
< /Rectangle >
Eg:
< Rectangle Height="200" Width="200" >
< Rectangle.Fill >
< RadialGradientBrush GradientOrigin="0,0" >
< GradientStop Color="Blue"/ >
< GradientStop Color="White" Offset=".5"/ >
< GradientStop Color="Blue" Offset=".9"/ >
< /RadialGradientBrush >
< /Rectangle.Fill >
< /Rectangle >
Eg:
< Rectangle Height="200" Width="200" >
< Rectangle.Fill >
< RadialGradientBrush GradientOrigin=".5,.5" RadiusX=".6" RadiusY=".2" >
< GradientStop Color="Blue"/ >
< GradientStop Color="White" Offset=".5"/ >
< GradientStop Color="Blue" Offset=".9"/ >
< /RadialGradientBrush >
< /Rectangle.Fill >
< /Rectangle >
Subscribe to:
Posts (Atom)