Aaron Li's Blog

Write it down before I forget

  Home  |   Contact  |   Syndication    |   Login
  30 Posts | 0 Stories | 21 Comments | 1 Trackbacks

News

Google

Archives

Other's Idea

February 2007 Entries

What Is JavaScript For Someone asked me a question: what do you use JavaScript for? My answer is, Validation Calculation Page redirection Dynamically refresh part of the page (use DOM technology) What else...

Web.config And Forms Authentication Authentication is necessary to almost every application. ASP.NET brings different Authentication Providers to make the authentication process easier. Among them, Forms-based authentication is the most often used one. With Forms Authentication, we create a login form with the logic to validate a user and .NET will create a Cookie on successful validation which the application will check for on each client request. Forms Authentication is configured in web.config,...

XML Schema And ASP.NET (2) If you use Visual Studio, there is a short cut to create an XML schema related to your database. Step 1, open Server Explorer view. Step 2, set up the Data Connection to the database. Step 3, grab the objects such as tables, views, or stored procedures and drop them to the DataSet or Schema view, depending on what template is used. Step 4, done. It saves us a lot of time and energy; however, it seems the relationship between the data objects if there is any is not cared...

XML Schema And ASP.NET (1) Visual Studio provides 2 templates for XML schema, one is XML Schema, and another one is Data Set. Then when directly use XML Schema template? And when Data Set one? As we’ve known, an XML schema is used to describe the data contained in XML file(s). XML Schema template generates a file for creating a schema for XML documents; Data Set does a file for creating an XML schema with DataSet classes. DataSet is a component of the ADO.NET architecture, and it is one of the most...

Compare XML, XML Schema To Database XML is designed to store, carry, and exchange data. If you are familiar to database, then, think about tables. They are both data containers. An XML schema describes the structure of an XML document. Well, you know what table structure is, don't you? XML Schemas are written in XML. If you know SQL Server, perhaps you have noticed that some tables named sys* are used to describe the table structure. Now, you've found that XML and XML Schema are not difficult to...

Set Focus After Postback To set the focus on a certain control after a page postback, we can either add a dynamic script javascript block; or set the SmartNavigation attribute to true in the @ Page directive in the .aspx file. SmartNavigation is only supported by IE 5.5 browser, or later. It resets the focus and scroll position between post back, and the user won't feel the whole screen flickering. However, it is said that from time to time it is not smart enough to cooperate well with javascript...

Convert VB.NET To C# Or Vice Versa There are tools to do this, but it is still useful to remember these tips. 1. Case sensitivity VB.NET No C# Yes 2. Comment VB.NET ‘ C# //, /* */ 3. Reference VB.NET Imports System Imports System.Web.Security C# using System; using System.Web.Security; 4. Inherit VB.NET Public Class MyClass Inherits System.Web.UI.Page C# public class MyClass : System.Web.UI.Page 5. Region VB.NET #Region " Web Form Designer Generated Code " C# #region Web Form Designer generated code...

Implement Country And Province/State Dropdown Lists in ASP.NET In my project, the countries and prov/states are not stored in the database. I have some functions in a class. 'to get the Country list Public Shared Function GetCountryList() As ArrayList Dim alCountry As New ArrayList alCountry.Add(New ListItem("", "-1")) alCountry.Add(New ListItem("United States", "181")) alCountry.Add(New ListItem("Canada", "32")) alCountry.Add(New ListItem("Afghanistan", "1")) alCountry.Add(New ListItem("Albania",...

How To Create An ASP.NET Project With Different Name To The Folder When we create an ASP.NET web application, Visual Studio - mine is 2003 – only gives us a chance to define the folder’s name, and then the project with the same name is created under that folder. Sometimes, we need have a different project’s name to the folder’s name. Please don’t be stubborn to create such a project. Here is a shortcut: create a project with whatever name, than SAVE AS from the menu or RENAME by right clicking the...

Why Cannot Create ASP.NET Project When I try to create an ASP.NET web application, the Visual Studio is stuck. The task manager shows that the Visual Studio has no response. However, to create projects of Web Control Library or ASP.NET Web Service has no problem. Searching the Internet, a lot of discussions of this issue can be found. I have tried with every kind of possible solutions, such as to delete the VSWebCache folder; to modify <httpHandlers></ht... section in Machine.config...

Partially Validate Page In ASP.NET Sometimes, when a postback happens, instead of explicitly or implicitly calling the Page.Validate(), we just want to partially validate the page, or say we only want certain validators to be executed. For example, we try to do duplication check of a email address or a phone number. I'll demostrate different solutions for validating whether an entered email address is a dup one. Solution 1 I have the following controls on my page, <asp:textbox id="txtEmail" runat="server"...