Archive for August, 2008
ASP.NET Dynamic Data Inline Editing
Introduction
This post explains how to edit the data inline in grid view control. I explained the overview on ASP.NET Dynamic Data and creating a simple Dynamic Data Web site using Scaffolding.
How to edit the inline data in Grid view
1. Open the Dynamic Data Web site that you have created in Dynamic Data Web site using Scaffolding.
2. Open the Global.asax file it looks like
The Default route will look like above highlighted area. It took the table as database table name and action is one of List,Details,Edit or Insert. Comment the default route which shown above in the screen shot.
3. There are some routing statements put in the comments below the default route, we have to un comment the section.
From the above new routing statement observe that instead action it is having ListDetails page for Action List and Details. So Same page is using for listing the results and editing the data.
4. You can find the ListDetails.aspx page under PageTemplates in the Dynamic Data Web Site.
5. When execute the project we will see the following screen which is ready for inline editing when you are updating the record.
Related Posts:
2 commentsWeb slices and Accelerators in IE 8 Beta2
Introduction
The new version of Internet explorer IE 8 Beta2 providing some cool features like Web slices, Accelerators, Ajax Navigation and Developer tools. More you can find at IE 8 Beta 2 features for Developers.
Web slices in IE 8
In order to have your favorite sites up to date on your favorites is really time consuming. IE 8 brings you web slices through which you can keep your favorite web sites up to date.
It tracks the web site that you added to the web slices. A flash will appear when ever a update is in the site.
Subscribing to the available web slices in the web site is as simple as adding the sites to the favorites.
Accelerators in IE 8
using Accelerators you can gain access to your favorite online services like searching,shopping and emailing in a click.
You can search,map,email or translate , share content from any web page that you are currently viewing by just one click. Accelerators are being added to the IE gallery to enhance the user browser experience.
Select the content on the web page that you are browsing and right click on it Accelerator icon will appear as shown above with a set of options like email,map and Blog the text just by a click.
Adding Accelerators to your browser
You can add more accelerators to the browser by clicking on the Accelerator icon on the web page then find more accelerators the say add it will added to your favorite accelerators.
Related Posts:
2 commentsInternet Explorer 8 Beta 2 Features for Developers with examples
Introduction
IE 8 Beta 2 provided the decent features to the designers and developers community. If you write the code for IE 8 Beta 2 that can run on anywhere.
It means it is allowing developers and designers to develop applications with Interoperability and web standards.
- CSS 2.1 complainer.
- HTML 5.0 standards supported.
- Ajax navigation and enhancements supported.
- Implementing DOM storage for HTML 5.0
- IE 8 is different from IE 7 in AJAX enhancements and Navigations
Enables the in place navigation when you are browsing maps for a particular location you may use the zoom option in the maps. Each and every zoom action will be stored in the travel history which is highlighted in oval.
2. DOM Storage in Connectivity events
When you are writing BLOG post or checking an e-mail a
t airport if suddenly connections drops then it prompts you to save the typed data on offline. Prompt is highlighted in the oval.
It also allows you cross domain communication and messaging using HTML standards.
3. More Server Connections for better performance. currently allowing 6 earlier it is 2.
4. Document mode Compatibility- No need to write any code for to render the content which is developed in earlier versions of the Internet Explorer. By placing a simple meta tag instructs the IE 8 to render the earlier browser versions content in right format. So IE8 providing full document compatibility mode.
If at all the content not rendered properly in IE8 beta it suggest through compatibility button in address bar to best view version.
5. IE Developer tools- allows the developer to debug the java script and in place HTML and CSS changes. (Shift + F12 ) is the keyboard short cut for opening the debugger tool.
The developer tool looks like
You can view the page in different IE versions using the above tool. we can call this feature as site preview.
5. Profiling the web sites-
we can check application performance and bottle necks using above built in profiler.
6. Extending the service integration through web slices and Accelerators.
Implementing the web slices and Accelerators is easy.
You can download the Internet explorer 8 beta 2 for exploring the features.
Related Posts:
2 commentsValidating XML Document Using XSD in C#.NET
Introduction
This post explains how to apply XML Schema Definition Language(XSD) to Extensible Markup Language (XML) document. Basics of XSD.
Create an XML Document
- Start Visual Studio .NET
- Create a new XML File.
- Add the following data to the XML Document
<Employee EmployeeID="123"> <EmployeeName>James Bond</EmployeeName> </Employee>
4. Save the file as Employee.xml file
Create the XSD Schema, and Link to XML Document
1. Start Visual Studio .NET
2. Create a new empty text file
3. Add the following XSD Schema definitions to describe the XML document.
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="EmployeeName" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="EmployeeID" use="required" type="xsd:int"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
4. Save the file as Employee.xsd
5. Open the original Employee.xml file, and link it to the XSD schema as follows
<?xml version="1.0"?>
<Employee EmployeeID="123"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Employee.xsd">
<EmployeeName>Rugby jersey</EmployeeName>
</Employee>
6. Save the modified xml as EmployeeWithXSD.xml.
Validate XML Document
1. Load the EmployeeWithXSD.xml using XmlTextReader as follows:
XmlTextReader r = new XmlTextReader("C:\\EmployeeWithXSD.xml");XmlValidatingReader v = new XmlValidatingReader(r);v.ValidationType = ValidationType.Schema;v.ValidationEventHandler += new ValidationEventHandler(MyValidationEventHandler);
while (v.Read())
{
// Can add code here to process the content.
}
v.Close();
// Check whether the document is valid or invalid.
if (isValid)
Console.WriteLine("Document is valid");
else
Console.WriteLine("Document is invalid");
public static void MyValidationEventHandler(object sender,
ValidationEventArgs args)
{
isValid = false;
Console.WriteLine("Validation event\n" + args.Message);
}
2. Build and run the application to use the XSD schema to validate the XML
document.
Related Posts:
4 commentsXML Schema Basics(XSD)
Introduction
This post gives a basic overview of XML Schema and how to use in development. XML schema describes what XML document contains and content of the XML document what fields and sub elements it can contain.
Standards for Describing XML Document
- DTD : was the First formulized standard.
- XDR: Much comprehensive standard than DTD.
- XSD: Currently de facto standard for describing the XML documents. There are two versions in use 1.0 and 1.1. An XSD schema it self is a XML document.
XSD Elements
Elements are building blocks for any XML document, element defines the structure of the XML document. The following is the syntax to define the element in XSD Schema.
Example:
<xs: element name=”abc” type=”xyz” />
- An Element must have the name property, the same will appear in the XML document.
- Type property describes about what can be contained in the element when it appears in XML document. eg: xs:string, xs:integer, xs:boolean or xs:date
Example:
Sample XSD
<xs:element name="Employee_dob"
type="xs:date"/>
Sample XML
<Employee_dob>
2000-01-12T12:13:14Z
</Employee_dob>
Fixed and Default Properties
The XSD element can contain the Fixed or Default properties.
Default means that if no value specified in the XML document then application uses the default value specified in the XSD document.
Example:
<xs:element name="Employee_name" type="xs:string" default="unknown"/>
Fixed means the value in the XML document can only have the value specified in the XSD.
Example:
<xs:element name="Customer_location" type="xs:string" fixed="UK"/>
Cardinality
Specifies how many times an element can appear can be called Cardinality. it is specified using the attributes minOccurs and maxOccurs. Both attributes can assigned a non-negative value.
The default value for minOccurs and maxOccurs is 1.
Example:
<xs:element name="Employee_hobbies"
type="xs:string"
minOccurs="2"
maxOccurs="10"/>
Employee_hobbies element must appear at least twice and not more than 10 times in the XML document.
Simple Types
We can define our own types by modifying the existing types.
example: Define a code, that may be an integer with a max limit.
<xs:element name="Employee" type="xs:string"/>
Complex Types: is a container for other elements which specifies child
elements an element can contain.
Example:
<xs:element name="Employee">
<xs:complexType>
<xs:sequence>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- Created a definition for element Employee
- <xs:complexType> is a container for other <xs:elements>
- Complex type do not have the type attribute and contains the <xs:sequence> element.
- The sequence element specifies that XML document must appear in the same order they are declared in the XSD Schema.
<Employee>
<Dob> 2000-01-12T12:13:14Z </Dob>
<Address> 39 spring field road London </Address>
</Employee>
Related Posts:
2 commentsVisual Studio 2008 SP1 Features
Introduction
Visual Studio 2008 service pack 1(SP1) and .NET Framework 3.5 SP1 offers the developers to develop rapid,responsiveness and stable applications. It allows the developers to develop applications that optimized for windows vista, SQL server, MS 2007 office system and the web.
Features Overview
- WPF Designers
- SQL Server 2008 support
- ADO.NET Entity Designer
- TFS enhancements
- Performance enhancements
You can download the Visual Studio 2008 SP1.
Note: When you are installing Visual Studio 2008 on Windows Vista it fails the installation.
To Resolve this issue
1. Right-click the Sidebar icon in the notification area, at the far right of the taskbar.
2. Click "Exit".
Related Posts:
1 commentCreating a Dynamic Data web site using Scaffolding
Introduction
This post explains how to create a basic Web application that uses ASP.NET Dynamic Data. ASP.NET Dynamic Data provides the Web application scaffolding that enables you to build rich data-driven Web applications.
scaffolding is mechanism that enhance the functionality of the existing ASP.NET Framework by adding the ability to dynamically display pages based on the data model of the database.
Creating a Dynamic Data Web site
We can use web site template to create a Dynamic Data Web Site.
The following steps explains the procedure
- Start Visual Studio 2008.
- Go to File menu, click New Web Site, New web site dialogue box is displayed.
3. Select the Dynamic Data Web Site Template from the above dialogue box.
4. In the Location box type the name for the web site and click ok.
Adding the Data to Web site
Add a database to the project and create the database model
To Add the database file to project.
1. In solution explorer, Right click the App_Data folder and click Add Existing Item.
2. Enter the AdventureWorks_Data.mdf name location file in location box.
The next step is create the Data model
To create the data model using LINQ to SQL
1. Right click the solution explorer and then click Add New Item.
2. Click Add the following dialogue will appear
Object Relational Designer is displayed
In the O/R Designer , Click the Server Explorer link
3. From Database Explorer, under data connections, expand the database file node and then table node.
4. Drag all tables into the O\R designer. Each table represented as entity.
Register the data context
1. Open the Global.asax file.
2. model.RegisterContext(typeof(AdventureWorksDataContext),
new ContextConfiguration() { ScaffoldAllTables = true });
3. The above line in Global.asax file registers the LINQ to SQL data context for Dynamic data web site.
Testing Dynamic Data web site
1. In Solution explorer, right-click the Default.aspx page, and then click on view in browser.
2. The following screen shows the browse page
3. Using the above site you can add/edit/delete the data in a particular table.
Related Posts:
5 commentsWCF Sample in Visual studio 2008
Introduction
This post explains the procedure to develop the sample WCF Service and WCF Client in Visual studio 2008. Get an overview on WCF and WCF Terms.
1. Start open Visual studio 2008, Select new project option from file menu
2. Select the WCF ServiceApplication template from the project templates.
3. WCF Service describes the operations that perform in a service contract.
4.Declare the service contract in Iservice.cs interface and implement in the above Service class.
5. To test this service, you will need to create a client and use it to call the
service. You can do this using the svcutil.exe tool from the command line with
the following syntax: Generating a client using svcutil.
svcutil.exe http://localhost:53391/Service.svc?wsdl
6. The above command generates a code file and configuration file contains the client class. Add the two files to your client application and use the generated client class to call the service.
7. Client class which call the service looks like
8. The generated client configuration file looks like
9. The service configuration file looks like
Conclusion
The above post explains shows the standard way to create a service and client and calling the service. The Next posts explains each feature in depth.
Related Posts:
6 commentsOverview of .NET Remoting
Introduction
This post provides you the overview of .NET Remoting Framework. It allows the objects to interact with one another across the application domains.
Features
- Communication channels for transporting messages across applications
- Formatters are used for encoding and decoding the messages. supported formatters are
1. Binary encoding formatter – use when performance is critical
2. XML encoding formatter = use when Interoperability is essential
- Object activation and life-time support
Object activation model falls into two categories
1.Client-activated objects
2.Server-activated objects
Remote Objects
An object is consider to be remote when the caller of the object is in different application domain. Object has to decorate with [serializable] custom attribute or they have to implement ISerializable interface to be considered as a remote. Remote objects have to be passed by value. Any object can be changed to remote by deriving from MarshalByRefObject.
Proxy Objects
Proxy Objects are created when client activates a remote object. Proxy object acts as a representative to remote object and ensures that all calls that made on proxy are forwarded to the remote object.
Two types of Proxy Objects
1.Transparent Proxy
2.Real Proxy
when client activates a remote object, Framework creates a local instance of TransparentProxy class. All method calls on Transparent Proxy object are intercepted by CLR and forwards the call if the remote object is in same application domain.
Real Proxy object calls are intercepted by CLR and forwards the call even the remote object is in different application domain by calling its Invoke method.
Related Posts:
2 commentsRemoting in .NET Framework 2.0
Introduction
Remoting is distributed application technology built in the Framework 2.0 with new features which allows the developer to build wide range of distributed applications. Overview of Remoting.
Introduced some new features in Remoting in .NET FW 20. The applications are now more secured and performanent.
Enhancement in the Channel infrastructure: The new channel IPC is introduced which enables the same box communication. It allows the communication between both server application and client application when both are in the same machine. This wont use any network layer when client and server communicate. IPC Channel is based on named pipes.
IPC channel don’t use ports unlike TCP and HTTP channels. The URI will look like ipc://test/server.rem.
.NET FW 2.0 supports three channels in communication – TCP,HTTP and IPC and it supports two formatters, Binary and SOAP.
.NET Remoting Server application can be in the following forms
- Console application
- Windows application
- Windows Service
- IIS(using HTTP and Binary Formatter)
Interface Implementation in Server Application
Client Application
Application Configuration file settings
We can limit the number of users by using this channel.
![Recommend [kalyanms1]](http://s3.amazonaws.com/arkayne-media/img/badge/02me.png)