How to: Select an Encoding for ASP.NET Web Page Globalization
Internally, the code behind ASP.NET Web pages handles all string data as Unicode. You can set how the page encodes its response, which sets the CharSet attribute on the Content-Type part of the HTTP header. This enables browsers to determine the encoding without a meta tag or having to deduce the correct encoding from the content. You can also set how the page interprets information that is sent in a request.Finally, you can set how ASP.NET interprets the content of the page itself — in other w
How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization
Globalization is the process of designing and developing applications that function for multiple cultures. Localization is the process of customizing your application for a given culture and locale.In an ASP.NET Web page, you can set to two culture values, the Culture and UICulture properties. The Culture value determines the results of culture-dependent functions, such as the date, number, and currency formatting, and so on. The UICulture value determines which resources are loaded for the page
Infragistics WebCombo Javascript API Demonstration
In this blog I will demonstrate how to interact with WebCombo client side API using Javascript. Now Let's begin with an example.As shown above figure, there are several WebCombos on the page. When the right-hand checkbox is checked, the WebCombo is enabled anf get focus; otherwise,the WebCombo is disabled and lost focus.1. Retrieve WebCombo Object ReferenceTo interact with the client side WebCombo object, we need a way to get a reference to it. We can retrieve a WebCombo client side object refer
Sort a WebCombo Column Programly
Infragistics WebCombo control make it very easy to sort a cloumn with few lines of code. There is no need that the source data is ordered.Let see an example.As shown in above figure, the service WebCombo is not sorting and the rows are unordered.To sort a WebCombo column, we need to set the SortIndicator property of a Column object of the WebCombo control.Public Shared Sub BindWebCombo(ByRef control As WebCombo, ByRef dataSource As IBindingList)With control' data bingding.DataSource = dataSource
Select a matching row of WebCombo control based on DataValue
Considering the following scenario:The user selected an item in a WebCombo control then do a "save" action, when he re-enter this page, we want the Webcombo control select the value matching the data from the database. Let's look at an example as below.Supposed that the "Service" WebCombo has a DataTextField named "Code" and a DataValueField named "ID". Now we want to select a row by matching the DataValue of the control. Normally the code looks like below
Infragistics WebCombo Data Binding
Infragistics ASP.NET web controls are very usful and populate by web page developers. In this series articles I will share my expierences on Infragistics controls usage with you. The topic of this blog is how to bind WebCombo to a data source.You can bind WebCombo to an ArrayList, Object Collection or DataTable, and it supports binding to single column and multiple columns. Now let's look an example.1. Bind To a DataTable With Single Column VisibleThe ASP.NET page looks like below:All the WebCom
Assign Shortcut key for ASP.Net Page Using Javascript
Shortcut key gives end user more friendly interactions and performance. In this blog I will demonstrate how to implement a shortcut key access for ASP.NET page controls, using Javascript.Detecting keystrokesThe key point here is to capture window event of web browser. As we all know, browser vendors start experimenting when there's no official standard, and these experiments, though occasionally useful, also cause incompatibilities. The key events are no exception: there are currently two proper
Custom Paging in ASP.NET 2.0 with SQL Server 2005
In web application it is a routine to paging data retrieved from the database. And in ASP.NET 2.0 it is very simple to paging data by enable the "AllowPaging" property of GridView. This solution works well when the database data amount is not very large. However, if you want to page through thousands, tens of thousands, or hundreds of thousandsof records the default paging model is not viable. 1. Paging Data with SQL Server 200create procedure [dbo].[P_GetPagedOrders2000](@startIndex i
C# DateTime.ToString() Usage Demonstration
Formatting of Date and Time is an routine in application devlopment. In this blog I would show you how to format a DateTime value using DataTime.ToString() method in a specific culture.1. Format PatternThe following table lists the standard DateTime format patterns associated with DateTimeFormatInfo properties. For more information, see Standard Date and Time Format Strings.The following table lists the custom DateTime format patterns and their behavior. For more information, see Custom Date and
Building Cascading DropDownList in ASP.Net Using jQuery and JSON
Cascading DropDownList is a technique where we populate a child DropDownList based on the parent DropDownList selection. It is often used in web applications. In this blog I will show you how to implement a cascading dropdownlist using jQuery and Json in ASP.Net.Let's begin with a real example.As shown in pictures above, when we select a Building in Home Building DropDownList, it will populate the HomeRoom DropDownList based on the HomeBuilding selected.Now let's take a look at the key points.1.
Javascript showModalDialog() Function
In Web application we can use window.showMadalDialog() to popup a modal window. Now let's take a deep look at how to use this function. 1. Syntaxvar vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures]);parameters description:sURL - required. data type : string. It refer to the URL of target ducument to link to.vArguments - optional. data type : variant. It can be an object, an array. It is used to pass value to the target document. Using window.dialogArguments to retrieve the
prevent a Javascript Modal Window to open itself in a new window
I used window.showModalDialog() to open a modal window in my ASP.Net web application. When I click a Button control to do something, the page is postback, and this made the modal window reopen a new window for the page. This is not what I excpected.To prevent this unexpected action, you need to add the following html code inside <head> section of your ASP.NET page.<base target="_self" />If your page use a master page, you should definde a ContentPlaceHolder under <head&g
Managing Namespaces in VB.Net
A namespace is a way to disambiguate one public interface from another. You can happily go through life not worrying about explicitly declaring namespaces in your VB.Net code because of VB.Net's automatic namespace creation. So you can create a project, give it a name, and start writing code. Beautiful and blissful.Then one day, you wake up and the solution your team works on won't compile.This will happen to you as a result of not managing your projects' namespaces properly. Eventually, you wil
Set a Datasourse List for Excel cells
Sometimes, you want the value of an Excel cell coming from a data list preseted. see the figure below: Now follow me to set a data list for excel cells. 1. Select a cell you want to set data list. 2. Click "Data" main menu. 3. Click "Data Validation" button. 1. On the "Data Validation" window,select "Settings" Tab. 2. Select "List" from "Allow" dropdownlist, and make sure "Ignore blank" and "In-cell dropdown" check
SQL Server 2005 Developer Edition English Version Setup on Windows 7
In the recent project, our customer required to use MS SQL Server 2005 English Version as the database backend. I try to install it on my machine which is Windows 7. Follow the setup wizard, and on the "System Configuration Check" screen , there is a waring says "ASP.Net Version Registration Requirement", click the "Message" link you will see the detail: "Failed to find the ASP.Net Version Registration with Microsoft Internet Information Services (IIS)." I
Using Excel to generate Inserts for SQL Server
Much of my day job involves database design, maintenance and manipulation. I use SQL scripts to quickly build my databases from scratch. In order to test them I need piles of data and find it is often too much work to generate all those inserts manually or figure out sqlcmd or osql code to import bulk data.The best programmers, as many say, are lazy and the quickest way I’ve found to generate the inserts is to use Excel. If any of the following isn’t clear please attach a comment and I’ll be
Building a Pub/Sub Message Bus with WCF and MSMQ
In my previous blog I demonstrate how to build a offline distributed system with MSMQ. In this blog I will show you how to build a Publish/Subscribe message bus using WCF and MSMQ. The solution is built with .NET Framework 3.0 and makes extensive use of Windows Communication Foundation (WCF), Microsoft Message Queuing (MSMQ) 4.0 and Internet Information Services (IIS) 7.0, all hosted on Windows Server 2008. Now follow me.1. Defining the Service ContractThe first step was to define the contracts
Push Data From Server to Silverlight Clients With a WCF Duplex Service
Normally in a client-server architecture application, the client makes a request to the server, then the server responses to the client. The client side PULLs data from the server side. However, we sometimes want the server side to PUSH data to the client side whenever the data changed. With a WCF duplex service, we can push updated data to Silverlight clients. In the rest of this blog I will show you how to achieve this goal.Many of the WCF services out there follow the simple request-response
Reading message from nontranscational remote MSMQ in workgroup
MSMQ is very useful for building a distributed, offline application. In my recent project the customer requires reading message remotely from a MSMQ queue. In this blog I will show you the solution.1. MSMQ API Get StartedAccessing MSMQAccessing a queue via .NET is done with the System.Messaging.MessageQueue object. The following code demonstrates how to access a public queue named TechRepublic on a computer named "SRV-MESSAGING":MessageQueue queue = new MessageQueue("SRV-MESSAGING
WCF Services Sample: Authenticate Silverlight Client based on Custom Security Token
In my blog "WCF Services Sample: Authenticate Silverlight Client based on UserName and Password", I show you how to improve security of WCF security by using a custom validator to authenticate Silverlight client based on username and password. That solution look good. However, it is not a final solution. You know, the Silverlight application runs on local machine of the remote users. The Silverlight communicate with WCF service via BasicHttpBinding, which transfer messages in cleratext