Sponsored Ad

Wednesday, December 30, 2009

How to Use in HTML Meta Tags

Meta tags are used to supply information for search engines that won't be seen by the web surfer unless they were to view your web site's HTML. Historically, meta tags were a primary way for your site to be recognized by web spiders, but the net community abused the meta tags to artificially increase their ranking in the search engine databases. Nevertheless, you ought to still include meta for those search bots that do recognize them, permit your site to be included in their search engine.

Keywords Meta Tag

Keywords or phrases are placed in this meta tag's content attribute. You ought to specify the most popular search terms you believe somebody would use to reach your web-site. A few years back, you could spam this meta tag with any and every keyword possible to gain ranking on search engines. Repeated words, or words that do not pertain to the content of the site won't benefit you or those using a search engine. Here's an example of proper usage for a site.

HTML Code:

<head>

<meta name="keywords" content="keyword, key keywords, etc" />

</head>

name defines what kind of meta tag being used. Note that words are separated by commas.

An example of meta tag keywords Tizag.com would be as follows.

HTML Code:

<head>
<meta name="keywords" content="HTML, XHTML, CSS, tutorials, tizag" />
</head>

Description Meta Tag


As you might have guessed, this tag will show a brief description of the net page to a search engine. Your description should be a sentence or six about your web-site. Keywords that appeared in the keyword meta tag should appear here as well.

HTML Code:

<head>
<meta name="description" content="Tizag contains webmaster tutorials." />
</head>

Description and Keywords tags are similar, and they ought to be. As mentioned above if they do not match, you may be ignored or blocked by some search engines. Be careful.

Revised Meta Tag


The revised meta tag records when the last update was done to the site.


HTML Code:

<head>
<meta name="revised" content="Happy New Year: 1/1/2003" />
</head>

Refresh Page and Redirect


Later down the road, you may need to redirect traffic to another domain. A common reason might be that you have purchased a better domain name & would like to retain your elderly visitors, yet still use your new domain. With the refresh meta tag you will be able to redirect visitors to the world wide web-site of your choice.


HTML Code:

<head>
<meta http-equiv="refresh" content="10; url=http://www.tizag.com" />
</head> 

Above shows refreshing Tizag homepage every 10 seconds. A quick update may be necessary for news, stocks, or at any other sensitive information. The most common use for this type of meta tag, however, is the funnel. To redirect a viewer automatically alter the new site URL as shown below. This code will send your visitors to espn.com after being in place at one seconds.

HTML Code:

<head>
<meta http-equiv="refresh" content="5; url=http://www.espn.com" />
</head>

Tuesday, December 29, 2009

HTML Input Tags

HTML Input Tags

The input fields come in several flavors including check boxes, text fields, radio, and the buttons on the submission form. The tag requires no closing tag and is therefore an all-in-one "tag.

HTML - The Type Attribute

To specify one type of input tag from another they set the type attribute to one of the following values.

  • "text"
  • "password"
  • "checkbox"
  • "radio"
  • "submit"
  • "reset"

HTML - Text Fields and Password Fields

You have seen many of these types of input forms throughout the internet.

HTML Code:

<input type="text" />

<input type="password" />

Text Fields and Passwords:

Checkboxes permit the user to select multiple choices for a single query. A type of "check all that apply" query is best answered using a checkbox.

HTML Code:

<input type="checkbox" />
<input type="checkbox" /><input type="checkbox" />

Checkboxes:


Radios are best used in "multiple choice" type quizzes & questionaires. Where the user is only allowed to select three answer to a query.


HTML Code:

<input type="radio" />
<input type="radio" /><input type="radio" />

Radios:


HTML - Submit Buttons


Setting an input type "submit" button specifies a badge. When pressed, the button activates the action of whatever form. Most times it is some kind of server-side script file or a JavaScript function.


Because they are filing creatting a button. They should introduce a new attribute, the value attribute. Anyword (s) specified as the value is shown on our button. Often it is better to stick with "Send" or "Continue". Boring, but effective.


HTML Code:

<input type="submit" value="Submit" />
<input type="submit" value="Continue Please!" />

Submit Buttons:


clip_image002[5]

HTML - Reset Buttons

The last type of input is the reset button. Return type settings place a button on your form to reset by clicking in each field. Users enjoy having a "new start" button and the reset button if you start filling out the misinformation in a major way.


HTML Code:

<input type="reset" value="Reset Fields" />
<input type="reset" value="Start Over" />

Reset Buttons:


clip_image004




 

Monday, December 28, 2009

Using HTML Decode with C# string

You can easily encode and decode string in c#. There is Microsoft library function that you can use to decode.

You can not directly pass everything in URL. Like url string only accepts ?, & and / . so you need to encode it before passing to the browser and after that you need to decode it to properly use.

Also if you will try to store raw url in database, It will prompt an error message. one way is to encode the given url and store it.

After encoding you need a url in original form. So use the following methods to decode url/string.

Sample encoding code is as follows:

 

Code Snippet
  1. string result = System.Web.HttpUtility.HtmlDecode(“Sample string”);
  2. // other method
  3. Server.HtmlDecode(TestString)

HTML Encode string in C#

You can easily encode and decode string in c#. There is Microsoft library function that you can use to encode.

You can not directly pass everything in URL. Like url string only accepts ?, & and / . so you need to encode it before passing to the browser.

Also if you will try to store raw url in database, It will prompt an error message. one way is to encode the given url and store it.

 

Sample encoding code is as follows:

Code Snippet
  1. string result = System.Web.HttpUtility.HtmlEncode(“Sample string”);
  2. // other method
  3. Server.HtmlEncode(TestString)

Sunday, December 27, 2009

JavaScript Operators

Operators in JavaScript are very similar to the operators appearing in other programming languages. The definition of an operator is a symbol that is used to perform an operation. Very often these arithmetic operations (addition, subtraction, etc.), but not always.

JavaScript Arithmetic Operator Chart

       Operator                English                    Example
       +        Addition               2+4
       -        Subtraction               6-2
       *        Multiplication               2*2
       /        Division               15/3
       %        Modulas               43%10

% Module may be a new venture for you, but is a special way of saying "find the rest." When run as a division 15 / 3 gets 5, exactly. However, if you get a 43/10 answer to one decimal, 4.3. 10 passes to 40 in five times and then there is a surplus. This is what is left over is returned by the operator module. 43% 10 would be 3.

 

How to JavaScript Operator Example with Variables

Performing operations on variables that contain values is very common and easy to do. Below is a simple script that performs all basic arithmetic operations.

HTML & JavaScript Code:

<body>

<script type="text/JavaScript">

<!--

var two = 2

var ten = 10

var linebreak = "<br />"

document.write("two plus ten = ")

var result = two + ten

document.write(result)

document.write(linebreak)

document.write("ten * ten = ")

result = ten * ten

document.write(result)

document.write(linebreak)

document.write("ten / two = ")

result = ten / two

document.write(result)

//-->

</script>

</body>

Display:

two plus ten = 12
ten * ten = 100
ten / two = 5

Comparison Operators

The comparisons are used to verify the relationship between variables and / or values. A single equal sign sets a value, while a double equals sign (= =) compares three values. Comparison operators are used inside conditional statements and evaluate to true or false. Will talk more about conditional statements in the upcoming lessons.

   Operator      English        Example         Result
     = =     Equal To    x = = y     false
     !=     Not equal to    X!=y     true
     <     Less then    X<y      true
     >    Grater then    x>y      false
    <= Less Than or Equal To    x <= y      true
    >= Greater Than or Equal To    x >= y      false

Saturday, December 26, 2009

How to use HTML Scripts

There are four popular scripts that are commonly used in HTML to make web pages come alive. HTML javascript and HTML vbscript are useful scripting languages to know, if you have the time.

With HTML scripts you can generate dynamic web pages, make picture rollovers for chilled menu effects, or even validate your HTML form's information before you let the user submit. However, javascript and vbscript are complicated compared to HTML. It may be simpler to download somebody elses scripting code and use it on your web page (if they have given you permission to do so, of work!).

HTML with Javascript Code

If you need to insert JavaScript code into your HTML code to use the script tag. To learn more about JavaScript, check out our JavaScript Tutorial. Below is the correct code to insert the JavaScript code embedded on your site.

HTML Code:

<script type="text/javascript">

<!--script

***Some javascript code should go here***

-->

</script>

To configure the javascript attribute type equal to "text / javascript", which is similar to the technique of the CSS specification. They also include a review of all the JavaScript code. This prevents browsers that do not support JavaScript or JavaScript has been disabled to show the JavaScript on the World Wide Web browser.

HTML with Vbscript

To insert the VBScript code in your website must once again use the script tag. Below is the correct code to insert the VBScript code in place.

HTML Code:

<script type="text/vbscript">
<!--script
***The vbscript code should go in this spot***
-->
</script>

VBScript to set the type attribute equal to "text / vbscript", which is similar to the CSS specification. They also include a review of all the VBScript code. This will prevent browsers that do not support VBScript disabled or have VBScript that shows the VBScript code in the web browser.

Thursday, December 24, 2009

Create an constant array in c#

Strictly speaking you can not, since the constellation can only be applied to a field or local whose value is known at compile time.

In both the lines below, the right-hand is not a constant expression (not in C#).

  1. const int [] constIntArray = newint [] {2, 3, 4};
  2. // error CS0133: The expression being assigned to 'constIntArray' must be constant
  3. const int [] constIntArrayAnother = {2, 3, 4};
  4. // error CS0623: Array initializers can only be used in a variable or field
  5. //               initializer. Try using a new expression instead.

However, there are some workarounds, depending on what it is you want to achieve.

If want a proper .NET array (System.Array) that cannot be reassigned, then static readonly will do for you.

static readonly int [ ] constIntArray = new int[] {1, 2, 3};

The constIntArray field will be initialized before it its first use.

If, however, requires a constant set of values (such as an argument to an attribute constructor), then - if you may be limited to integral types - an enum would serve well.

For example:

  1. [Flags]
  2. public enum Role
  3. {
  4.     Administrator = 1,
  5.     BackupOperator = 2,
  6.     // etc.
  7. }
  8.  
  9. public class RoleAttribute : Attribute
  10. {
  11.     public RoleAttribute()
  12.     {
  13.         CreateRole = DefaultRole;
  14.     }
  15.  
  16.     public RoleAttribute(Role role)
  17.     {
  18.         CreateRole = role;
  19.     }
  20.  
  21.     public Role CreateRole
  22.     {
  23.         get { return this.createRole; }
  24.         set { this.createRole = value; }
  25.     }
  26.  
  27.     private Role createRole = 0;
  28.     public const Role DefaultRole = Role.Administrator
  29.      | Role.BackupOperator;
  30. }
  31.  
  32. [RoleAttribute(RoleAttribute.DefaultRole)]
  33. public class DatabaseAccount
  34. {
  35.     //..............
  36. }

RoleAttribute, instead of taking a series, only have a single argument of the flags (appropriately or-ed). If the underlying type of the list is long or ulong paper, which offers 64 different functions.

Wednesday, December 23, 2009

Creating Wrappers with Dynamic Object Dynamic in C#

But there were some obvious flaws in this example: While ExpandoObject always better syntax, LINQ to XML which provides a wealth of useful collection methods that helped her work with XML files. Therefore, it is possible to combine these two advantages, to get a better syntax and still get all these methods? The answer is yes, but you need other namespace Technique.Dynamic: DynamicObject.

In the previous post I showed how you can use the new feature and class dynamics ExpandoObject add and remove properties at runtime, and how this can make the code more readable and more flexible than code written with the syntax of LINQ to XML .

The class lets you override DynamicObject get or set operations as a member, calling a system, or perform any binary, unary, or type conversion operation. To illustrate the issue, let's create a simple object that replaces the "obtaining property" operation, so that each time you access a property that returns the property name as a string. This example has no practical value.

  1. public class SampleObject : DynamicObject
  2. {
  3.     public override bool TryGetMember(
  4.         GetMemberBinder binder, out object result)
  5.     {
  6.         result = binder.Name;
  7.         return true;
  8.     }
  9. }

As with ExpandoObject, we must use the dynamic keyword to create an instance of this class.

  1. dynamic obj = new SampleObject();
  2. Console.WriteLine(obj.SampleProperty);
  3. //Prints "SampleProperty".
  4.  
  5. Now let’s move to a more complex example and create a wrapper for the XElement object. Once again, I’ll try to provide better syntax for the following LINQ to XML sample.
  6. XElement contactXML =
  7.     new XElement("Contact",
  8.     new XElement("Name", "Patrick Hines"),
  9.     new XElement("Phone", "206-555-0144"),
  10.     new XElement("Address",
  11.         new XElement("Street1", "123 Main St"),
  12.         new XElement("City", "Mercer Island"),
  13.         new XElement("State", "WA"),
  14.         new XElement("Postal", "68042")
  15.     )
  16. );

 

First of all, I require to generate an analog of ExpandoObject. I still require to be able to dynamically add & remove properties. But since I am essentially generating a wrapper for the XElement type, I’ll use XElement in lieu of the dictionary to maintain the properties.

  1.     public class DynamicXMLNode : DynamicObject
  2. {
  3.     XElement node;
  4.     public DynamicXMLNode(XElement node)
  5.     {
  6.         this.node = node;
  7.     }
  8.     public DynamicXMLNode()
  9.     {
  10.     }
  11.     public DynamicXMLNode(String name)
  12.     {
  13.         node = new XElement(name);
  14.     }
  15.     public override bool TrySetMember(
  16.         SetMemberBinder binder, object value)
  17.     {
  18.         XElement setNode = node.Element(binder.Name);
  19.         if (setNode != null)
  20.             setNode.SetValue(value);
  21.         else
  22.         {
  23.             if (value.GetType() == typeof(DynamicXMLNode))
  24.                 node.Add(new XElement(binder.Name));
  25.             else
  26.                 node.Add(new XElement(binder.Name, value));
  27.         }
  28.         return true;
  29.     }
  30.     public override bool TryGetMember(
  31.         GetMemberBinder binder, out object result)
  32.     {
  33.         XElement getNode = node.Element(binder.Name);
  34.         if (getNode != null)
  35.         {
  36.             result = new DynamicXMLNode(getNode);
  37.             return true;
  38.         }
  39.         else
  40.         {
  41.             result = null;
  42.             return false;
  43.         }
  44.     }
  45. }

 

And here is how you can use this class.

  1. dynamic contact = new DynamicXMLNode("Contacts");
  2. contact.Name = "Patrick Hines";
  3. contact.Phone = "206-555-0144";
  4. contact.Address = new DynamicXMLNode();
  5. contact.Address.Street = "123 Main St";
  6. contact.Address.City = "Mercer Island";
  7. contact.Address.State = "WA";
  8. contact.Address.Postal = "68402";

 

The next interesting line is contact.Address = new DynamicXMLNode(). Fundamentally, in this particular example this line means that I require to generate a node that has subnodes. For this property, the TrySetMember technique creates an XElement without a value.

Let’s look at the contact object. When this object is created, it initializes its inner XElement. If you set a property value, like in contact.Phone = "206-555-0144", the TrySetMember technique checks whether an element with the name Phone exists in its XElement. If it does not exist, the technique creates the element.

The most difficult here is a line like contact.Address.State = "WA". First, the technique is called TryGetMember for contact.Address and returns a new DynamicXMLNode, which is initialized by the XElement with the name address. (In theory, could have returned the XElement itself, but that would make the example more complicated.) Technique then called TrySetMember. The technique looks for the element contact.Address State. If you do not find six who creates it.

String state = contact.Address.State; 

I have several options here. I can change the TryGetMember method to return actual values for leaf nodes, for example. But let’s explore another option: override type conversion. add the following method to the DynamicXMLNode class.






  1. public override bool TryConvert(

  2.     ConvertBinder binder, out object result)

  3. {

  4.     if (binder.Type == typeof(String))

  5.     {

  6.         result = node.Value;

  7.         return true;

  8.     }

  9.     else

  10.     {

  11.         result = null;

  12.         return false;

  13.     }

  14. }





The last thing I’m going to show is how to get access to the XElement methods. Let’s override the TryInvokeMember method so that it will redirect all the method calls to its XElement object. Of coursework, I’m using the Technique.Reflection namespace here.

Now whenever I have an explicit or implicit type conversion of the DynamicXMLNode type, the TryConvert method is called. The method checks what type the object is converted to &, if this type is String, the method returns the value of the inner XElement. Otherwise, it returns false, which means that the language should choose what to do next (in most cases it means that you’re going to receive a run-time exception).






  1. public override bool TryInvokeMember(

  2.     InvokeMemberBinder binder,

  3.     object[] args,

  4.     out object result)

  5. {

  6.     Type xmlType = typeof(XElement);

  7.     try

  8.     {

  9.         result = xmlType.InvokeMember(

  10.                   binder.Name,

  11.                   BindingFlags.InvokeMethod |

  12.                   BindingFlags.Public |

  13.                   BindingFlags.Instance,

  14.                   null, node, args);

  15.         return true;

  16.     }

  17.     catch

  18.     {

  19.         result = null;

  20.         return false;

  21.     }

  22. }





 


This process allows you to call methods on any node XElement object DynamicXMLNode. The most obvious disadvantage is the lack of IntelliSense.

Tuesday, December 22, 2009

Using Meta Tags in Html

When a search engine finds your page, it will need to index it (that is, add it to its searchable database) with some information off the page. Plenty of search engines now support the <META> tags, which let you give keywords & a description to your page. This gives you more control over how your page will show up during a search, & will often cause more traffic to your page.

The <META> tag can be used for a few different purposes. Usually, you ought to place the <META> tag within the <head> tags at the beginning of your document. To improve search engine results, they will use three specific attributes within the meta tag. Here is an example:

  1. <meta name="description" content="description of page goes here">
  2. <meta name="keywords" content="keywords go here">

When a user searches a search engine that supports meta tags and a query language expression (search for a keyword) to your page, your page will appear in the list of stakeholders of the results. The page will be listed by title and then, under the title shall first hundred or so characters of the description you placed in the meta tag. It is recommended to keep the contents of the description to a maximum of 200 characters. Although the content keyword is not searched by the user, it is recommended to keep this less than 1000 characters, because if you have more search engine will ignore the rest or delete from the index. (The commas are not necessary to separate keywords)

Example of a real-life meta situation...

When a search engine finds your page, it will need to index it (that is, add it to its searchable database) with some information off the page. Many search engines now support the <META> tags, which allow you to give keywords and a description to your page. This gives you more control over how your page will show up during a search, and will often cause more traffic to your page.

The <META> tag can be used for a few different purposes. Usually, you should place the <META> tag within the <head> tags at the beginning of your document. To improve search engine results, we will use two specific attributes within the meta tag. Here is an example:

  1. <meta name="description" content="description of page goes here">
  2. <meta name="keywords" content="keywords go here">


When a user searches a search engine that supports meta tags and they query a phrase (search for a keyword) related to your page, your page may show up in the list of results. Your page will be listed by its Title, and then underneath its title will be the first hundred or so characters of the description you placed in the meta tag. It is recommended that you keep the description content to no more than 200 characters. Although the keywords content is not seen by the user when searched, it is recommended to keep this less than 1000 characters, because if you have more the search engine will either ignore the rest or delete you from the index. (Commas are not needed to separate keywords)

Example of a real-life meta situation...

  1. <html>
  2.  
  3. <head>
  4. <title>Little Joe's Sound Page</title>
  5. <meta name="description" content="Joe's Collection of Cool Sound files for you to use in your home page!">
  6. <meta name="keywords" content="music sounds midi wav joe collection">
  7. </head>
  8.  
  9. <body>
  10. Page Goes Here
  11. </body>
  12.  
  13. </html>

 

Meta tags are not visible in the web page unless the user selects to 'view source'.

Use of XML HTML and QTP

With this, I am beginning a series of posts on savings plan and XML. To set the tone for the debate, I would start with the basics of XML and the differences between XML and HTML.

What is XML?

XML is a markup language much like HTML. The primary use of XML to store, above, and information exchange. Being hardware independent software, has been widely accepted XML (W3C standard) as a means of exchanging information between disparate systems.

XML does not really do anything – it only structures, stores or sends information.

For example, this is a note stored as XML:

 

  1. <note>
  2.  
  3. <to>LearnQTP</to>
  4.  
  5. <from>Ankur Jain</from>
  6.  
  7. <heading>XML</heading>
  8.  
  9. <body>XML and QTP</body>
  10.  
  11. </note>

The note has a header and a message body, sender and receiver of information. Data from the well-formed that, however, this XML document is nothing. Someone should write a piece of software to send, receive, display or interpretation.

Program that can handle plain text can also handle XML. In a simple text editor, XML tags will be visible. In an XML-aware application, however, XML tags can be handled in special (may or may not be visible, or have a functional significance).

XML vs HTML :

HTML describes the presentation. It is used to display data and focuses on how data looks. For example, in HTML, bibliography is the header, the remainder is in paragraphs with text in italics ...

  1. <h1> Bibliography </h1>
  2.  
  3. <p> <i> Foundations of Databases </i>
  4.  
  5. Abiteboul, Hull, Vianu
  6.  
  7. <br> Addison Wesley, 1995
  8.  
  9. <p> <i> Data on the Web </i>
  10.  
  11. Abiteoul, Buneman, Suciu
  12.  
  13. <br> Morgan Kaufmann, 1999

 

XML describes the content. It is used to describe the data and focuses on the data.

For example, in the XML below, the literature is a child element with books.

  1. <bibliography>
  2.  
  3. <book> <title> Foundations… </title>
  4.  
  5. <author> Abiteboul </author>
  6.  
  7. <author> Hull </author>
  8.  
  9. <author> Vianu </author>
  10.  
  11. <publisher> Addison Wesley </publisher>
  12.  
  13. <year> 1995 </year>
  14.  
  15. </book>
  16.  
  17.  
  18. </bibliography>

HTML can also use XML to store their data and focus on the presentation so that changes do not affect the data to HTML. In that sense, XML is a complement to HTML, not a replacement for it.

How to check file extensions using QTP

Using QTP, they need to validate whether the particular picture on a web page is .jpg, .gif, .bmp or any other extension.

Solution:

  • We will take the example of Mercury demo application

image 

 

  • The image to be checked is shown in red ellipse above.
  • Now “Object spy” on the object.

image

  • Find the property that contains the file name. Normally the name of the property would be the file name itself. The value of this case is featured_destination.gif.
  •  Put this value into a array using GetTO property
  • Now make use of split function with . (dot) as delimiter.
  • The final value of the array would be the file extension. Normally, 2 value within a set would be the file extension, but if a developer uses the name as featured.destination.gif [least three points] then could create a problem so we always have the ultimate value of the matrix.
  • Here is the script for the process given above:

Dim filename, arrfile

'Put filename into the array

filename =  Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Featured Destination:").GetTOProperty("file name")

' Split using "." as delimiter

arrfile = split(filename,".")

msgbox arrfile(Ubound(arrfile))

    ·

Thursday, December 10, 2009

How to Create a Lists in HTML

Ordered lists and unordered lists work the same way, except that the former is used for non-sequential lists with elements of the overall list, preceded by bullets and the second is for sequential lists, which are typically represented by additional numbers.

The UL mark is used to define ordered lists without the ol tag is used to define ordered lists. Within the lists, the li tag is used to define each element of the list.

Change your code to the following:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html>
  5.  
  6. <head>
  7.     <title>My first web page</title>
  8. </head>
  9.  
  10. <body>
  11.     <h1>My first web page</h1>
  12.  
  13.     <h2>What this is</h2>
  14.     <p>A simple page put together using HTML</p>
  15.  
  16.     <h2>Why this is</h2>
  17.     <ul>
  18.         <li>To learn HTML</li>
  19.         <li>To show off</li>
  20.         <li>Because I've fallen in love with my computer and want to give her some HTML loving.</li>
  21.     </ul>
  22.  
  23. </body>
  24.  
  25. </html>

If you look at this in your browser, you will see a bulleted list. Just change the ol UL labels and note that the list will be numbered.

Lists can also be included in lists to form a structured hierarchy of items.

Replace the above list code with the following:

  1.        <ul>
  2.     <li>To learn HTML</li>
  3.     <li>
  4.         To show off
  5.         <ol>
  6.             <li>To my boss</li>
  7.             <li>To my friends</li>
  8.             <li>To my cat</li>
  9.             <li>To the little talking duck in my brain</li>
  10.         </ol>
  11.     </li>
  12.     <li>Because I've fallen in love with my computer and want to give her some HTML loving.</li>
  13. </ul>

HTML Images

The img tag is used to put an image in an HTML document and it looks like this:

  1. <img src="http://www.htmldog.com/images/logo.gif" width="157" height="70" alt="HTML Dog logo" />

The width and height attributes are necessary because if they are excluded, the browser tend to underestimate the size of the image is loaded, instead of when the page loads, which means that the design of the document can jump while the page is charging.

The alt attribute is the alternative description. This is used for people who can not or choose not to view images. This is a requirement in the latest versions of HTML.

HTML Forms

On its own, the forms are useless. They must be connected to a program that processes the data entered by the user. They take all sorts of guises and are outside the remit of this website. If you use an Internet service provider to host your HTML, you can help with this and probably will be simple and clear instructions on how, for example, to make a form work email form.

The basic tags used in the HTML of the actual forms are form, input, text area, select and option.

Define the shape and form within this label, there is an attribute of action necessary to consider how your content will be sent to the date of submission.

The optional method attribute tells the form how the data that will be sent and that you can obtain the value (which is the default) or by mail. This is commonly used, and often set to post the information hiding (the closures of information in the URL).

Thus, a form element will look something like this:

<form action="processingscript.php" method="post">

</form>

The input tag is the daddy of the form world. It can take ten forms, outlined below:

Is a standard text box. This can also have a value attribute, which sets the initial text in the text box.

  • Is similar to the text box, but the characters entered by the user will be hidden.
  • Is a check box that may be activated by the user. This can also have an attribute set, to be used in the format, And makes the initial state of the checkbox to be on, so to speak.
  • Is similar to a checkbox, but the user can select only one radio button in a group. This can also have an attribute set used in the same way that the check box.
  • Is an area that displays the files on your computer, as seen when opening or saving a document in most programs, and is used to allow users to upload files.
  • is a button that when selected the form is submitted. You can control the text on the submit button (as you can with the reset button and type - see below) with the value attribute, eg .
  • Is an image that presented the coordinates of where the user clicked. This also requires a src attribute, as the img tag.
  • Is a button that will do nothing without the extra code added.
  • Is a button that when selected will reset the form fields to their default values.
  • Is a field that will not be displayed and used to pass information as the name of the page that the user or the email address that the form should be sent a.

Note that the input tag and a closing "/>" at the end.

A text area is basically a large text box. Is required rows and cols attribute and used like this:

A big load of text here

The select works with the label of choice to make the selection drop down boxes.

They work like this:

  1. <select>
  2.         <option value="first option">Option 1</option>
  3.         <option value="second option">Option 2</option>
  4.         <option value="third option">Option 3</option>
  5. </select>
 

Monday, December 7, 2009

Maximum limit of QueryString

There is limitation in QueryString also and it vary from browser to browser.

You can check the limit as per given chart.
•    Opera supports ~4050 characters
•    IE 4.0+ supports exactly 2083 characters
•    Netscape 3 -> 4.78 support up to 8192 characters
•    Netscape 6 supports ~2000 [characters]
•    Firefox supports up to 4000

How to use C#(Csharp) QueryString

This is a method to pass values from one page to another page. There is limitation of passing number of bytes(characters) in QueryString and depend on browser.

Before receiving query string in a variable you need to check for null to avoid unwanted errors.

Pass QueryString:

Samplepage.aspx?name=sample string

Receive QueryString:

Code Snippet
  1. string strName;
  2. if (Request.QueryString["name"] != null)
  3. {
  4. strName = Request.QueryString["name"].toString();
  5. }

Thursday, December 3, 2009

Software Testing – Tips for Automation testing

Automation is an important aspect of software testing. Testers use various tools to automate their testing activities. The choice of instrument depends on the type of application under test. There are several commercially available tools such as Rational Robot, Mercury Quick Test Pro, eventing and many more.

Makes automation to make life easy, but the automation of the testers in itself is a difficult task. There are many problems they face, while the automation of an application and a tester has to find a get around that problem.

In this section we give some tips for automating Geek Test. These tips are mainly drawn from personal experiences and are very useful in cases where a tester is stuck in a similar situation.

Waiting for long to complete processing

A common problem they face, while automation of the financial applications or application that requires too much processing time is expected to appear some windows or buttons that is activated after processing operations very long. This time can vary from 5 min. 30 min. Sometimes the automation tool does not respond after a long interval. One of them was found to the automation of an insurance company based on the application. The processing time is more than 15 minutes and the tool for automating the response after 15 minutes. The result was that the evidence can not be completely automated. To address this issue had many options:

1. Property Waiting: allows you to pause script execution until the specified property object is equal to the value specified or until the specified timeout is only

2. Waiting Child: This delays the execution of the functions of the script for the specified period or until the specified object.

3. BUT these tricks do not work for the processing time of 30 minutes. This was the work on monitoring the CPU usage. Since the process this function. CPU Usage "will constantly monitor the CPU and will pause script execution until the CPU has been reduced to zero or below. This trick is very effective. Even after 40 minutes of processing time, I follow my script execution as intended. Wait for the circuit to the CPU usage is 0.

Wednesday, December 2, 2009

How to Create HTML Elements

An element consists of five basic parts: an opening tag, the element's content, and finally, a closing tag.

  1. <p> - opening paragraph tag
  2. Element Content - paragraph words
  3. </p> - closing tag

Every (web)page requires four critical elements: the html, head, title, and body elements.

 

1.The <html> Element...</html>

<html> begins and ends each and every web page. Its sole purpose is to encapsulate all the HTML code and report the HTML document to the world wide web browser. Recall to close your HTML documents with the corresponding </html> tag at the bottom of the document.

Example:-HTML Code

<html>
</html>

2.The <head> Element

Other elements used for scripting (JavaScript) and format (CSS), finally appeared and you have to put in your head element. For now, the top element will remain empty, except for the title element is presented below.

Example:- HTML Code

  1.    <html>
  2. <head>
  3. </head>
  4. </html>

 

3.The <title> Element

Place the labels are displayed at the top of your browser from a spectator. Here is the html code:

Example;- HTML Code

  1. <html>
  2. <head>
  3. <title>My WebPage!</title>
  4. </head>
  5. </html>

 

Save the file & open it in your browser. You ought to see "My WebPage!" in the upper-left, as the window's title.

The name of your website as you note that the best titles are short and descriptive.

4.The <body> Element

The element is where all the content. (Paragraphs, tables, etc..) In the menu on the left indicates, searching each one of these elements in greater detail in the tutorial progresses. For now, only important to understand that the body element encapsulate the entire contents of your site visible.

Example:- HTML Code

  1. <html>
  2. <head>
  3. <title>My WebPage!</title>
  4. </head>
  5. <body>
  6. Hello World! All my content goes here!
  7. </body>
  8. </html>

 

Go ahead and view your first, complete webpage.

How to Create HTML Email

Make an HTML email link on your page is quick and easy. However, you should know that when you put your email on your website is very easy for security experts to implement programs to harvest these types of emails to send spam. If you go to put your email link on a public website, make sure you have anti-spam software!

Another option to permit people to send you emails without exposing yourself to large amounts of spam is to generate an HTML form that gathers information from the user and emails it to your email account. They recommend the HTML Form Email that usually reduces the amount of potential spam.

Put HTML Email Tag

There actually is not a separate HTML tag for generating an HTML email link. In lieu you use a standard HTML anchor tag <a> & set the href property equal to the email adddress, than specifying a web URL. This is probably confusing & may take a small while to get used to.

Example:- HTML Code

  1. <a href= "mailto:abc@mail.com" >Email Example</a>

Email Link:

Email Example

Additional HTML Email Code

By adding a few extra benefits to the email address href can be both subject & body of the email for your visitors automatically populated. This is great when receiving emails from a website email account that handles e-mail more than three link on your site.

By defining a uniform object that people will automatically whenever you click on the link that will be able to see immediately whether an email came from the website or from another source (if your visitors do not mess with the subject you les).

· Subject - Fill in the email subject with the information you provide.

· Body - Complete the body of the email with the information you provide.

Example:-HTML Code

  1. <a href= "mailto: a@b.com?subject=Web Page Email&body=This email
  2. is from your website" >
  3. 2nd Email Example</a>

How to Create Html Lists

There are 3 different types of lists.A tag starts an ordered list, for unordered lists, and for definition lists. Use the type attributes and begin to adjust their schedules accordingly.

  • <ul> - unordered list; bullets
  • <ol> - ordered list; numbers
  • <dl> - definition list; dictionary

1.HTML Ordered Lists

Use the <ol> tag to start an ordered list. Place the <li> (list item) tag between your opening <ol> & closing </ol> tags to generate list items. Ordered basically means numbered, as the list below demonstrates.

Example:- HTML Code

  1. <h4 align="center">Goals</h4>
  2. <ol>
  3. <li>Find a Job</li>
  4. <li>Get Money</li>
  5. <li>Move Out</li>
  6. </ol>

 

Design Numbered list:

  1. Find a Job
  2. Get Money
  3. Move Out

Nothing fancy here, start basically defines which number to start numbering with.

2.HTML Ordered Lists Continued

There are 4 other types of ordered lists. In lieu of generic numbers you can replace them with Roman numberals or letters, both capital & lower-case. Use the type attribute to change the numbering.

Example:- HTML Code

 

  1. <ol type="a">
  2. <ol type="A">
  3. <ol type="i">
  4. <ol type="I">

 

Design Ordered List Types:

Lower-Case

  1. Find a Job
  2. Get Money
  3. Move Out

LettersUpper-Case

  1. Find a Job
  2. Get Money
  3. Move Out

LettersLower-Case

  1. Find a Job
  2. Get Money
  3. Move Out

NumeralsUpper-Case Numerals

  1. Find a Job
  2. Get Money
  3. Move Out

3.HTML Unordered Lists

Create a bulleted list with the label. The bullet comes in four flavors: squares, discs, and circles. The bullet is displayed by default by most browsers is the traditional full disc.

Example:- HTML Code

<h4 align="center">Shopping List</h4>
<ul>
<li>Milk</li>
<li>Toilet Paper</li>
<li>Cereal</li>
<li>Bread</li>
</ul>

 

Design Unordered Lists:

  • Milk
  • Toilet Paper
  • Cereal
  • Bread

Here's a look at the other flavors of unordered lists may look like.

Example:- HTML Code

  1. <ul type="square">
  2. <ul type="disc">
  3. <ul type="circle">

 

Design Unordered List Types:

type="square"

  • Milk
  • Toilet Paper
  • Cereal
  • Bread

type="disc"

  • Milk
  • Toilet Paper
  • Cereal
  • Bread

type="circle"

  • Milk
  • Toilet Paper
  • Cereal
  • Bread

HTML Page Titles

To add a title to your page, change your code so that it looks like this:

 

 

 

 

 

 

 

 

  1. <html>
  2.  
  3. <head>
  4.     <title>My first web page</title>
  5. </head>
  6.  
  7. <body>
  8.     This is my first web page
  9. </body>
  10.  
  11. </html>

We have added two new elements here, that start with the head tag and the title tag (and see how both of these close).
The head element (that which starts with the <head> opening tag and ends with the </head> tag) appears before the body element (starting with <body> and ending with </body>) and contains information about the page. The information in the head element does not appear in the browser window.

Sponsored Ad

More Related Articles

Website Update

Followers