ァィゥェォャュョ
ガギグゲゴ
ザジズゼゾ
ダヂヅデド
バビブベボ
RangeValidator의 minValue:ア maxValue:ン 의 경우
ガギグゲゴ
ザジズゼゾ
ダヂヅデド
バビブベボ
약간의 차이가 생긴다..
고로..
내가 써야할것은
그나저나 CustomValidator는 ClientScript로 먹어주려나 모르겠군..
지난 금요일 VSUG의 첫번째 주제였던 VSTO 3.0에 관한 내용을 적어둔다.(까먹지말라고)
오피스 2007과 VS2008을 이어주는 녀석이 VSTO 3.0이다.
좀더 원활히 다루기위해 Open Xml Format SDK 1.0(2.0은 현재 CTP판)과 CodeSnippet
MainDocumentPart mdp = doc.MainDocumentPart;
WordprocessingCommentsPart cmtPart = mdp.WordprocessingCommentsPart;
XmlDocument docXml = new XmlDocument();
docXml.Load(mdp.GetStream());
XmlNodeList xnl = docXml.GetElementsByTagName(@"w:t");
int i = 0;
foreach (XmlNode node in xnl)
{
node.InnerText = "text" + i;
i++;
}
docXml.Save(mdp.GetStream(FileMode.Create,FileAccess.Write));
doc.Close();
}
다음에 갈아엎을때 도입하고 싶네.. ^^
추가 : http://msdn.microsoft.com/ko-kr/magazine/cc164242.aspx
So you’re sitting there on Saturday morning, sipping on a nice warm cup of coffee or tea. You smell the freshness of the morning, and whipping up some html, CSS and trying out some new AJAX programming. You’re stuck on something! You wish you had a quick cheat sheet to get you back on track. Look no further if you’re a web developer! This is the Ultimate Web Development Cheat Sheet Guide!
Check Out Part 2 of this List!
Ultimate Server-Side Web Development Cheat Sheets - As Promised! Enjoy!
10 of The Best Wed Development FireFox Extensions!
10 Must Have Web Development FireFox Extensions - Check it Out!
Addison-Wesley’s JavaScript Reference Card
JavaScript and Browser Objects Quick Reference
JavaScript in 10 Minutes - Thanks Joseph
Design 215 CSS Quick Reference
HTML Character Entities Cheat Sheet
Character Entity References in HTML 4 and XHTML 1.0
Scriptaculous Combination Effects Cheat Sheet
Scriptaculous Cheat Sheet - Thanks Joseph
ASP.net AJAX Client Life-Cycle Events
MooTools Cheat Sheet - Thanks Joseph
Microformats Helper Cheat Sheet
Jack Daniel’s Microformats Cheat Sheet
Browser Compatibility Interactive Table
XML TopicMaps 1.0 - Quick Reference Card
XML Schema - Structures Quick Reference
XML Schema - Data Types Quick Reference
Check Out Part 2 of this List!
Ultimate Server-Side Web Development Cheat Sheets - As Promised! Enjoy!
10 of The Best Wed Development FireFox Extensions!
10 Must Have Web Development FireFox Extensions
출처 : http://www.realsoftwaredevelopment.com/ultimate-web-development-cheat-sheet-guide/
IIS의 connection에 대한 문답
http://forums.microsoft.com/TechNet-KO/ShowPost.aspx?PostID=2268821&SiteID=31
IE6에선 별반 차이 없어보이는 이 두녀석..
브라우저별로 동작이 아주 약간 다르다..
event가 끼었을경우 이야기다.
키가 눌렀을때 인식하는 키값을 알아오는것이
event.keyCode
문젠 Firefox의경우 keypress로 처리해버리면
키값이 설정되기 전에 실행해버리기때문에 키값을 얻을 수 없다.
결국 keydown으로 처리
그외에 필요없는 키 입력을 필터링 해버리는 작업을 했다.
아래의 필터제외 대상은 키보드의 숫자. 키패드의 숫자 및 기본적 조작키
키입력 이벤트 취소가 IE와 FF&Chrome의 처리법이 다르므로 분기 작성..
function onlyNumber(evt)
{
if ((evt.keyCode<8)||((evt.keyCode>9)&&(evt.keyCode<35))||((evt.keyCode>57)&&(evt.keyCode<96))||(evt.keyCode>105))
{
if(navigator.appName == "Microsoft Internet Explorer")
{
evt.returnValue = false;
evt.cancelBubble = true;
}
if(evt.preventDefault)
{
evt.preventDefault();
evt.stopPropagation();
}
}
}
아래는 event.keyCode의 값들이다.
Key code | Value |
---|---|
DOM_VK_CANCEL | 3 |
DOM_VK_HELP | 6 |
DOM_VK_BACK_SPACE | 8 |
DOM_VK_TAB | 9 |
DOM_VK_CLEAR | 12 |
DOM_VK_RETURN | 13 |
DOM_VK_ENTER | 14 |
DOM_VK_SHIFT | 16 |
DOM_VK_CONTROL | 17 |
DOM_VK_ALT | 18 |
DOM_VK_PAUSE | 19 |
DOM_VK_CAPS_LOCK | 20 |
DOM_VK_ESCAPE | 27 |
DOM_VK_SPACE | 32 |
DOM_VK_PAGE_UP | 33 |
DOM_VK_PAGE_DOWN | 34 |
DOM_VK_END | 35 |
DOM_VK_HOME | 36 |
DOM_VK_LEFT | 37 |
DOM_VK_UP | 38 |
DOM_VK_RIGHT | 39 |
DOM_VK_DOWN | 40 |
DOM_VK_PRINTSCREEN | 44 |
DOM_VK_INSERT | 45 |
DOM_VK_DELETE | 46 |
DOM_VK_0 | 48 |
DOM_VK_1 | 49 |
DOM_VK_2 | 50 |
DOM_VK_3 | 51 |
DOM_VK_4 | 52 |
DOM_VK_5 | 53 |
DOM_VK_6 | 54 |
DOM_VK_7 | 55 |
DOM_VK_8 | 56 |
DOM_VK_9 | 57 |
DOM_VK_SEMICOLON | 59 |
DOM_VK_EQUALS | 61 |
DOM_VK_A | 65 |
DOM_VK_B | 66 |
DOM_VK_C | 67 |
DOM_VK_D | 68 |
DOM_VK_E | 69 |
DOM_VK_F | 70 |
DOM_VK_G | 71 |
DOM_VK_H | 72 |
DOM_VK_I | 73 |
DOM_VK_J | 74 |
DOM_VK_K | 75 |
DOM_VK_L | 76 |
DOM_VK_M | 77 |
DOM_VK_N | 78 |
DOM_VK_O | 79 |
DOM_VK_P | 80 |
DOM_VK_Q | 81 |
DOM_VK_R | 82 |
DOM_VK_S | 83 |
DOM_VK_T | 84 |
DOM_VK_U | 85 |
DOM_VK_V | 86 |
DOM_VK_W | 87 |
DOM_VK_X | 88 |
DOM_VK_Y | 89 |
DOM_VK_Z | 90 |
DOM_VK_CONTEXT_MENU | 93 |
DOM_VK_NUMPAD0 | 96 |
DOM_VK_NUMPAD1 | 97 |
DOM_VK_NUMPAD2 | 98 |
DOM_VK_NUMPAD3 | 99 |
DOM_VK_NUMPAD4 | 100 |
DOM_VK_NUMPAD5 | 101 |
DOM_VK_NUMPAD6 | 102 |
DOM_VK_NUMPAD7 | 103 |
DOM_VK_NUMPAD8 | 104 |
DOM_VK_NUMPAD9 | 105 |
DOM_VK_MULTIPLY | 106 |
DOM_VK_ADD | 107 |
DOM_VK_SEPARATOR | 108 |
DOM_VK_SUBTRACT | 109 |
DOM_VK_DECIMAL | 110 |
DOM_VK_DIVIDE | 111 |
DOM_VK_F1 | 112 |
DOM_VK_F2 | 113 |
DOM_VK_F3 | 114 |
DOM_VK_F4 | 115 |
DOM_VK_F5 | 116 |
DOM_VK_F6 | 117 |
DOM_VK_F7 | 118 |
DOM_VK_F8 | 119 |
DOM_VK_F9 | 120 |
DOM_VK_F10 | 121 |
DOM_VK_F11 | 122 |
DOM_VK_F12 | 123 |
DOM_VK_F13 | 124 |
DOM_VK_F14 | 125 |
DOM_VK_F15 | 126 |
DOM_VK_F16 | 127 |
DOM_VK_F17 | 128 |
DOM_VK_F18 | 129 |
DOM_VK_F19 | 130 |
DOM_VK_F20 | 131 |
DOM_VK_F21 | 132 |
DOM_VK_F22 | 133 |
DOM_VK_F23 | 134 |
DOM_VK_F24 | 135 |
DOM_VK_NUM_LOCK | 144 |
DOM_VK_SCROLL_LOCK | 145 |
DOM_VK_COMMA | 188 |
DOM_VK_PERIOD | 190 |
DOM_VK_SLASH | 191 |
DOM_VK_BACK_QUOTE | 192 |
DOM_VK_OPEN_BRACKET | 219 |
DOM_VK_BACK_SLASH | 220 |
DOM_VK_CLOSE_BRACKET | 221 |
DOM_VK_QUOTE | 222 |
DOM_VK_META | 224 |
t,.찾아본결과 자바스크립트 이벤트중 인수를 가진 메소드를 등록하는 방법은
고전적인 방법으로 태그에 삽입하는법과
동적으로 메소드로 치환하여 할당하는 법
두가지가 있다. 는 결론..
전자는 생략
후자
^^
Q. Button의 onclick 이벤트 발생 시,
onclick_button() 이라는 이벤트 핸들러가 수행되도록 설정하려면 어떻게 해야할까?
: 객체의 이벤트리스너에 이벤트핸들러를 등록한다.
* 이벤트 핸들러 == 이벤트 처리기, 이벤트 발생 시 수행되는 함수
* 이벤트 리스너 == 이벤트 발생 인지기, 이벤트 발생을 인지하고, 수행할 함수들을 알고 있다.
1,2번은 간편하게 사용되는 등록방법이고,
3번에서 제시되는 등록방법과 삭제방법을 모두 사용하면 이벤트 처리과정을 상세하게 다룰 수 있다.
1. HTML 태그에서 등록
형 식 |
사 용 예 |
event = "eventHandler()" | <input type="button" onclick="onclick_button()"> |
* 이벤트핸들러에 ""와 ()를 꼭 사용
2. javascript에서 등록
형 식 |
사 용 예 |
object.event = eventHandler; |
var btn = document.getElementById("btn"); btn.onclick = onclick_button; |
3. 이벤트 리스너에 등록 / 삭제 (이벤트에 ""를 사용)
3.1 등록
case #1. - InternetExplorer (이하 IE)
형 식 |
사 용 예 |
obj.attachEvent("event", eventHandler) |
var btn = document.getElementById("btn"); btn.attachEvent("onclick", onclick_button); |
case #2. - FireFox 및 기타 브라우저 (이하 FF)
형 식 |
사 용 예 |
obj.addEventListener("event", eventHandler, bool) |
var btn = document.getElementById("btn"); btn.addEventListener("click", onclick_button, false); |
* "event" 이름 앞의 on 빠지는 것에 주의 (IE: onclick <--> FF: click)
* bool: capture 여부
자세한 사항은 W3C의 HTML 이벤트처리 권고안 또는 이벤트 처리 상세내용(DOM 레벨1) 참고
case #3. - 크로스 브라우저 (IE, FF 등 모든 브라우저에서 사용할 수 있도록)
형 식 |
사 용 예 |
각 브라우저가 제공하는 이벤트리스너를 확인 if (obj.attachListener) { // IE obj.attachEvent("event", eventHandler); } else if (obj.addEventListener) { // FF obj.addEventListener("event", eventHandler, bool); } |
var btn = document.getElementById("btn"); if (btn.attachListener) { // IE btn.attachEvent("onclick", onclick_button); } else if (btn.addEventListener) { // FF btn.addEventListener("click", onclick_button, false); } |
* IE 7.0 이상에서는 if (window.ActiveXObject)를 사용하여 IE 브라우저임을 확인 (XMLHttpRequest 참조)
3.2 삭제 (3.1 case #3.에 대응)
형 식 |
사 용 예 |
각 브라우저가 제공하는 이벤트리스너를 확인
if (obj.attachListener) { // IE obj.detachEvent("event", eventHandler); } else if (obj.addEventListener) { // FF obj.removeEventListener("event", eventHandler, bool); } |
var btn = document.getElementById("btn");
if (btn.attachListener) { // IE btn.detachEvent("onclick", onclick_button); } else if (btn.addEventListener) { // FF btn.removeEventListener("click", onclick_button, false); } |
* detachEvent 및 removeEventListener의 사용 시 인수들의 순서는
attachEvent 와 addEventListener와 동일하다. (3.1 참조)
<예제> 1. "크기 바꾸는 스타일 적용" 버튼을 누르면, 텍스트상자의 크기가 변하고, <-- changeHeight() 함수 호출
2. "새 버튼 생성" 버튼을 누르면, 새 버튼이 생성되어 화면에 추가된다. <-- createButton() 함수 호출
3. "메시지 창 띄우기" 버튼을 누르면, 메시지 창이 화면에 나타난다. <-- alertButton_click() 함수 호출
1. HTML 태그에 직접 / 2. javascript에서 직접 / 3. javascript에서 이벤트 리스너에
각각 이벤트 핸들러 함수를 등록하여, 이벤트가 발생했을 때 수행되도록 작성했다. " " 및 ( ) 표시에 주의!
JavaScript에서 this는 다른 언어에서와 마찬가지로, 해당 함수가 속해있는 객체를 가리킨다. 전역 함수의 경우에 this는 window 객체를 가리킨다.
다음의 예제는 hello 함수를 하나 선언한 후에, 서로 다른 클래스에서 hello 함수를 메소드로 등록하여 사용하는 예제이다.
function hello()
{
alert("Hi, I'm "+ this.name);
}
function ClassA()
{
this.name = "A";
}
function ClassB()
{
this.name = "B";
}
var a = new ClassA;
a.hello = hello;
a.hello();
var b = new ClassB;
b.hello = hello;
b.hello();
* JavaScript의 이벤트 핸들러 등록 방법
JavaScript에서 이벤트 핸들러를 등록하는 방법에는 세 가지가 있다.
1) [Object].addEventListener("name_of_event", fnHandler, bCapture);
DOM에서 사용하는 방법이다. (IE에서는 지원하지 않는다.) 여러 개의 이벤트 핸들러를 등록할 수 있다.
2) [Object].attachEvent("name_of_event_handler", fnHandler);
IE 에서 사용하는 방법이다. MSIE에서는 이벤트가 발생했을 때, capturing phase가 없기 때문에 이 함수에는 세번째 인자가 없다. addEventListener 함수를 사용할 때, bCapture=false로 한 것과 같다. 역시 여러 개의 이벤트 핸들러를 등록할 수 있다.
3) [Object].name_of_event_handler = fnHandler;
JavaScript에서 이벤트 핸들러를 등록하는 전통적인 방법인 대입법이다. 호환성이 좋으나 이벤트 핸들러를 하나밖에 등록할 수 없다.
그래서, 여러 브라우저에서 동작하도록 이벤트 핸들러 등록 함수를 만들때 다음과 같이 한다. Professional JavaScript for Web Developers(Wrox) p.292에 나온 예제이다.
EventUtil.addEventHandler = function (oTarget, sEventType, fnHandler)
{
if (oTarget.addEventListener)
{ //for DOM-compliant browsers
oTarget.addEventListener(sEventType, fnHandler, false);
}
else if (oTarget.attachEvent)
{ //for IE
oTarget.attachEvent("on" + sEventType, fnHandler);
}
else
{ //for all others
oTarget["on" + sEventType] = fnHandler;
}
};
정말 이렇게 사용해도 될까?
대부분의 경우에는 문제 없이 동작할 것이다. 하지만, fnHandler 안에서 this를 사용한다면 문제가 될 수 있다. attachEvent 함수를 통해서 등록된 이벤트 핸들러와 대입법으로 등록된 이벤트 핸들러에 대한 IE의 내부적인 동작 방식이 다르기 때문이다.
다음의 예제를 보자.
function onClickEventHandler(event)
{
if (this == window)
{
alert("This is the window object");
}
else
{
alert(this.tagName);
}
}
myObject.onclick = onClickEventHandler;
myObject.attachEvent("onclick", onClickEventHandler);
위와 같이 이벤트 핸들러를 작성하여 테스트를 해 보면 차이점을 좀더 확실히 알 수 있다. 같은 객체에 대해 이벤트 핸들러를 두 개 등록했으며, myObject 객체를 클릭하면 alert 창이 두 번 나타날 것을 예상할 수 있다. 하지만 그 메시지의 내용은 다를 것이다.
대입법으로 이벤트 핸들러를 등록하면, 그 이벤트 핸들러 함수는 해당 객체의 메소드처럼 동작한다. 반면에 attachEvent 함수를 사용하여 등록하면, 이벤트가 발생했을 때 호출될 뿐이지 해당 객체의 메소드가 되는 것은 아니다. 또한, 호출되는 순서도 정해져 있다. 대입법으로 등록된 이벤트 핸들러가 먼저 호출된 후에, attachEvent 함수로 등록된 이벤트 핸들러가 호출된다. attachEvent함수로 등록된 이벤트 핸들러들끼리는 호출 순서의 규칙이 없고 랜덤하게 호출된다. (addEventListener 함수로 등록된 이벤트 핸들러는 등록된 순서대로 호출된다.) 그러므로 위 예제에서 이벤트 핸들러의 등록 순서를 다음과 같이 바꿔도 실제 호출되는 순서는 변함이 없다.
myObject.attachEvent("onclick", onClickEventHandler);
myObject.onclick = onClickEventHandler;
Professional JavaScript for Web Developers(Wrox Press, 2005)에서는 등록할 수 있는 핸들러의 개수만 빼고 모두 같은 거라고 되어있고 이러한 차이점에 대한 언급이 없다. MSDN에는 이런 차이점이 잘 설명되어 있으므로, Microsoft 관련한 의문사항은 MSDN을 살펴보는 습관을 기르자. ㅡㅂㅡ;
===================================================================================================================
출처 : http://mashedon.egloos.com/1484422
Class | Description | |
---|---|---|
![]() |
HtmlAnchor | Allows programmatic access to the HTML <a> element on the server. |
![]() |
HtmlButton | Allows programmatic access to the HTML <button> tag on the server. |
![]() |
HtmlContainerControl | Serves as the abstract base class for HTML server controls that map to HTML elements that are required to have an opening and a closing tag. |
![]() |
HtmlControl | Defines the methods, properties, and events common to all HTML server controls in the ASP.NET page framework. |
![]() |
HtmlEmptyTagControlBuilder | Interacts with the page parser to build HTML server controls that do not have a body or closing tag. This class cannot be inherited. |
![]() |
HtmlForm | Provides programmatic access to the HTML <form> element on the server. |
![]() |
HtmlGenericControl | Defines the methods, properties, and events for all HTML server control elements not represented by a specific .NET Framework class. |
![]() |
HtmlHead | Provides programmatic access to the HTML <head> element on the server. |
![]() |
HtmlHeadBuilder | Interacts with the parser to build an HtmlHead control. |
![]() |
HtmlImage | Provides programmatic access for the HTML <img> element on the server. |
![]() |
HtmlInputButton | Allows programmatic access to the HTML <input type= button>, <input type= submit>, and <input type= reset> elements on the server. |
![]() |
HtmlInputCheckBox | Allows programmatic access to the HTML <input type= checkbox> element on the server. |
![]() |
HtmlInputControl | Serves as the abstract base class that defines the methods, properties, and events common to all HTML input controls, such as the <input type=text>, <input type=submit>, and <input type= file> elements. |
![]() |
HtmlInputFile | Allows programmatic access to the HTML <input type= file> element on the server. |
![]() |
HtmlInputHidden | Allows programmatic access to the HTML <input type=hidden> element on the server. |
![]() |
HtmlInputImage | Allows programmatic access to the HTML <input type= image> element on the server. |
![]() |
HtmlInputPassword | Allows programmatic access to the HTML <input type= password> element on the server. |
![]() |
HtmlInputRadioButton | Allows programmatic access to the HTML <input type= radio> element on the server. |
![]() |
HtmlInputReset | Allows programmatic access to the HTML <input type=reset> element on the server. |
![]() |
HtmlInputSubmit | Allows programmatic access to the HTML <input type= submit> element on the server. |
![]() |
HtmlInputText | Allows programmatic access to the HTML <input type= text> and <input type= password> elements on the server. |
![]() |
HtmlLink | Allows programmatic access to the HTML <link> element on the server. |
![]() |
HtmlMeta | Allows programmatic access to the HTML <meta> tag on the server. |
![]() |
HtmlSelect | Allows programmatic access to the HTML <select> element on the server. |
![]() |
HtmlSelectBuilder | Interacts with the parser to build an HtmlSelect control. |
![]() |
HtmlTable | Allows programmatic access on the server to the HTML <table> element. |
![]() |
HtmlTable.HtmlTableRowControlCollection | Represents a collection of HtmlTableRow objects that are the rows of an HtmlTable control. |
![]() |
HtmlTableCell | Represents the <td> and <th> HTML elements in an HtmlTableRow object. |
![]() |
HtmlTableCellCollection | A collection of HtmlTableCell objects that represent the cells in a single row of an HtmlTable control. This class cannot be inherited. |
![]() |
HtmlTableRow | Represents the <tr> HTML element in an HtmlTable control. |
![]() |
HtmlTableRow.HtmlTableCellControlCollection | Represents a collection of HtmlTableCell objects that are the cells of an HtmlTableRow control. |
![]() |
HtmlTableRowCollection | A collection of HtmlTableRow objects that represent the rows of an HtmlTable control. This class cannot be inherited. |
![]() |
HtmlTextArea | Allows programmatic access to the <textarea> HTML element on the server. |
![]() |
HtmlTitle | Allows programmatic access to the HTML <title> element on the server. |