-1차년도 원문보기
통신기기/방송장비
반도체/전자부품
전기기계
자동차 부품
식품 가공
의약품/화학
-2차년도 원문보기
고무/플라스틱 제조업
제1차 금속산업
조립금속 제품 제조업
일반기계
특수기계
공통(인사/회계)
-3차년도 원문보기
컴퓨터/사무기기 제조업
선박 및 보트 제조업
석유 정제품
봉제/의복 제조업
골판지/종이 제조업
기초 화합물 제조업
물류 서비스업
제과 제조업
유통 서비스업
공통(인사/회계)
◆ 표준모델 적용 방법론
중소기업기술정보진흥원에서 프로세스 모델을 도출하기 위하여 사용된 연차별
프로세스 모델링 방법론
- 1차년도 적용 방법론
- 2차년도 적용 방법론
- 3차년도 적용 방법론
- 웹 개발 방법론
Creating interactive alert, confirm, and prompt boxes using JavaScript

출처 : Creating interactive alert, confirm, and prompt boxes using JavaScript
|
Click here for output: |
<script type="text/javascript"> var x=window.confirm("Are you sure you are ok?") if (x) window.alert("Good!") else window.alert("Too bad") </script>
There are several concepts that are new here, and I'll go over them. First of all, "var x=" is a variable declaration; it declares a variable ("x" in this case) that will store the result of the confirm box. All variables are created this way. x will get the result, namely, "true" or "false". Then we use a "if else" statement to give the script the ability to choose between two paths, depending on this result. If the result is true (the user clicked "ok"), "good" is alerted. If the result is false (the user clicked "cancel"), "Too bad" is alerted instead. (For all those interested, variable x is called a Boolean variable, since it can only contain either a value of "true" or "false").
The third one is:
window.prompt()
Prompt is used to allow a user to enter something, and do something with that info:
Click here for output: |
|
<script type="text/javascript"> var y=window.prompt("please enter your name") window.alert(y) </script>
The concept here is very similar. Store whatever the user typed in the prompt box using y. Then display it.
Checking / UnChecking all checkboxes of the page dynamically in a single click

화면 상의 모든 체크 박스를 단일 클릭으로 모두 Checking, UnChecking 하는 JavaScript
Introduction
Generally we came acroos in this situation when we need to facilitate the user to select or delsect all records of the page at a single click instead of selecting records one by one. You can refer to below picture for example.
Scenario
This generally happens when you are presenting some records into GridView or DataGrid and you are providing a column called Select, instead of checking all records one by one you want to provide links called "Select All" or "DeSelect All" to check and uncheck all checkboxes of the GridView respectively.
Solution
HTML Code
To do that you need to provide a two links as displayed in the picture above. Following is the code for "Select All" and "DeSelect All" link.
<a href="javascript:void(0)" onclick="SelectAllCheckBoxes(true)">Select All</a> | <a href="javascript:void(0)" onclick="SelectAllCheckBoxes(false)">DeSelect All</a>
If Select All link will be clicked then SelectAllCheckBoxes javascript function will fire with parameter as true and when DeSelect All link will be clicked the same function will fire with paramter as false.
JavaScript Code
The code for JavaScript function SelectAllCheckBoxes are as follows
<script language="javascript" type="text/javascript">
function SelectAllCheckBoxes(action)
{
var myform=document.forms['aspnetForm'];
var len = myform.elements.length;
for( var i=0 ; i < len ; i++)
{
if (myform.elements[i].type == 'checkbox')
myform.elements[i].checked = action;
}
}
</script>
In the above function first I am getting the html form element in the myform variables then I am getting the length of all elements on the page. Next I am looping through all the elements and checking for the element whose element type is checkbox as I am only interested about the checkbox element of the page. Once I got the checkbox element I am assiging the checked property to the parameter passed to this function (either true or false) and I am done.
Thats it!!!
Conclusion
Doing this was simpler than I had expected, hope this helps some one. Thanks and Happy Coding !!!
How to get value from TextBox, RadioButtonList, DropDownList, CheckBox through JavaScript

This picture is the UI screenshots of the the code I am going to present in this article
Getting TextBox Value in JavaScript
.aspx page code
Following code will render a TextBox and a Button control as displayed in the picture above.
<table> <tr> <th colspan="2" align="left"> Getting TextBox Value in JavaScript: </th> </tr> <tr> <td> <asp:TextBox ID="txt1" runat="server"></asp:TextBox> </td> <td> <input type="button" value="Submit" onclick="GetTextBoxValue('<%= txt1.ClientID %>')" /> </td> </tr> </table>
JavaScript function
Following code is JavaScript function to get value from TextBox control.
// Get TextBox value function GetTextBoxValue(id) { alert(document.getElementById(id).value); }
Getting DropDownList/ListBox selected value
Following code will render a DropDown (Html select control) and a button as displayed in the picture above.
.aspx code
<table> <tr> <th colspan="2" align="left"> Getting DropDown/ListView Value </th> </tr> <tr> <td> <asp:DropDownList ID="dropDown" runat="Server"> <asp:ListItem Text="Item 1" Value="1" Selected="True"></asp:ListItem> <asp:ListItem Text="Item 2" Value="2"></asp:ListItem> <asp:ListItem Text="Item 3" Value="3"></asp:ListItem> </asp:DropDownList> </td> <td> <input type="button" value="Submit" onclick="GetDropDownValue('<%= dropDown.ClientID %>')" /> </td> </tr> </table>
Following is the JavaScript function to get the value from DropDown control
// Get DropDown value function GetDropDownValue(id) { alert(document.getElementById(id).value); }
Getting RadioButtonList selected value
Following code will render RadioButtons and a button as displayed in the picture above.
.aspx code
<table> <tr> <th colspan="2" align="left"> Getting RadioButton Value </th> </tr> <tr> <td> <asp:RadioButtonList ID="radiobuttonlist1" runat="Server" RepeatLayout="flow" RepeatDirection="horizontal"> <asp:ListItem Text="Radio 1" Value="1" Selected="True"></asp:ListItem> <asp:ListItem Text="Radio 2" Value="2"></asp:ListItem> <asp:ListItem Text="Radio 3" Value="3"></asp:ListItem> </asp:RadioButtonList> </td> <td> <input type="button" value="Submit" onclick="GetRadioButtonValue('<%= radiobuttonlist1.ClientID %>')" /> </td> </tr> </table>
JavaScript Code
Following is the JavaScript function to get the selected value from RadioButtons
// Get radio button list value function GetRadioButtonValue(id) { var radio = document.getElementsByName(id); for (var ii = 0; ii < radio.length; ii++) { if (radio[ii].checked) alert(radio[ii].value); } }
Getting CheckBox checked status
Following code will render a checkbox and a button as displayed in the picture above.
.aspx code
<table> <tr> <th colspan="2" align="left"> Getting Checkbox Value </th> </tr> <tr> <td> <asp:CheckBox runat="server" ID="checkBox1" Text="Check Box" /> </td> <td> <input type="button" value="Submit" onclick="GetCheckBoxValue('<%= checkBox1.ClientID %>')" /> </td> </tr> </table>
JavaScript Code
Following is the JavaScript function to get value from a Checkbox.
// Get Checkbox checked status function GetCheckBoxValue(id) { alert(document.getElementById(id).checked); }
Show/Hide Text using
Following code will render three buttons and a table element having some text as displayed in the picture above.
.aspx code
<b>Show/Hide display text</b><br /> <input type="button" value="Toggle Display Following Text" onclick="ToggleFollowingText('table1')" /> <input type="button" value="Show Only" onclick="ShowOrHide('show', 'table1')" /> <input type="button" value="Hide Only" onclick="ShowOrHide('hide', 'table1')" /> <table id="table1"> <tr> <td style="background-color:Aqua"> This is my hidden text, You can play with it by clicking above button. </td> </tr> </table>
JavaScript Code
Following is the JavaScript function to toggle display the table and show and hide element the table.
// Show/Hide element
function ToggleFollowingText(id)
{
document.getElementById(id).style.display == '' ? document.getElementById(id).style.display = 'none' : document.getElementById(id).style.display = '';
}
// Either show or hide element
function ShowOrHide(condition, id)
{
if (condition == 'show')
document.getElementById(id).style.display = '';
else if (condition == 'hide')
document.getElementById(id).style.display = 'none';
}
DataSet 으로 가져온 데이터를 기반으로 추가로 데이터를 가공할 경우가 필요해서 정리함.
http://www.codeguru.com/forum/showthread.php?t=332574
DataSet ds = RepeaterProductInfo.DataSource as DataSet; DataRow [] row = ds.Tables[0].Select("Sum(ItemPrice)"); strReturnValue = row[0][0].ToString();
DataSet ds = RepeaterProductInfo.DataSource as DataSet; DataRow [] row = ds.Tables[0].Select("ItemPrice = Sum(ItemPrice)"); strReturnValue = row[0][0].ToString();
DataTable.Compute Method
private void ComputeBySalesSalesID(DataSet dataSet) { // Presumes a DataTable named "Orders" that has a column named "Total." DataTable table; table = dataSet.Tables["Orders"]; // Declare an object variable. object sumObject; sumObject = table.Compute("Sum(Total)", "EmpID = 5"); }
Repeater Control and Data Binding - ASP .Net and C#
Introduction:
Data Binding is the process of creating a link between the data source and the presentation UI to display the data. ASP .Net provides rich and wide variety of controls which can be bound to the data. This model of binding data with the data source reduces a lot of code complexity and increases the ease of maintenance of code. This article looks at how to use this data binding feature for a Repeater control in ASP .Net with C# code.
Repeater Control in ASP .Net:
A Repeater control is a light weight control which can be used for simple reporting purposes. It supports basic event-handling like Init, Load, Unload etc., This also supports some basic formatting of data and can be presented to the user. A Repeater control offers limited level of data editing or selecting capabilities. For such editing and updates ASP .Net offers DataList and DataGrid controls.
A Repeater control can be used to build small and Flexible reports with the templates for the items. It supports the following five templates.
- HeaderTemplate : Can be used to create the Header Rows of the Table data being presented by Repeater control.
- FooterTemplate : Can be used to create the Footer Rows of the Table data being presented by Repeater control.
- ItemTemplate : Used for formatting the Items and rows to be displayed.
- AlternatingItemTemplate : Alternating items formatting.
- SeparatorTemplate : Styles for separating rows and columns.
There are many ways in which a control in ASP .Net can be formatted. It is up to the imagination of the programmer to come up with nice formats. For example the Footer rows can be manipulated in such a way that, it can show the summary values or totals etc.,
Repeater Syntax:
|
As given above, the syntax is simply the Repeater tag with the Template types. These templates can be formatted with ItemStyle tags also.
Using DataBinder.Eval method:
The System.Web.UI.DataBinder class provides a useful static method DataBinder.Eval, which can be used to evaluate the data at run time using late binding. This function can be used with the Visual Studio IDE or can be manually coded as
<%# DataBinder.Eval(Container.DataItem,"FieldName","Format") %> |
This evaluates and returns the data at run time. This can be used with Repeater, DataList and DataGrid controls though there will be a performance penalty because of the late binding mechanism used.
Creating a Sample Program with Repeater Control:
Let's create a small sample program with the Repeater control.
- Add a new Webform in an Visual Studio Asp .net application.
- Add a Repeater control to the application. Let us assume that the id of the control is Repeater1.
- Insert the following lines of formatting code in between the opening and closing tags of the <asp:Repeater> control.
-
<HeaderTemplate>
<table cellpadding="5" cellspacing="2" >
<tr bgcolor=Gray>
<td><b>CustomerName</b></td>
<td><b>Country</b></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"CustomerName") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"Country") %></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr bgcolor="#ccccff">
<td><%# DataBinder.Eval(Container.DataItem,"CustomerName") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"Country") %></td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
- The above code just adds the repeater control with formatting for the header rows, data rows and the footer rows. The HeaderTemplate starts the <table> tag with the table heading and the FooterTemplate closes it.
- Now, Add the following code inside the Webform1.aspx.cs, Page_Load event.
DataSet ds = new DataSet();
DataTable dt = ds.Tables.Add("Customer");
dt.Columns.Add("CustomerName",Type.GetType("System.String"));
dt.Columns.Add("Country",Type.GetType("System.String"));
DataRow dr = dt.NewRow();
dr[0]="Testcustomer1";
dr[1]="USA";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0]="Testcustomer2";
dr[1]="UK";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0]="Testcustomer3";
dr[1]="GERMANY";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0]="Testcustomer4";
dr[1]="FRANCE";
dt.Rows.Add(dr);
//Bind the data to the Repeater
Repeater1.DataSource = ds;
Repeater1.DataMember = "Customer";
Repeater1.DataBind();
- The above code creates a dataset to be used with the Repeater control. The repeater's datasource is the Dataset created and the Data member is mentioned as the Table which is created along with the dataset. This enables the Repeater to create the list of items from this customer table.
- Now build the application in Visual Studio .Net and load this page. The data will be shown in a tabular format.
The above sample shows data binding from a statically created data set only. This can be very easily extended to a DataSet generated from database tables, xml files or even DataView s.
Ultimately, this Repeater control can be used for light weight and simple report generation. This has only a very simple level event handling capabilities. Also there is a performance penalty because of using the DataBinder.Eval methods, this can be considered for data which are not modified frequently. If it is a large amount of data, then caching may be considered to improve the performance, though there are some other factors may have to be considered and not discussed here.
Attachments:
Project Files : RepeaterSample.zip
Repeater Class
리피터 컨트롤 (Repeater Contorl) 사용시 빈 데이터 핸들링
강력하고 우아한 리피터 컨트롤을 가지고 빈데이터가 왔을경우 어떻게 표시할 수 있는지 그 처리를 위한 기본 메커니즘을 알아봅시다. 예를 들어 다른 컨트롤인 그리드 뷰 같은 경우, 바인드 되는 데이터가 비어있을 경우를 대비해서 그에 관한 속성을 지원합니다. (EmptyDataTemplate)
그렇지만 리피터 컨트롤에는 그와 같은 속성을 지원하지 않습니다. 다만, 리피터 컨트롤의 고유한 유연성으로 이 기능을 추가 시키기 쉽게 되어있습니다. 그럼 데이터가 비었을때 그와 관련된 메시지를 어떻게 나타내주는지 알아보도록 하겠습니다.
아래 예제는 리피터 컨트롤을 사용하여 테이블을 만들어 내는 코드 입니다.
<asp:Repeater runat="server" ID="Repeater1"> <HeaderTemplate> <table width="80%"> </HeaderTemplate> <ItemTemplate> <tr> <td><asp:Label runat="server" Text='<%# Eval("Model") %>' /></td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>
if (!IsPostBack) { List<Car> cars = new List<Car>(); Repeater1.DataSource = cars; Repeater1.DataBind(); }
만약 위 코드에서 바인딩한 cars 에 빈값이 들어있다면 위 ItemTemplate는 사용되지 않고 리피터 컨트롤은 빈값을 나타내게 됩니다. 아래 코드는 그 결과입니다. Header와 Footer Template만 랜더링 되어있습니다.
<table width="80%"> </table>
위에서 보았듣이 Header나 Footer의 경우 데이터의 유/무와 상관없이 랜더링이 됩니다. 이를 이용하여 데이터를 기반으로 하여 빈 데이터시에 그 내용을 나타내 줄 수 있습니다.
아래 코드를 살펴 보겠습니다.
<table width="80%"> <tr runat="server" visible='<%# ((ICollection)Repeater1.DataSource).Count == 0 ? true : false %>'> <td> There is no data to display </td> </tr>
There are a couple of items that should be noted in the above example.
- The Repeater has been referenced by it's ID.
- The DataSource property of the Repeater has been cast to an ICollection object. DataSource is defined as type object, but when data is bound to it, it must be of type ICollection. We are using the Count property from this interface to determine if the "Empty Data" message should display.
When there are several controls where the Visible property needs to be set, the logic can be moved to the code-behind for the page. This is shown in the following IsDataEmpty property.
protected bool IsDataEmpty { get { ICollection list = Repeater1.DataSource as ICollection; return list.Count == 0 ? true : false; } }
The ASPX will change to reference this property as follows:
<table width="80%"> <tr runat="server" visible='<%# IsDataEmpty %>'> <td> There is no data to display </td> </tr>
Regardless of which approach you use, the resulting HTML will now look like:
<table width="80%"> <tr> <td> There is no data to display </td> </tr> </table>
As shown in the above examples, it is fairly simple to add HTML that will conditionally render based on the presence (or lack) of data bound to a Repeater.
출처 : http://devcenter.auburnrandall.com/Default.aspx?c=Tech&type=post&id=72C# DataTable Group by Example
http://programming.top54u.com/post/C-sharp-DataTable-Group-by-Example.aspxDataTable tbl1 = dset.Tables[0];
DataTable tbl2 = dset.Tables[1];
GridView1.DataSource = tbl2;
GridView1.DataBind();
int counter = 0;
// for each loop to group the records by categoryid
foreach (DataRow dr in tbl2.Rows)
{
DataView dv = tbl1.DefaultView;
dv.RowFilter = "categoryid=" + dr["categoryid"];
GridView grd = (GridView)GridView1.Rows[counter].Cells[0].FindControl("GridView2");
grd.DataSource = tbl1;
grd.DataBind();
counter++;
}
javascript 에서 html 오브젝트 value 가져오기
1과 2는 동일하게 동작한다.
1. ---------------------------------------------
var strWhNm = "<%=txtWhNm.ClientID%>";
var strWhCd = "<%=hfWhCd.ClientID%>";
var strProdClassNm = "<%=txtProdClassNm.ClientID %>";
var strProdClassCd = "<%=hfProdClassCd.ClientID%>";
var strProdNm = "<%=txtProdNm.ClientID %>";
var strProdCd = "<%=hfProdCd.ClientID%>";
var strWhNmValue = document.all[strWhNm].value;
var strWhCdValue = document.all[strWhCd].value;
var strProdClassNmValue = document.all[strProdClassNm].value;
var strProdClassCdValue = document.all[strProdClassCd].value;
var strProdNmValue = document.all[strProdNm].value;
var strProdCdValue = document.all[strProdCd].value;
2. ---------------------------------------------
var strWhNmValue = window.document.forms[0].<%=txtWhNm.ClientID%>.value;
var strWhCdValue = window.document.forms[0].<%=hfWhCd.ClientID%>.value;
var strProdClassNmValue = window.document.forms[0].<%=txtProdClassNm.ClientID%>.value;
var strProdClassCdValue = window.document.forms[0].<%=hfProdClassCd.ClientID%>.value;
var strProdNmValue = window.document.forms[0].<%=txtProdNm.ClientID%>.value;
var strProdCdValue = window.document.forms[0].<%=hfProdCd.ClientID%>.value;
출처 : http://k.daum.net/qna/openknowledge/view.html?qid=2bzvR&q=%BF%A1%B7%AF&nil_no=29440
인터넷 에러메시지를 많이 보셨죠? 그 중에서 가장 대표적인 에러 메시지들을 소개합니다.
빠른 찾기는 ctrl+F 를 누르시면 됩니다.
▶ 403 Forbidden/Access Denied (403 금지/액세스 거부)
이 웹 사이트는 패스워드와 같은 특별한 액세스 승인을 필요로 하는
경우입니다.
▶ 404 Not Found (404 찾을 수 없음)
브라우저가 호스트 컴퓨터는 찾았으나 요청된 특정 도큐먼트를 찾지 못한 경우입니다.
정확한 주소를 입력했는지 확인해 봅니다. 그 페이지는 해당 웹 사이트에서 제거되었을 수도 있고 위치가 바뀌었을 수도 있습니다. 파일명을 떼어내고 주소를 다시 한 번 입력해 봅니다. 즉, 한 단계 위의 웹 사이트를 찾아 봅니다.
▶ 503 Service Unavailable (503 서비스 불가)
해당 웹 사이트의 서버에 과부하가 걸린 경우입니다.
몇 초 후에 다시 시도해 봅니다.
▶ Bad file request (잘못된 파일 요청)
온라인 폼 또는 HTML 코드가 잘못된 경우입니다.
▶ Connection refused by host (호스트의 접속 거부)
위에 있는 ‘403 Forbidden/Access Denied’ 에러와 유사한 상황입니다.
▶ Failed DNS lookup (DNS 찾기 실패)
해당 웹 사이트의 URL이 적절한 IP 주소로 전환될 수 없는 경우입니다.
이런 에러는 상용 사이트에서 빈번하게 발생하는데 IP 주소 전환을 담당하는 컴퓨터들이 과부하 상태에 놓이기 때문이라고 합니다.
물론, 주소를 잘못 입력한 경우에도 발생할 수 있습니다.
주소를 다시 한 번 입력해 보거나, 혼잡하지 않을 것 같은 시간에 다시 시도해 봅니다.
▶ Helper application not found
보조 응용프로그램(helper application)을 필요로 하는 파일을 다운받으려 하는데, 인터넷 익스플로러가 찾지 못하는 경우입니다.
이런 경우에는 아무 Windows 창이나 열어서 ‘보기(V)’의 ‘폴더 옵션(O)’에 있는 ‘파일 형식’ 탭을 선택하여 보조 응용프로그램을 위한 디렉토리 및 파일명이 정확하게 입력되도록 합니다.
▶ Not found (찾을 수 없음)
하이퍼링크가 가리키는 웹 페이지가 더 이상 존재하지 않음을 나타냅니다.
▶ Site unavailable (사이트 사용 불가)
너무 많은 사람들이 동시에 액세스하려 하면 온라인상에 노이즈가 생겨 해당 사이트가 다운될 수도 있고, 아니면 더 이상 그 사이트가 존재하지 않는 경우일 수도 있습니다. 주소를 잘못 입력해도 나올 수 있습니다.
▶ 각 Error 코드별 의미
100 : Continue
101 : Switching protocols
200 : OK, 에러없이 전송 성공
201 : Created, POST 명령 실행 및 성공
202 : Accepted, 서버가 클라이언트 명령을 받음
203 : Non-authoritative information, 서버가 클라이언트 요구 중 일부 만 전송
204 : No content, 클라언트 요구을 처리했으나 전송할 데이터가 없음
205 : Reset content
206 : Partial content
300 : Multiple choices, 최근에 옮겨진 데이터를 요청
301 : Moved permanently, 요구한 데이터를 변경된 임시 URL에서 찾았음
302 : Moved temporarily, 요구한 데이터가 변경된 URL에 있음을 명시
303 : See other, 요구한 데이터를 변경하지 않았기 때문에 문제가 있음
304 : Not modified
305 : Use proxy
400 : Bad request, 클라이언트의 잘못된 요청으로 처리할 수 없음
401 : Unauthorized, 클라이언트의 인증 실패
402 : Payment required, 예약됨
403 : Forbidden, 접근이 거부된 문서를 요청함
404 : Not found, 문서를 찾을 수 없음
405 : Method not allowed, 리소스를 허용안함
406 : Not acceptable, 허용할 수 없음
407 : Proxy authentication required, 프록시 인증 필요
408 : Request timeout, 요청시간이 지남
409 : Conflict
410 : Gone, 영구적으로 사용할 수 없음
411 : Length required
412 : Precondition failed, 전체조건 실패
413 : Request entity too large,
414 : Request-URI too long, URL이 너무 김
415 : Unsupported media type
500 : Internal server error, 내부서버 오류(잘못된 스크립트 실행시)
501 : Not implemented, 클라이언트에서 서버가 수행할 수 없는 행동을 요구함
502 : Bad gateway, 서버의 과부하 상태
503 : Service unavailable, 외부 서비스가 죽었거나 현재 멈춤 상태
504 : Gateway timeout
505 : HTTP version not supported
MS Training Kit
Download details: Visual Studio 2008 Training Kit
Download details: Azure Services Training Kit
Download details: .NET 3.5 Enhancements Training Kit
Download details: Office SharePoint Server 2007 Training
Developer Training Kit
Visual Studio 2010 and .NET Framework 4.0 Training Kit - November Preview
Download details: ASP.NET MVC Training Kit