728x90

 

솔루션에서 다른 프로젝트는 문제 없는데 특정 프로젝트 실행 시 "IIS Express 웹 서버를 시작할 수 없습니다."란 메세지가 떳다.

운영체제나 비쥬얼스튜디오 버전의 문제는 아니겠지만 일단 내 PC 환경은 이렇다.

운영체제 : Windows 10

버젼 : Microsoft Visual Studio 2015

 

영어 에러를 찾아서 검색을 해봤다.

"unable to launch the iis express web server"

내용을 찾아보니 포트 문제라고 해서 포트를 변경해서 해보니 잘 뜬다.

그렇지만 내 경우엔 포트를 바꾸면 안 되는 상황이었다. 현재 포트로 사용하는 포트가 있는지 확인해 보니 사용중인 포트도 없다.

그냥 일차원적으로 일단 재부팅하고 다시 실행해 보니 잘 뜬다. 간단히 문제해결......................

 

포트 변경을 하는 경우

프로젝트 마우스 오른쪽 클릭 - 속성 클릭

사용 중인 포트번호 변경 후 실행

 

사용중인 포트 확인은

cmd(명령 프롬프트) 실행 후 명령어

netstat -ano 를 실행하면 사용중인 포트 확인이 가능하다.

그렇지만 다 필요없고 재부팅 먼저 해보시길...

 

 

 

 

 

 

 

728x90
728x90

 

Windows 10으로 업그레이드 후 Windows 7에서 잘 사용하던 Windows XP Mode 사용이 불가해 졌다. 

Windows 7 PC에 다시 설정하고 깔자니 작업할 때마다 잘 사용하지 않는 PC 자리로 가서 작업하는게 번거로 워서 찾아보니 누군가가 정리 해놓은 자료가 있어서 바로 테스트에 들어갔다.

결과론적으로 설치에는 성공!!

 

일단 Windows XP Mode 설치 파일을 다운로드 받아야 한다. 

 

다운로드 : http://www.microsoft.com/ko-KR/download/details.aspx?id=8002

 

그리고 7-Zip이 깔려 있어야 한다. 

나 같은 경우 이미 설치가 되어 있어서 별도로 설치하진 않았다. 

 

 

 

Windows XP Mode 설치 파일에서 마우스 오른쪽 클릭 -> 7-Zip -> 압축파일 열기를 클릭한다. 

 

 

Sources를 더블 클릭한다.

 

 

 

xpm 파일 열기를 클릭한다. 

 

 

 

아래 화면이 나오면 원하는 위치에 압축 풀기를 한다. 압축을 푼 경로로 가서 VirtualXPVHD 파일을 VirtualXPVHD.vhd. 로 파일명을 변경한다.

 

 

이제부터는 Hyper-V 활성화를 진행해야 한다. 

Win+X를 누른 후 제어판 - 프로그램 및 기능 - 왼쪽에 보이는 Windows 기능 켜기/끄기 를 선택한다. 

또는 Win+R, Win+S 클릭 후 optionalfeatures 명령어를 입력후 Enter를 클릭한다. 

 

찾아보면 Hyper-V 라는 기능이 보일 거다. 체크가 풀려 있는데 체크 해를 한다. 체크 후 확인을 누르면 시스템에 재부팅 된다.

 

 

 

 

재부팅 후 Hyper-V 관리자를 킨다. 

 

Win+X - 제어판 - 관리도구 - Hyper-V관리자 가 보인다. 

 

 

Hyper-V 관리자를 킨다. 

만약에 가상PC에서 네트워크 사용을 해야 한다면 아래와 같이 가상 스위치 관리자를 만들어야 한다.

(처음에 이 설정을 하지 않고 XP-Mode 설치 시 실행은 됐는데 인터넷이 XP-Mode에서 네트워크가 되지 않았다. 그런데 설정 후에는 Window 10 에서 인터넷이 되지 않았다.) - 이부분은 테스트가 필요할 듯!! 

네트워크 연결이 필요하지 않은 경우 이 부분은 제외하고 설치를 진행해도 상관없다. 

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0582485985170300"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-0582485985170300"
     data-ad-slot="1435746307"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

 

 

 

 

이제 다시 XP - Mode 사용을 위한 설정을 한다. 

 

 

 

 

 

 

 

 

 

찾아보기 후 경로는 아까 7-Zip으로 압축을 풀었던 경로에서 이름을 바꾼 VirtualXPVHD를 선택한다.

 

 

 

 

XP-Mode가 추가 된 것을 아래 확인 할 수 있다. 

 

 

XP-Mode를 선택 후 연결 클릭을 하면 가상 컴퓨터 연결 창이 뜬다. 

동그라미 친 부분 (전원)을 클릭한다. 

최초의 설치 시 윈도우 설치를 진행한다. 

 

 

처음 접속 하는 경우 Windows XP 설치가 되고 

 

Windows 로그인 후 XP를 사용 할 수 있다. 

 

 

현재 네트워크 연결 된 부분에 대하여 테스트가 필요하다. 

그 부분만 보완하면 그전에 Windows7에서 사용한 XP-Mode만큼 편하게는 아니지만 Windows 10에서도 Windows XP 사용할 수 있을 듯 하다. 

 

 

참고자료 : http://www.download3k.com/articles/How-to-add-an-XP-Mode-Virtual-Machine-to-Windows-10-or-8-using-Hyper-V-00770

728x90

'개발및업무 > 유용한 Tip' 카테고리의 다른 글

Windows 7 에서 Windows XP 사용하기  (0) 2015.10.06
IIS에서 MIME 형식 지정  (0) 2012.10.11
Exception에 관하여  (0) 2011.10.21
Http와 Https 차이  (0) 2011.10.18
[HTML] 숫자만 입력 받기  (0) 2011.09.20
728x90


Windows 7을 사용 중인데 회사에서 중요하게 사용되는 프로그램 중에 Windows XP에서만 설치해서 사용할 수 있는 프로그램이 있었다. 

그래서 뒤져보니 Windows XP mode 를 사용할 수 있다는 방법을 알아냈다. 

내용은 간단하다 Windows 7에 가상머신으로 Windows XP를 설치해서 사용할 수 있는 방법이다. 

몇 년 동안 잘 사용했었는데 PC를 Windows 10으로 업데이트 한 후로 Windows XP 모드 사용이 불가 했다. 

참고로 Windows XP mode는 Windows 7에서만 사용 가능하다. 그래서 Windows 7 PC에 다시 설치하면서 남기는 블로그이다. ㅠㅠ

추후 Windows 10에서 사용할 수 있는 방법이 생기면 그 리뷰는 따로 작성할 계획이다.


Windows XP mode 설명/다운로드 : http://windows.microsoft.com/ko-kr/windows7/install-and-use-windows-xp-mode-in-windows-7


위에 사이트로 들어가면 Windows XP Mode에 대한 설명이 자세히 되어있다. 

Windows 7이어도 Windows XP Mode를 설치할 수 있는 버전이 존재하기 때문에 본인의 버전 확인을 필히 해야 한다. 



Windows XP Mode 설치 방법 




다운로드는 Windows XP mode 설명/다운로드 페이지 제일 하단에 모두 표시 클릭!!!!


"Windows XP Mode를 다운로드 및 설치하려면"을  클릭 하면 화면이 펼쳐진다. 

거기서 "Windows XP Mode 페이지" 클릭하면 Windows XP Mode 다운로드 페이지로 연결된다. 


Windows XP Mode 다운로드 페이지 : http://www.microsoft.com/ko-KR/download/details.aspx?id=8002



그리고 다시 Windows XP Mode 설명 페이지로 돌아가서, 제일 하단에 모두 표시 클릭!!!


이번에는 "Windows 가상 PC를 다운로드 및 설치하려면"을 클릭한다.

거기서 "Windows 가상 PC 페이지"를 클릭하면 Windows Virtual PC 페이지로 연결 된다. 


Windows Virtual PC 다운로드 페이지 : http://www.microsoft.com/ko-KR/download/details.aspx?id=3702



설치 순서는 상관은 없는 것 같다. 

그런데 나 같은 경우 Windows Virtual PC 설치 후 Window XP Mode 설치를 하였다. 


참고자료 : http://windows.microsoft.com/ko-kr/windows7/install-and-use-windows-xp-mode-in-windows-7

http://www.betanews.net/article/555199 (윈도운 7안에 윈도우 가상머신)






728x90

'개발및업무 > 유용한 Tip' 카테고리의 다른 글

Windows 10에서 Windows XP 사용하기!!  (20) 2015.10.06
IIS에서 MIME 형식 지정  (0) 2012.10.11
Exception에 관하여  (0) 2011.10.21
Http와 Https 차이  (0) 2011.10.18
[HTML] 숫자만 입력 받기  (0) 2011.09.20
728x90

출처 사이트 URL: http://www.dotnetgallery.com/kb/resource18-Gridview-header-checkbox-select-and-deselect-all-rows-using-client-side-Jav.aspx.aspx

 

 

 

 

영어 설명 밑에 제 맘대로 한글로 해석 한 내용 입니다. 해석이 엉망이니 직접 해석하시는 편을 추천합니다.

 

Gridview header checkbox select and deselect all rows using client side JavaScript and server side C#

--> 자바스크립트 또는 서버단 소스를 사용하여 그리드뷰 헤더에 체크 박스 선택 또는 선택 해제

 

 

Introduction

--> 소개


Adding checkbox in gridview header template and select/deselect all rows is a common requirement in most of the asp.net projects and frequently asked questions also. Here I will explain how to add checkbox in header template of gridview and select/deselect all rows using client side javascript and server side code.

--> 체크박스를 그리드 뷰 헤더 템플릿에 추가하고 선택/선택해제는 대부분의 asp.net 프로젝트에서 공통적으로 요구 되는 사항이고 자주 Q&A 된다. 여기서 내가 설명할 것은 GridView Hearder Template에 체크박스를 추가하는 방법과 클라이언트 사이드 자바스크립트와 서버 사이드 코드를 사용하여 전체선택/선택해제 하는 방법이다.

 

 

Add Checkbox in Gridview header template

--> 그리드뷰 헤더 템플리에 체크 박스 추가


Create the asp.net project and drag the gridview control then format as likes below.

--> asp.net 프로젝트를 만들고 그리드뷰 컨트롤을 드래그.(복사하라는건가??) 아래 포맷 처럼 만들어라. 

<asp:GridView ID="GridVwHeaderChckbox" runat="server" AutoGenerateColumns="False"
Font-Names="Verdana" PageSize="5" Width="55%" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px">
<AlternatingRowStyle BackColor="#BFE4FF" />
<PagerStyle BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" />
<HeaderStyle Height="30px" BackColor="#6DC2FF" Font-Size="15px" BorderColor="#CCCCCC"
BorderStyle="Solid" BorderWidth="1px" />
<RowStyle Height="20px" Font-Size="13px" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" />
<Columns>
<asp:BoundField DataField="Emp_Name" HeaderText="Employee Name" HeaderStyle-Width="150px" />
<asp:BoundField DataField="Emp_job" HeaderText="Job title" HeaderStyle-Width="150px" />
<asp:BoundField DataField="Emp_Dep" HeaderText="Department" HeaderStyle-Width="150px" />
<asp:TemplateField ItemStyle-Width="40px">
<HeaderTemplate>
<asp:CheckBox ID="chkboxSelectAll" runat="server" onclick="CheckAllEmp(this);" />
</HeaderTemplate>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemTemplate>
<asp:CheckBox ID="chkEmp" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Using HeaderTemplate of gridview I had added checkbox and also added in Itemtemplate of same column.

--> 그리드 헤더템플릿을 사용 할 때 체크박스를 추가하고 또한 같은 컬럼에 아이템 템플릿을 추가한다.

 

 

Select and deselect using Client side

--> 클라이언트 사이드를 사용하여 선택/선택 해제


I’m loading the few sample employee records in gridview to select/deselect all rows. Below javascript CheckAllEmp function will do select and deselect when check and uncheck in header checkbox.

--> 그리드 뷰에 전체 선택/선택해제 할 수 있는 몇개의 직원 샘플 레코드 기록 loading. 아래 자바스크립트 CheckAllEmp 함수가 선택/선택해제 할 때 헤더 체크박스를 체크/체크해제 할 것이다.

Call this function in gridview headertemplate, checkbox onclick event as shown above.

--> 그리드뷰 헤더템플릿 안의 함수 호출. 체크박스 onclick 이벤트 위에서 보여진 것 처럼.


<script type="text/javascript" language="javascript">
function CheckAllEmp(Checkbox) {
var GridVwHeaderChckbox = document.getElementById("<%=GridVwHeaderChckbox.ClientID %>");
for (i = 1; i < GridVwHeaderChckbox.rows.length; i++) {
GridVwHeaderChckbox.rows[i].cells[3].getElementsByTagName("INPUT")[0].checked = Checkbox.checked;
}
}
</script>


Above javascript code will get gridview client id and loop the each row and get the checkbox id which is available in itemTemplate and make it select/deselect rows. This is the one of the way using client side script.

--> 위의 자바 스크립트 코드는 GridView에 클라이언트 ID를 얻고, 각각의 열의 ItemTemplate에서 사용할 수있는 체크박스 ID를 얻고 선택/선택 해제 할 것입니다. 이는 클라이언트 사이드 스크립트에서 사용하는 방법의 하나이다.

 

 

Select and deselect using Server side

--> 서버단을 사용하여 선택/선택 해제

 

Same functionality we can able to do with server side also. To do this make the changes in HeaderTemplate as like below.

--> 같은 기능을 서버 측에서도 할 수 있다. 아래의 헤더 템플릿을 변경한다.

 

<asp:TemplateField ItemStyle-Width="40px">
                        <HeaderTemplate>
                            <asp:CheckBox ID="chkboxSelectAll" runat="server" AutoPostBack="true" OnCheckedChanged="chkboxSelectAll_CheckedChanged" />
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemTemplate>
                            <asp:CheckBox ID="chkEmp" runat="server"></asp:CheckBox>
                        </ItemTemplate>
                    </asp:TemplateField>

 

Make it autopostback as true and create OnCheckedChanged event in checkbox and add the below code in chkboxSelectAll_CheckedChanged event in code behind part.

--> autopostback 을 true로 만들고, 체크박스에 OnCheckedChanged 이벤트를 생성하고 아래 코드를 chkboxSelectAll_CheckedChanged 이벤트 안 코드비하인드 파트에 추가.

 

protected void chkboxSelectAll_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox ChkBoxHeader = (CheckBox)GridVwHeaderChckboxSrvr.HeaderRow.FindControl("chkboxSelectAll");
            foreach (GridViewRow row in GridVwHeaderChckboxSrvr.Rows)
            {
                CheckBox ChkBoxRows = (CheckBox)row.FindControl("chkEmp");
                if (ChkBoxHeader.Checked == true)
                {
                    ChkBoxRows.Checked = true;
                }
                else
                {
                    ChkBoxRows.Checked = false;
                }
            }
        }

 

Above checked changed event will get the header checkbox id and if header checkbox is checked then find all rows checkbox id and make it all select else deselect all rows

--> 위에 Checked Change 이벤트에서 헤더 체크박스의 아이디를 얻고 만약 헤더 체크 박스의 체크가 됐다면 모든 로우의 체크박스 아이디를 얻고 모두 선택 또는 선택해제.

 

 


I have attached sample code for this. Thank you for reading this article and hope you enjoyed this article. Please provide your feedback and suggestions.

 

 

 

728x90
728x90

출처 사이트 URL: http://www.aspsnippets.com/Articles/GridView-with-CheckBox-Get-Selected-Rows-in-ASPNet.aspx

 

 

 

GridView with CheckBox: Get Selected Rows in ASP.Net

 

HTML Markup
The HTML Markup consists of an ASP.Net GridView with CheckBox in the TemplateField column of GridView. There’s a Button that will fetch the selected rows of GridView and will display the same in another GridView below it.
<asp:GridView ID="GridView1" runat="server" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
    AutoGenerateColumns="false">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:CheckBox ID="chkRow" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" />
        <asp:TemplateField HeaderText="Country" ItemStyle-Width="150">
            <ItemTemplate>
                <asp:Label ID="lblCountry" runat="server" Text='<%# Eval("Country") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<br />
<asp:Button ID="btnGetSelected" runat="server" Text="Get selected records" OnClick="GetSelectedRecords" />
<hr />
<u>Selected Rows</u>
<br />
<asp:GridView ID="gvSelected" runat="server" HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
    AutoGenerateColumns="false">
    <Columns>
        <asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="150" />
        <asp:BoundField DataField="Country" HeaderText="Country" ItemStyle-Width="150" />
    </Columns>
</asp:GridView>
 
 
Namespaces
You will need to import the following namespaces.
C#
using System.Data;
 
VB.Net
Imports System.Data
 
 
Binding the GridView
I have made use of DataTable with some dummy values for this article.
C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
        DataTable dt = new DataTable();
        dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Name"), new DataColumn("Country") });
        dt.Rows.Add("John Hammond", "Canada");
        dt.Rows.Add("Rick Stewards", "United States");
        dt.Rows.Add("Huang He", "China");
        dt.Rows.Add("Mudassar Khan", "India");
        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
}
 
VB.Net
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    If Not Me.IsPostBack Then
        Dim dt As New DataTable()
        dt.Columns.AddRange(New DataColumn(1) {New DataColumn("Name"), New DataColumn("Country")})
        dt.Rows.Add("John Hammond", "Canada")
        dt.Rows.Add("Rick Stewards", "United States")
        dt.Rows.Add("Huang He", "China")
        dt.Rows.Add("Mudassar Khan", "India")
        GridView1.DataSource = dt
        GridView1.DataBind()
    End If
End Sub
 
 
Fetching Selected Records from GridView
On the click of the Button the following event handler is executed. A loop is executed over the GridView Data Rows and CheckBox is referenced. If the CheckBox is checked then the name and country are fetched from the BoundField and the TemplateField Label respectively.
The selected rows are then added to a DataTable which is then bound to the other GridView which displays the selected records
C#
protected void GetSelectedRecords(object sender, EventArgs e)
{
    DataTable dt = new DataTable();
    dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Name"), new DataColumn("Country") });
    foreach (GridViewRow row in GridView1.Rows)
    {
        if (row.RowType == DataControlRowType.DataRow)
        {
            CheckBox chkRow = (row.Cells[0].FindControl("chkRow") as CheckBox);
            if (chkRow.Checked)
            {
                string name = row.Cells[1].Text;
                string country = (row.Cells[2].FindControl("lblCountry") as Label).Text;
                dt.Rows.Add(name, country);
            }
        }
    }
    gvSelected.DataSource = dt;
    gvSelected.DataBind();
}
 
VB.Net
Protected Sub GetSelectedRecords(sender As Object, e As EventArgs)
    Dim dt As New DataTable()
    dt.Columns.AddRange(New DataColumn(1) {New DataColumn("Name"), New DataColumn("Country")})
    For Each row As GridViewRow In GridView1.Rows
        If row.RowType = DataControlRowType.DataRow Then
            Dim chkRow As CheckBox = TryCast(row.Cells(0).FindControl("chkRow"), CheckBox)
            If chkRow.Checked Then
                Dim name As String = row.Cells(1).Text
                Dim country As String = TryCast(row.Cells(2).FindControl("lblCountry"), Label).Text
                dt.Rows.Add(name, country)
            End If
        End If
    Next
    gvSelected.DataSource = dt
    gvSelected.DataBind()
End Sub
 

GridView with CheckBox: Get Selected Rows in ASP.Net

GridView with CheckBox: Get Selected Rows in ASP.Net

728x90

+ Recent posts