ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

To Fetch FORM Element value directly in JAVASCRIPT

Below example show how to fetch Form Element value directly in Javascript without use of Document.form

JAVASCRIPT:
<script language="javascript">
function checkTestForm()
{
    with (window.document.frmTest)
    {
        alert(txtPrice.value);       
    }
   
}

</script>

HTML CODE:
<form id="frmTest" name="frmTest" method="post">
<input type="text" id="txtPrice" name="txtPrice" />
<input type="button" id="btn" name="btn"  value="OK"   onclick="return checkTestForm();" />
</form>

To know your computer DRIVE Space using SQL Server

Just copy below code and execute in your SQL Server, you will get your Driver free Space:

DECLARE @OSDriveSpace TABLE
(
  DriveNm char(1),
  FreeDriveSpaceInMB int
)

INSERT INTO @OSDriveSpace
EXEC master.dbo.xp_fixeddrives

SELECT *  FROM @OSDriveSpace

How to provide Simple Custum Error Page in ASP.Net using web.config

Below code need to be included in web.config file
Note : There is already customErrors Tag in Web.config file, you need to replace that.

<system.web>
<customErrors mode="On" defaultRedirect="error.aspx"></customErrors> 
</system.web>

Here error.aspx is page where you can mention your Error Message, which will be shown every time when exception will occur in your project.

How to extract value of GROUP CHECK BOX in PHP

Below given is PHP script to get value of Selected CHECK BOX from group of CHECK BOX and HTML Code for Group of CHECK BOX

$checkbox_value ="";
$temp =$_POST['test_cb'];

while (list ($key,$val) = @each ($temp)) {
$checkbox_value .= "$val,";
}
?>

<input type="checkbox" name="test_cb[]" value="Test1" />Test1
<input type="checkbox" name="test_cb[]" value="Test2" />Test2

How to clear recent project list in VISUAL STUDIO

Follow below given Steps:
  1. Close Visual Studio if it is running.
  2. Start the Registry Editor (Type regedit in Start->Run).
  3. Navigate to this registry key:
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList
  4. Then delete the key that has the project you do not want to keep in the list.

NOTE : Check in all VisualStudio / 5.0 or 8.0 or 9.0, if you dont find project list.

Progress Bar in Update Panel in C#

Use below Code to have Progress Bar in ASP.net with C# using AJAX


<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<asp:UpdateProgress runat="server" ID="UpdateProgress1" 
DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img id="Img1" runat="Server" src="<Path of Gif or motion image file>" height="12"  alt=""/>
</ProgressTemplate>
</asp:UpdateProgress>
</td>
</tr> 
<tr>
<td><asp:Button CssClass="button" Text="Search" runat="server" ID="NewPage" />              
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

To Create WORD FILE and write in it in PHP

Below code is to create WORD file and then write in it. Its simple form, and value entered in Textbox will be written in WORD file.

<?
if($_POST)
{   
    $fp = fopen("test.doc", 'w+');
    $str = "First Name: " .$_POST['fname']."\n";
    $str .= "Middle Name: " .$_POST['mname']."\n";
    $str .= "Last Name: " .$_POST['lname']."\n";
    fwrite($fp, $str);
    fclose($fp);
}
?>

<form method="post">
First Name : <input type="text" name="fname"><br />
Middle Name : <input type="text" name="mname"><br />
Last Name : <input type="text" name="lname"><br />
<input type="submit" name="submit">
</form>