Response.Write("<meta http-equiv=Content-Type content='text/html; charset=ks_c_5601-1987'>");
'.Net'에 해당되는 글 64건
- 2009.06.30 엑셀 출력시 한글 깨짐방지
- 2009.06.04 Web.config.. 누구냐 넌??
- 2009.06.02 [Linq] Linq To Sql - 시작하기
- 2009.05.27 입력문자의 ascii 코드를 알아보자
- 2009.05.26 [asp.net] 웹서비스 설명 표현
- 2009.05.21 HttpFileCollection 을 사용한 다중 파일 업로드
- 2009.05.20 Asp.Net Hashtable 의 이해
- 2009.05.18 asp.net webpart 개요
- 2009.05.14 ascx 와 ascx 간의 값전달
- 2009.05.11 .net framework 버전 확인
web.config 설정 지정
http://msdn.microsoft.com/ko-kr/library/ms181993.aspx
web.config 파일 만들기
http://msdn.microsoft.com/ko-kr/library/k8x4ket8(VS.80).aspx
asp.net 응용 프로그램용 web.config 만들기
http://support.microsoft.com/kb/815179/ko
출처 : 훈스 닷넷
http://hoons.kr/board.aspx?Name=QAASPNET&Mode=2&BoardIdx=16722&Key=&Value=
http://msdn.microsoft.com/ko-kr/library/ms181993.aspx
web.config 파일 만들기
http://msdn.microsoft.com/ko-kr/library/k8x4ket8(VS.80).aspx
asp.net 응용 프로그램용 web.config 만들기
http://support.microsoft.com/kb/815179/ko
출처 : 훈스 닷넷
http://hoons.kr/board.aspx?Name=QAASPNET&Mode=2&BoardIdx=16722&Key=&Value=
Net Framework 3.X 부터 Linq 라는 기술이 등장했다.
머 설명은 각설하고..
시작하기를 주절대볼까 한다.
그러면 다음과 같은 경고가..
App_Code 폴더를 추가하겠다는 말이니 "예"를 선택한다.
그러면 하얀 화면이 보일것이다..
여기서 서버탐색기 > 새 연결추가 를 선택한다.
그러면 위와 같은 화면에서 Sql Server 를 선택한다..
우리는 Ms-Sql 을 사용할것이니..
위 화면은 익숙할것이다..
NorthWind 데이타 베이스를 사용할것이니..
선택후 연결테스트를 해본다.
서버탐색기에서 익숙한 화면이 보일것이다..
해당 테이블은 Drag & Drop 으로 하얀 화면에 떨어뜨린다.
그러면 위화면처럼 선택이 되고 저장을 하고 닫는다.
App_Code 폴더에 추가된 클래그와 디자인용파일들이 보인다..
참고로 Web.config 에 다음과 같은 연결문자열이 생긴다.
테스트 페이지에 GridView 를 떨어뜨리고..
다음과 같은 코드를 입력해보자..
protected void Page_Load(object sender, EventArgs e) { NorthwindTestDataContext northwind = new NorthwindTestDataContext(); var data = from qNorthwind in northwind.Employees select new { EmployeeId = qNorthwind.EmployeeID, LastName = qNorthwind.LastName, Title = qNorthwind.Title }; this.GridView1.DataSource = data; this.GridView1.DataBind(); }
결과는 위화면 처럼..
참~ 쉽죠~~
코드에 대한 설명은 하지 않는다.
http://msdn.microsoft.com/ko-kr/library/68zt3df9(VS.80).aspx#Mtps_DropDownFilterText
[System.Web.Services.WebMethod(Description = "Hello world 문자열을 반환한다.")] public string HelloWorld() { return "Hello World"; }
이렇게 여러게의 파일컴포넌트가 있다면;;
머 각기 파일 존대 여부를 체크하여 파일을 업로드 하여도 상관은 없다..
하지만..
이왕이면 코드를 줄여보자..
이렇게
HttpFileCollection file = Request.Files; for (int i = 0; i < file.Count; i++) { if (file[i].ContentLength > 0) { HttpPostedFile postedFile = file[i]; string strPath = String.Format("{0}\\{1}", Server.MapPath("~/Files"), System.IO.Path.GetFileName(postedFile.FileName)); postedFile.SaveAs(strPath); }}
이런 코드를 사용하여 유저컨트롤이나 사용자 정의 컨트롤로 멀티 업로드 컴포넌트를 만들어 사용해도 무관하겠다.
//[1]Hashtable 개체 Hashtable ht1 = new Hashtable(); Hashtable ht2 = new Hashtable(); //[2]할당 ht1.Add("a", "aa"); ht1.Add("b", "bb"); ht1.Add("c", "cc"); ht1.Add("d", "dd"); ht1.Add("e", "ee"); ht2.Add(0, "0"); ht2.Add(1, "1"); ht2.Add(2, "2"); //[3]DictionaryEntry 를 사용 foreach (DictionaryEntry de in ht1) { Response.Write(String.Format("key : {0}, value : {1}
", de.Key, de.Value)); } Response.Write("
"); //[4]ICollection 를 사용 ; 값만 ICollection ic = ht1.Values; foreach (string str in ic) { Response.Write(String.Format("values : {0}
", str)); } Response.Write("
"); //[5]ICollection 를 사용 ; 키만 ICollection ic2 = ht1.Keys; foreach (string str2 in ic2) { Response.Write(String.Format("keys : {0}
", str2)); } Response.Write("
"); //[6]인덱스 for (int i = 0; i < ht2.Count; i++) { Response.Write(String.Format("index : {0}, value: {1}", i.ToString(), ht2[i])); Response.Write("
"); } Response.Write("
"); //[7]IEnumerator 사용 ; 값만 IEnumerator ie1 = ht1.Values.GetEnumerator(); while (ie1.MoveNext()) { Response.Write(String.Format("value : {0}
", ie1.Current.ToString())); } Response.Write("
"); //[8]IEnumerator 사용 ; 키만 IEnumerator ie2 = ht1.Keys.GetEnumerator(); while (ie2.MoveNext()) { Response.Write(String.Format("key : {0}
", ie2.Current.ToString())); }
aspx 페이지에 유저 컨트롤의 2개 올려 놓고..
ascx 에 컨트롤들을 public 한 속성으로 지정하고..
(1) 이벤트가 없는 버튼
(2) 텍스트 박스
(3) 리터랄
(1) ascx 의 버튼 이벤트 등록..델리게이트 개념
(2)(3) 이벤트 내용
ascx1 의 텍스트 입력값이 ascx2의 리터랄에 입력됨
Version nowVer = Request.Browser.ClrVersion; Version requireVer = new Version(2, 0, 50727); if (nowVer.Major == 0) { Response.Write("닷넷 프레임워크 없음"); } else { if (nowVer <= requireVer) { Response.Write("1.1.4322 보다 적음"); } Response.Write(nowVer.ToString() + "
" + requireVer.ToString()); }