Using jQuery Selectors
tag name, ID, and class. They can be used either on their own or in combination with other selectors.
Three building blocks of selectors are
Selecting HTML elements with tag name.
The following example demonstrates how to select all div elements and assign a text value into it within an HTML page.
syntax:
$(element name) : which returns all matched html elements.
$('element name').text('text to display'); : which assign the text value into all matched element.
Eg:
Add following in html head
<script type="text/javascript">
$(
}
function DisplayAll() {"div").text("Welcome to my first jQuery application.");</script>
Add following in html body
<input id="Button1" type="button" value="Display Text onclick="DisplayAll()" /><div></div><hr />
<div></div><hr /><div></div><hr /><div></div><hr />
Tuesday, September 14, 2010
Introduction to jQuery & What jQuery does
Introduction to jQuery
jQuery is a library of JavaScript Functions, ie; a group of built-in javascript function to improve the interaction with web development.
Using jQuery you can do the following:
jQuery is a library of JavaScript Functions, ie; a group of built-in javascript function to improve the interaction with web development.
Using jQuery you can do the following:
- Simplify common JavaScript tasks
- Access HTML elements in a document
- HTML element manipulation
- Modify the appearance of a web page
- Manipulate CSS properties
- Alter the content of a document
- Respond to a user's interaction
- Animate changes being made to a document.
- Retrieve information from a server without refreshing a page ( AJAX).
- Link to download jQuery Libraray : http://docs.jquery.com/Downloading_jQuery
Thursday, September 9, 2010
First MVC 2 Application with Visual Studio 2010
Creating your First MVC Application with Visual Studio 2010
Eg: Follow the following steps.
The above application just returns a string value. We dont have any view. The browser will display only a string.
Eg: Follow the following steps.
- Create an empty MVC 2 web application.
- Add a controller named HomeController and write the following method.
public string Index() { return "My first MVC Application"; }
- Run the application.
The above application just returns a string value. We dont have any view. The browser will display only a string.
ASP.NET MVC Folder Conventions
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.
• 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.
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 >
Subscribe to:
Posts (Atom)