Tuesday, October 30, 2007

HTML Templates

In this tutorial, I'll provide the basic html codes used in website designs. In web application development most developers use WYSIWYG (What You See Is What You Get) type programs like Frontpage, Dreamveawer and Visual Studio. But if you want to take advanced control of your website, sticking to the html codes is inevitable and most developers directly work on the html tags. Let's not forget to say HTML stand for "Hyper-Text Markup Language".



Let's take a look at how the html structure of a web page is:
<html>
<head><title>New Page</title></head>
<body>
</body>
</html>


Above is the html template code that has to be present in EVERY html page so that it can be displayed by the browsers like Firefox, Internet Explorer, Netscape etc. Notice that this script is well-formed i.e. each tag has a matching closing tag.

There are two major code manipulations to make a web page work.
  1. Javascript
  2. CSS
Javascript, in a nutshell, is a client-side scripting language. I'll tell what this means in just a moment.
CSS stands for "Cascading Style Sheets". As it's name implies, it is used to manipulate the style, look and feel of a web page.

In addition to these two code manipulations, you need to deal with a third type of code which is server side scripting and programming if you need a dynamic page. C#, VB.NET, PHP, ASP CGI are examples of server side programming.
Here comes the difference between Javascript and C#. One is client side coding and the other one is server side coding. For instance C# runs and processes the user input in the server and responds to a users request while Javascript runs in the users computer and validates user input or triggers some funny effects when the users moves their mouse.

We will code html template with more functionalities in the next posts. So bear with me and feel free to share your comments.

Wednesday, October 10, 2007

DataGrid Paging and Sorting Implementation

Unless you use ASP.NET's auto designer mode and auto features, you have to implement sorting and paging methods for the Datagrid in C# or VB.NET codes.

Declare the page index changed event and its handler in InitializeComponent() method of the C# code.
Implement the method which will set the index to the new page index.
private void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e) {
}

Do the same for sorting.


If the database query returns huge number or records, you may wanna consider Caching the recordset. Otherwise, each PageIndexChanged event will cause hitting the database again and again which results in a performance decrease.
Use the method Cache.Insert(dataset) to do this.

Tuesday, June 12, 2007

XSLT

Terms:

XSL stands for EXtensible Stylesheet Language.
XSLT stands for XSL Transformations

Styles;
CSS for HTML documents.
XSL for XML documents.

XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.

XSL consists of three parts:

* XSLT - a language for transforming XML documents
* XPath - a language for navigating in XML documents
* XSL-FO - a language for formatting XML documents

A common way to describe the transformation process is to say that XSLT transforms an XML source-tree into an XML result-tree.

Source: http://www.w3schools.com/xsl/

Wednesday, June 6, 2007

Self-Signed SSL on IIS localhost

Great accomplishment to make SSL work on localhost! Worth spending couple of hours!

-Copy makecert.exe from C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin to C:\

-Run the below line on command window (cmd).

C:\>makecert -n "CN=%ComputerName%" -ss MY -sr LocalMachine -b 09/09/2006 -e 09/09/2008 -a sha1 -sky exchange -r -pe MYLocalExchangeCA.cer

%ComputerName% environment variable directly grabs your computer name.
-sky token should be "exchange".

-Then, go to IIS > The Web Site root > Properties > Directory Security > Secure Communications > Server Certificate > "Assign an existing certificate" > Choose the certificate > Next until Finish. (I'm sorry if you don't see any certificates, something should be wrong.)


-On the Default Web Site or a Virtual Directory, go to Directory Security tab again > Secure Communications > "Edit" button & make sure "Require Secure Channel (SSL)" is checked.


-go type https://localhost/ OR https://localhost/[virtual directory] in your browser.
-ignore the warning
-see your site working!