Friday, December 2, 2011

How to create external css file


external css


we can keep our style and html page at different location.
When using CSS it is preferable to keep the CSS separate from your HTML. Placing CSS in a separate file allows the web designer to completely differentiate between content (HTML) and design (CSS). External CSS is a file that contains only CSS code and is saved with a ".css" file extension. This CSS file is then referenced in your HTML using the <link> instead of <style>. If you're confused, don't worry. We are going to walk you through the whole process.



file creation


1.       Open any text editor like Notepad and type following code and save with extension css.

CSS Code:


body{ background-color: gray;}
p { color: blue; }
h3{ color: white; }
Now save the file as a CSS (.css) file.
Make sure that you are not saving it as a text (.txt) file, as notepad likes to do by default.
 Name the file "test.css" (without the quotes).
Now again open text editor to create a new file.
 Now create a new HTML file and fill it with the following code.

HTML Code:
<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css" />
</head>
<body>
<h3> A White Header </h3>
<p> This paragraph has a blue font. 
The background color of this page is gray because
we changed it with CSS! </p>
</body>
</html>
Then save this file as "index.html" (without the quotes) in the same directory as your CSS file. Now open your HTML file in your web browser and it should look something like this..

Display:
A White Header

This paragraph has a blue font. The background color of this page is gray because we changed it with CSS!

Congratulations! You just made your first website that uses External CSS! Now, let us move on to the fun stuff.

why use external css?
It keeps your website design and content separate.
It's much easier to reuse your CSS code if you have it in a separate file. Instead of typing the same CSS code on every web page you have, simply have many pages refer to a single CSS file with the "link" tag.
You can make drastic changes to your web pages with just a few changes in a single CSS file.

how to create dynamic table in asp.net


How to create dynamic table in asp.net 3.5
Why the LoadViewState()?
When the controls are added to page, it is done quiet early in the page event cycle. Hence the LoadViewState() gives you an ideal placeholder to recreate the controls. Since the LoadViewState() method is called before the Page_Load() event, re-adding controls in this method assures that the controls can be access and manipulated by the time any event occurs on them.
Step 1: Create a new ASP.NET application. Add two textboxes (txtRows and txtCols) and a button (btnGenerate) control to the page. The two textboxes will accept the number of Rows and Columns from the user. Based on the input in the textboxes, the table will be created dynamically on the button click. Also add a container element (to position the table) and a button (btnPost) to cause a postback the second time, once the table data is manipulated.
The mark up will look similar to the following:
<body>
    <form id="form1" runat="server">
    <div>
    <div>
        Rows: <asp:TextBox ID="txtRows" runat="server" Width="30px"> </asp:TextBox> <br />
        Cols: &nbsp;<asp:TextBox ID="txtCols" runat="server" Width="30px"></asp:TextBox>
        <br />
        <br />
        <asp:Button ID="btnGenerate" OnClick="btnGenerate_Click" runat="server" Text="Generate" />&nbsp;<br /> <br />
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
        <br />
        <br />
    </div>
    </div>
        <asp:Button ID="btnPost" runat="server" OnClick="Button1_Click" Text="Cause Postback" />
    </form>
</body>

Step 2: The number of rows and columns for the table is to be taken from the user. For this purpose, we will accept the values in the Page_Load() event. We will create properties for both the rows and columns and store in the ViewState so that the data is available on the postback.
C#
// Rows property to hold the Rows in the ViewState
    protected int Rows
    {
        get
        {

AngularJS Basics - Part 1

                                                                  AngularJS What is AngularJS ·          Framework by googl...