ASP.NET 사이트에서 멤버 관리를 하려고 폼인증을 사용하였다.

하나의 서버에 3개의 다른 사이트를 한 번의 로그인 정보르 관리하려고 자료를 찾다가 다음과 같은 것을 찾게 되었다.

MSDN 사이트

http://msdn.microsoft.com/ko-kr/library/eb0zx8fc%28v=vs.100%29.aspx

 


<configuration>
  <system.web>
    <authentication mode="Forms" >
      <!-- The name, protection, and path attributes must match 
           exactly in each Web.config file. -->
      <forms loginUrl="login.aspx"
        name=".ASPXFORMSAUTH" 
        protection="All"  
        path="/" 
        domain="contoso.com" 
        timeout="30" />
    </authentication>

    <!-- Validation and decryption keys must exactly match and cannot
         be set to "AutoGenerate". The validation and decryption
         algorithms must also be the same. -->
    <machineKey
      validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE" 
      decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F" 
      validation="SHA1" />
  </system.web>
</configuration>


그리고 MachineKey 생성하기 위해서는 다음 사이트에서 이용하면 된다.

http://aspnetresources.com/tools/machineKey

Posted by 노을지기

출처: http://imak47.wordpress.com/2011/06/01/the-type-system-io-packaging-package-is-defined-in-an-assembly-that-is-not-referenced-you-must-add-a-reference-to-assembly-windowsbase/

OpenXMLSDKv2 을 설치한 후 샘플 예제를 했는데, 아래와 같은 에러가 발생하였다.

http://code.msdn.microsoft.com/office/CSOpenXmlExportImportExcel-cb196388


The type ‘System.IO.Packaging.Package’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘WindowsBase’

인터넷을 검색하니 "WindowsBase"을 추가하면 된다고 한다.

Add Reference - .NET - WindowsBase



Posted by 노을지기

Visual Studio 2008

References 에서 추가

- Right button Click on References

- Click "Add Reference.."

- Find "CrystalDecisions.Web" in .Net tab

Posted by 노을지기

Gridview의 특정 부분 필드에 적용하려고 하니 CSS가 제대로 작동하지 않았다.

구글한 결과..

The issue is certainly the size of the <input /> text boxes when in edit mode

Add the <EditRowStyle> element to your gridview to give the edit row a CSS class

<asp:GridView ID="GridView1" runat="server">
    ...
    <EditRowStyle CssClass="GridViewEditRow" /> <%-- add this --%>
</asp:GridView>

Now you can control the size of the textboxes with CSS

.GridViewEditRow input[type=text] {width:50px;} /* size textboxes */
.GridViewEditRow select {width:50px;} /* size drop down lists */
 
textbox 타입이 그냥 text 다.ㅡㅡ;;;
Posted by 노을지기

출처: http://csdotnetcode.blogspot.ca/2007/01/how-to-set-multiple-datakeynames-in.html

//To retrieve the values from a DataKeyNames collection,
        //you can use "Key Names" or "index"


        //Get the values with key names
        string productId = GridView1.DataKeys[e.RowIndex].Values["ProductID"].ToString();
        string orderId = GridView1.DataKeys[e.RowIndex].Values["OrderID"].ToString();

        //Or

        //Get the values with index
        string productId = GridView1.DataKeys[e.RowIndex].Values[0].ToString();
        string orderId = GridView1.DataKeys[e.RowIndex].Values[1].ToString();

위와 같이 사용하면 된다. 이걸 몰라서 삽질..ㅡㅡ;;

 

Posted by 노을지기