Monday, May 21, 2007

Restrict User From Ctrl Key Press

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Restrict Ctrl Key Press</title>
<script>
function Restrict()
{
if((window.event.keyCode ==17))
{
alert("Ctrl Key Press In !"+'\r\n'+ "Add Your Own Code Here"); // Add Your Code Here

}
}
</script>
</head>
<body onload="JavaScript:document.body.focus();" onkeydown="Restrict()">
</body>
</html>


(IE Supported)

Saturday, May 19, 2007

JavaScript Get Key Values Or Code On KeyDown

Script
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Find KeyCode</title>
<script language="JavaScript">
function TriggeredKey(e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
alert("keycode: " + keycode);
}
</script>
</head>
<body onkeydown="TriggeredKey(this)">
</body>
</html>




(IE Supported)


Special Keyboard Key(s) Code

KeyCode
Backspace      8
Tab           9
Enter        13
Shift        16
Ctrl         17
Alt          18
Pause/Break   19
Caps Lock     20
Esc          27
Page Up      33
Page Down     34
End          35
Home         36
Left Arrow    37
Print Screen 44
Delete       46
F1           112
F2           113
F3           114
F4           115
F5           116
F6           117
F7           118
F8           119
F9           120
F10          121
F11          122
F12          123

Google Page Creator

Want to create an online photo tour of your vacation or to share the memorable moments with Your Fiends,Peers and others.....

If you Have Gmail Acount It's Enough Get,Set,Go.................

             Google testing a new product that makes creating your own web pages as easy as creating a document in  a word processor. Google Page Creator is a free tool that lets you create web pages right in your browser and publish them to the web with one click. There's no software to download and no web designer to hire. The pages you create are hosted on Google servers and are available at http://yoursitename.googlepages.com for the world to see.

Courtesy
Courtesy Google

Tuesday, May 15, 2007

Hold Back Or Retain Scroll Bar Postion After PostBack Or Roundtrip

Page Directive

<%Page smartNavigation="True" %>

Global setting

<configuration>
        <system.web>
                 <pages smartNavigation="true"/>
       </system.web>
</configuration>


SmartNavigation Property available only in .NET 1.1,In ASP.NET version 2.0, the SmartNavigation property is deprecated.Use the SetFocus method and the MaintainScrollPositionOnPostback property instead.

Note Regarding SmartNavigation

  1. Eliminating the Flicker caused by navigation Or Postback.
  2. Persisting the scroll position when moving from page to page.
  3. Persisting element focus between navigations.

Delete File If Exists Else Create

This Porgarm will delete a file with name Test.txt if exists in the Root Dir, else create a new file with name Test.txt with in the Root dir.FileInfo and File both the classes are available in System.IO namespace.

FileInfo Class
Provides instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. This class cannot be inherited.

File Class
Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.



Program

protected void btCreate_Click(object sender, EventArgs e)
{
try
{
FileInfo TheFile = new FileInfo(MapPath(".") + "\\" + "Test.txt");
if (TheFile.Exists)
{
File.Delete(MapPath(".") + "\\" + "Test.txt");
}
else
{
File.Create(Server.MapPath(".") + "\\" + "Test.txt");
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}

Saturday, May 12, 2007

CSS Compressor



CSS Compressor
    Use this utility to compress your CSS to increase

loading speed and save on bandwidth as well. You can

choose from three levels of compression, depending on

how legible you want the compressed CSS to be versus

degree of compression.The "Normal" mode should work

well in most cases, creating a good balance between

the two.

Try Google Suggest And Feel The Difference



Try Google Suggest And Feel The Difference

Wednesday, May 9, 2007

Palindrome

private void btCheck_Click(object sender, System.EventArgs e)
{
char[] Temp = TextBox1.Text.ToCharArray();
Array.Reverse(Temp);
string str = new String(Temp);
if(str == TextBox1.Text)
{
Response.Write(@"<script>alert('Palindrome')</script>");
}
else
{
Response.Write(@"<script>alert('!Palindrome')</script>");
}
}

Wednesday, May 2, 2007

Silverlight

 Microsoft Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of .NET-based media experiences and rich interactive applications for the Web. Silverlight offers a flexible and consistent programming model that supports AJAX, Python, Ruby, and .NET languages such as Visual Basic and C#, and integrates with existing Web applications. Silverlight media capabilities include fast, cost-effective delivery of high-quality audio and video to all major browsers including Firefox, Safari, and Internet Explorer running on Mac or Windows. By using Expression Studio and Visual Studio, designers and developers can collaborate more effectively using the skills they have today to light up the Web of tomorrow.
For More Info

Microsoft® Silverlight™ 1.0 Beta Software Development Kit (SDK)  

Microsoft® Silverlight™ 1.1 Alpha Software Development Kit (SDK) 
 


Microsoft® Silverlight™ 1.1 Alpha Developer Reference Poster




Tuesday, May 1, 2007

Displaying Current Framework Version

private void Page_Load(object sender, System.EventArgs e)
{


if
(!IsPostBack)

{

Version FmVer = Environment.Version;

Response.Write("Version "+FmVer.ToString());

}

}