http://csharpstepbystep.blogspot.ca/2011/10/aspnet-updateprogress-with.html
http://www.youtube.com/watch?v=_hRs21_dh_s
Wednesday, November 28, 2012
Javascript--enter key disable
How To: Disable Form Submit on Enter Key Press
http://www.bloggingdeveloper.com/post/Disable-Form-Submit-on-Enter-Key-Press.aspx
The post Enter Key as the Default Button describes how to set the default behaviour for enter key press. However, sometimes, you need to disable form submission on Enter Key press. If you want to prevent it completely, you need to use OnKeyPress handler on <body> tag of your page.
<body OnKeyPress="return disableKeyPress(event)">
<script language="JavaScript">
function disableEnterKey(e)
{
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
return (key != 13);
}
</script>
If you want to disable form submission when enter key is pressed in an input field, you must use the function above on the OnKeyPress handler of the input field as follows:
<input type=”text” name=”txtInput” onKeyPress=”return disableEnterKey(event)”>
Normally when you have a form with several text input fields, it is undesirable that the form gets submitted when the user hits ENTER in a field. Some people are pressing the enter key instead of the tab key to get to the next field. They often do that by accident or because they are accustomed to terminate field input that way. If a browser regards hitting ENTER in a text input field as a request to submit the form immediately, there is no sure way to prevent that.
Add the below script to the <head> section of your page. The following code disables the enter key so that visitors of your web page can only use the tab key to get to the next field.
<script type="text/javascript">
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
}
document.onkeypress = stopRKey;
</script>
http://www.bloggingdeveloper.com/post/Disable-Form-Submit-on-Enter-Key-Press.aspx
The post Enter Key as the Default Button describes how to set the default behaviour for enter key press. However, sometimes, you need to disable form submission on Enter Key press. If you want to prevent it completely, you need to use OnKeyPress handler on <body> tag of your page.
<body OnKeyPress="return disableKeyPress(event)">
<script language="JavaScript">
function disableEnterKey(e)
{
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
return (key != 13);
}
</script>
If you want to disable form submission when enter key is pressed in an input field, you must use the function above on the OnKeyPress handler of the input field as follows:
<input type=”text” name=”txtInput” onKeyPress=”return disableEnterKey(event)”>
How to disable the Enter key on HTML form
http://webcheatsheet.com/javascript/disable_enter_key.phpNormally when you have a form with several text input fields, it is undesirable that the form gets submitted when the user hits ENTER in a field. Some people are pressing the enter key instead of the tab key to get to the next field. They often do that by accident or because they are accustomed to terminate field input that way. If a browser regards hitting ENTER in a text input field as a request to submit the form immediately, there is no sure way to prevent that.
Add the below script to the <head> section of your page. The following code disables the enter key so that visitors of your web page can only use the tab key to get to the next field.
<script type="text/javascript">
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
}
document.onkeypress = stopRKey;
</script>
Monday, November 26, 2012
Event viewer
How to Monitor and Respond to Events in Windows
http://answers.oreilly.com/topic/2893-how-to-monitor-and-respond-to-events-in-windows/
Backing Up and Clearing Event Logs
http://technet.microsoft.com/library/ee176696.aspx
http://answers.oreilly.com/topic/2893-how-to-monitor-and-respond-to-events-in-windows/
Backing Up and Clearing Event Logs
http://technet.microsoft.com/library/ee176696.aspx
Sunday, November 25, 2012
ASP.NET authentication and authorization
ASP.NET authentication and authorization
http://www.codeproject.com/Articles/98950/ASP-NET-authentication-and-authorization#Introduction
http://www.codeproject.com/Articles/98950/ASP-NET-authentication-and-authorization#Introduction
Tuesday, November 13, 2012
non www to www
http://weblogs.asp.net/owscott/archive/2009/11/27/iis-url-rewrite-rewriting-non-www-to-www.aspx
IS 7.0 and URL Rewrite, make your Web Site SEO
http://blogs.msdn.com/b/carlosag/archive/2008/09/02/iis7urlrewriteseo.aspxTuesday, October 23, 2012
asp.net anchor
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Test2.aspx#Link">
錨點連結至Test2.aspx</asp:HyperLink>
</div>
</form>
</body>
</html><%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test2.aspx.vb" Inherits="Test2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div>第一行<br />1<br /><br /><br />2<br /><br /><br />3<br /><br /><br />4<br /><br /><br />5<br /><br /><br />6<br /><br /><br />7<br /><br /><br />8<br /><br /><br />9<br /><br /><br />10<br /><br /><br /><a id="Link"></a>錨點連結點11<br /><br /><br />12<br /><br /><br />13<br /><br /><br />14<br /><br /><br />15<br /><br /><br /></div></form></body></html>
Thursday, October 18, 2012
方法一:使用for循环
int []pins = {9,3,7,2}
int []copy = new int[pins.length];
for(int i =0;i!=copy.length;i++)
{
copy[i] = pins[i];
}
int []copy = new int[pins.length];
for(int i =0;i!=copy.length;i++)
{
copy[i] = pins[i];
}
方法二:使用数组对象中的CopyTo()方法
int []pins = {9,3,7,2}
int []copy2 = new int[pins.length];
pins.CopyTo(copy2,0);
int []copy2 = new int[pins.length];
pins.CopyTo(copy2,0);
方法三:使用Array类的一个静态方法Copy()
int []pins = {9,3,7,2}
int []copy3 = new int[pins.length];
Array.Copy(pins,copy3,copy.Length);
int []copy3 = new int[pins.length];
Array.Copy(pins,copy3,copy.Length);
方法四:使用Array类中的一个实例方法Clone(),可以一次调用,最方便,但是Clone()方法返回的是一个对象,所以要强制转换成恰当的类类型。
int []pins = {9,3,7,2}
int []copy4 = (int [])pins.Clone();
int []copy4 = (int [])pins.Clone();
Subscribe to:
Posts (Atom)