What is a Value Type ?

October 12th, 2007

The simplest types in the .NET Framework, primarily numeric and Boolean types, are value types. Value types are variables that contain their data directly instead of containing a reference to the data stored elsewhere in memory. Instances of value types are stored in an area of memory called the stack, where the runtime can create, read, update, and remove them quickly with minimal overhead.
There are three general value types:
- Built-in types
- User-defined types
- Enumerations

Each of these types is derived from the System.Value base type.

Fill HTML DropDown Using Javascript

October 7th, 2007

function FillDropDown()
{
document.frm.dropdown1.innerHTML = “”;
var option1 = document.createElement(‘option’);
option1.appendChild(document.createTextNode(“— Please Select —”));
option1.setAttribute(‘value’, “”);
document.frm.ddType.appendChild(option1);
for(var x = 1; x <= 3; x++)
{
var option = document.createElement(‘option’);
option.appendChild(document.createTextNode(“cat-”+ x));
option.setAttribute(‘value’, x);
document.frm.dropdown1.appendChild(option);
}
}

How to print contents of DataGridView

October 5th, 2007

Hi all,

I am developing a windows based application in C#.Net and using DataGridView 2.0 in my application. What the problem is, I need to print the contents of that dataGridView. I do search alot regarding that but no success.

Anyone having idea about that kindly reply me.

Thanx to all.

JavaScript to Check Characters in a String

October 5th, 2007

//The function given below is use to validate the string in correct format or not. In case of correct format the function will return true as result otherwise will return false.

<script language=’javascript’ type=’text/javascript’>

function IsLettersDigitsChars(strString)
{
       var strValidChars = “?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,()_&-. \n”;
       var strChar;
       var blnResult = true;
       if (strString.length == 0) return false;
       //  test strString consists of valid characters listed above
       for (i = 0; i < strString.length && blnResult == true; i++)
       {
             strChar = strString.charAt(i);
             if (strValidChars.indexOf(strChar) == -1)
             {
                      blnResult = false;
             }
       }
       return blnResult;
}

</script>

JavaScript: To Print the Data of Particular Area

October 1st, 2007

function CallPrint(DivId)
{
 var prtContent = document.getElementById(DivId);

 var WinPrint = window.open(”,”,’left=0,top=0,bottom=0,right=0,width=1003,height=800,toolbar=0,scrollbars=0,status=0′);
WinPrint.document.write(“<STYLE type=text/css media=print>.page {WRITING-MODE: tb-rl; HEIGHT: 80%}</style>”);
WinPrint.document.write(“<link href=StyleSheet.css rel=stylesheet type=text/css />”);

 WinPrint.document.write(prtContent.innerHTML);
 WinPrint.document.close();
 WinPrint.focus();
 WinPrint.print();
 WinPrint.close();
 }
</script>