Coding is Fun, Coding is Boring, Coding is Love!
Tutorials and Snippets for easy life.
-
Setting DropDownlist Selected Value from Code Behind in ASP.NET C#
If you have a DropDownList control with some values in your .aspx page you can pre select any values in your code behind file. It can be selected either seting the SelectedIndex property or SelectedValue property. .aspx page: Code Behind .CS file: For the first…
-
SWITCH Statement in ASP.NET C#
I like to use switch statement rather than using continuous if statement or atleast if I have to use more than 3 if statement. The syntax and example can be a good reference. SYNTAX: Example:
-
Iterating Through ServerVariables in ASP.Net and C#
Sometimes you may need to verify all the servervariables to debug your code. Simply iterating through the servervariables collection can bring out the result. The following snippet is suffice to iterate. code behind .aspx file
-
Embedding Windows Media Player into web page
The following snippet shows how to embed media player into a web page. The parmeter FileName value points to the file you want to play. You can also change it to an URL address to link for online radio, television. Both OBJECT and EMBED TAG’S…
-
Rounded background corners using CSS AND HTML
This example utilizes the HTML and CSS to create a rounded corners as the background. The width is constant and the height varies according to the text but still maintaining the rounded corner background. The height and width can be expanding depending upon the text…
-
Setting TextBox Focus on page load using Java Script
A small snippet for Setting TextBox Focus on page load using Java Script. Add the following java script the in the body tag to set the focus. In the snippet “form1” is the form name, “txtBox” is the input text box name.
-
3 level Dynamic Drop Down List using java script
Here is the snippet for 3 level dynamic drop down list using java script. It has category, sub-category1 and sub-category2.
-
IE 6 Upgrade warning using Javascript
E6 is getting outdated and the latest web designs donot look well in IE6. You may add this small javscript snippet in your web pages to show a warning message to the viewers to upgrade their browsers. The user can also close this message. Warning…
-
JavaScript Popup Window
Here is the snippet for JavaScript Popup windows. 1. Just Normal Popup window 2. Popup window with modified features You can set 1 for statusbar, toolbar to show up.