프로그래밍 148

ASP.NET 전화번호 구분자로 반환

'-' 구분자가 있으면 구분자로 1,2,3번째 자리를 '|'로 구분하여 반환한다.'-' 구분자가 없으면 9,10,11자리별로 '|'로 구분하여 반환한다. /// /// 전화번호 구분자로 반환 /// /// /// public string GetPhoneNumber(string full) { string ret = string.Empty; if (!String.IsNullOrWhiteSpace(full) && full.Contains("-")) //010-123-1234, 010-1234-5678, 02-123-1234... { ret = full.Substring(0, full.IndexOf("-")); ret += "|" + full.Substring(full.IndexOf("-") + 1, (full..

ASP.NET DropdownList for문으로 만들때 주의할 점

//시작일과 종료일을 한꺼번에...for (int i = 1; i < 32; i++){ string item = i < 10 ? "0" + i.ToString() : i.ToString(); ListItem li = new ListItem(item, item); ddlStartDay.Items.Add(li); ddlEndDay.Items.Add(li);} 시작일과 종료일을 한꺼번에 정의할 경우 두개의 dropdownlist를 하나로 인식하는 경우가 발생한다. //시작일for (int i = 1; i < 32; i++){ string item0 = i < 10 ? "0" + i.ToString() : i.ToString(); ListItem li = new ListItem(item0, item0); ddl..

우편번호 부모창서 요청하고 자식창서 받기

[1] 부모창 : 우편번호 받을 함수// 우편번호 받기function ReceivePostcode(code, code_text) { $('#hfPostcode').val(code); $('#tbxAddres').val(code_text); $('#hfPosttext').val(code_text);} [2] 부모창 : 팝업(자식창)띄우는 함수//지역검색$('#btnPostNumber').click(function () { window.open('Zipcode.aspx?form=btnPostNumber', '201311271043', 'width=550, height=350'); return false;}); [3] 자식창 : 부모창에 우편번호 넘겨주는 함수// 부모창에 우편번호 넘겨주는 함수function..