작년에도 비슷한 것때문에 질문을 받았는데...
그때도 마무리 짓지 못하고 IE의 문제로 보여진다고만 마무리했었다.

다시금 불거져 나왔다.
이번엔 새로운 증상도 추가되었는데
파일명 자체를 인식못해서 download.aspx라고 파일 저장다이얼로그가 나옴(특정 파일명에 한해서)

고로 뒤벼본결과 역시나 IE6,7의 헤더의 길이(지난번과 동일한 답변)가 지나치게 짧아서..
총 256바이트 중 차떼고 포떼고 하면
파일명으로 사용할수 있는것은 170바이트(글자) 남짓

문젠 아스키로면 170자이다보니
파일명 인코딩을 하면
실제로는 UTF-8의 파일명영역은 1,6,9배(문자의 코드의 영역에따라)로 크기가 늘어나버린다.

아래는 1차 조사때의 보고내용

約款チェック支援システムのファイルのダウンロードにおいてのファイル名切れ問題の調査
タウンロード・プロセスによる文字列(ファイル名)の変化
状態 ファイル名 長さ CharacterSet 総サイズ 制限
アップロード前 あいうえおかきくけこさしすそたち.doc 21 UTF-8 55byte  
アップロード後(サーバー) [12345678]あいうえおかきくけこさしすそたち.doc 31 UTF-8 67byte  
結果ファイル(サーバー) [12345678]あいうえおかきくけこさしすそたち_ref.doc 35 UTF-8 71byte  
結果ファイル(転送中) %5b12345678%5d%e3%81%82%e3%81%84%e3%81%86%e3%81%88%e3%81%8a%e3%81%8b%e3%81%8d%e3%81%8f%e3%81%91%e3%81%93%e3%81%95%e3%81%97%e3%81%99%e3%81%9d%e3%81%9f%e3%81%a1_ref.doc 163 ASCII 163byte キャッシュパスのサイズが255~258(ブラウザによる)バイト以下
結果ファイル(クライアント) 345678]あいうえおかきくけこさしすそたち_ref.doc 32      

Http Header
HTTP/1.1 200 OK
Server: ASP.NET Development Server/8.0.0.0
Date: Thu, 18 Jun 2009 05:26:47 GMT
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment;filename=%5b12345678%5d%e3%81%82%e3%81%84%e3%81%86%e3%81%88%e3%81%8a%e3%81%8b%e3%81%8d%e3%81%8f%e3%81%91%e3%81%93%e3%81%95%e3%81%97%e3%81%99%e3%81%9d%e3%81%9f%e3%81%a1_ref.doc
Cache-Control: private
Content-Type: application/unknown; charset=utf-8
Content-Length: 326

文字の変換
文字 CharacterSet 一文字のサイズ 長さ 総サイズ
UTF-8 1~4バイト(可変) 1 3バイト
%E3%81%82 ASCII 1バイト 9 9バイト

UTF-8の規格
長さ 対象 サイズ
一桁 ASCII 1バイト
二桁 記号(ヨーロッパ文字) 6バイト
三桁 日本語、韓国語、中国語など 9バイト
四桁   12バイト

암튼 아래 내용은 한글 관련이지만 어차피 비슷한 내용
http://www.hoons.kr/board.aspx?Name=QAASPNET&Mode=2&BoardIdx=3590&Key=&Value=

이건 마소의 서포트 내용 
http://support.microsoft.com/kb/436616/ja 

위의 내용에 실린 globalization을 설정해보았지만 역시나 해결불가..

인코딩후의 길이가 170 이상이면 zip압축으로 대체로 가닥을 잡았다.
AND

Chrome의 버그(?)

WEB/ASP.NET 2008. 11. 11. 11:23
ASP.NET의 AutoPostBack의 자바스크립트가 Chrome에서 오동작 하는 사례가 발견됨..
내가 만든 소스의 경우 asp:ListItem(HTML의 SELECT)의 selectedIndex가 바뀔때 마다 PostBack을 하도록 작성되었는데..
Chrome은 해당 자바스크립트의 매개변수인 이벤트(evt)가 정의 되어있지않다고 에러가 뜨며(라곤해도 디버거를 봐야만 보임) 동작하지 않음

관련된(과연?) 포스트
validation 문제라는데..
http://weblogs.asp.net/stefansedich/archive/2008/11/04/bug-with-latest-google-chrome-and-asp-net-validation.aspx
AND

일부 처리를 웹서비스를 통해 성능향상을 도모하려 했으니 난관에 부딛혔으니
그건 바로 세션이 공유 되지 않는 다는점이다.

일단 default로는 웹서비스에선 세션이 존재하지 않는다

고로 attribute로 설정을 해주어야하는데
동일 웹 사이트내의 페이지에서 웹서비스를 부르는경우에
웹서비스는 새로운 세션이 할당 되어버린다.

세션을 통한 공유는 불가능하다는 이야기가 되어버린다.

흠 application을 써야하나.. =.=
AND

SELECT에 횡 스크롤이 가능하냐는 질문에 이것저것 답변이 올라왔는데

해결책으로 제시된녀석이 바로 DIV로 씌우기이다.
<DIV [스크롤가능]><SELECT [풀 사이즈]></SELECT></DIV>

이거 말고는 레이어질 밖에 없을듯 싶기도 하고 그렇게 하면 표준을 벗어나기에..

뭐 어쨌든 누가 고맙게도 커스텀 콘트롤로 만들어 놓았네..
언젠가 쓰이지 않을까 하여 안까먹게 적어두기.. (끄적끄적)

http://www.codeproject.com/KB/custom-controls/ListBoxComponent01.aspx
AND


System.Web.UI.HtmlControls밑에 존재하는 클래스들이 있다.

내가 유용하게 이용하는 코딩으로 HTML콘트롤을 추가할때 사용되어지는..

table tr td a input등... 이라고 얼마전까지 알고 있었다.



오늘 발견한 HtmlGenericControl이라는 녀석

이걸 이용하면 클래스 형태로 제공되지 않는 나머지 HTML태그도 콘트롤 형태로 만들수 있다.



어디에 쓰냐고??


element.Controls.Add(요기에..);

이하 HtmlControls의 설명
  Class Description
Public class HtmlAnchor Allows programmatic access to the HTML <a> element on the server.
Public class HtmlButton Allows programmatic access to the HTML <button> tag on the server.
Public class HtmlContainerControl Serves as the abstract base class for HTML server controls that map to HTML elements that are required to have an opening and a closing tag.
Public class HtmlControl Defines the methods, properties, and events common to all HTML server controls in the ASP.NET page framework.
Public class HtmlEmptyTagControlBuilder Interacts with the page parser to build HTML server controls that do not have a body or closing tag. This class cannot be inherited.
Public class HtmlForm Provides programmatic access to the HTML <form> element on the server.
Public class HtmlGenericControl Defines the methods, properties, and events for all HTML server control elements not represented by a specific .NET Framework class.
Public class HtmlHead Provides programmatic access to the HTML <head> element on the server.
Public class HtmlHeadBuilder Interacts with the parser to build an HtmlHead control.
Public class HtmlImage Provides programmatic access for the HTML <img> element on the server.
Public class HtmlInputButton Allows programmatic access to the HTML <input type= button>, <input type= submit>, and <input type= reset> elements on the server.
Public class HtmlInputCheckBox Allows programmatic access to the HTML <input type= checkbox> element on the server.
Public class HtmlInputControl Serves as the abstract base class that defines the methods, properties, and events common to all HTML input controls, such as the <input type=text>, <input type=submit>, and <input type= file> elements.
Public class HtmlInputFile Allows programmatic access to the HTML <input type= file> element on the server.
Public class HtmlInputHidden Allows programmatic access to the HTML <input type=hidden> element on the server.
Public class HtmlInputImage Allows programmatic access to the HTML <input type= image> element on the server.
Public class HtmlInputPassword Allows programmatic access to the HTML <input type= password> element on the server.
Public class HtmlInputRadioButton Allows programmatic access to the HTML <input type= radio> element on the server.
Public class HtmlInputReset Allows programmatic access to the HTML <input type=reset> element on the server.
Public class HtmlInputSubmit Allows programmatic access to the HTML <input type= submit> element on the server.
Public class HtmlInputText Allows programmatic access to the HTML <input type= text> and <input type= password> elements on the server.
Public class HtmlLink Allows programmatic access to the HTML <link> element on the server.
Public class HtmlMeta Allows programmatic access to the HTML <meta> tag on the server.
Public class HtmlSelect Allows programmatic access to the HTML <select> element on the server.
Public class HtmlSelectBuilder Interacts with the parser to build an HtmlSelect control.
Public class HtmlTable Allows programmatic access on the server to the HTML <table> element.
Public class HtmlTable.HtmlTableRowControlCollection Represents a collection of HtmlTableRow objects that are the rows of an HtmlTable control.
Public class HtmlTableCell Represents the <td> and <th> HTML elements in an HtmlTableRow object.
Public class HtmlTableCellCollection A collection of HtmlTableCell objects that represent the cells in a single row of an HtmlTable control. This class cannot be inherited.
Public class HtmlTableRow Represents the <tr> HTML element in an HtmlTable control.
Public class HtmlTableRow.HtmlTableCellControlCollection Represents a collection of HtmlTableCell objects that are the cells of an HtmlTableRow control.
Public class HtmlTableRowCollection A collection of HtmlTableRow objects that represent the rows of an HtmlTable control. This class cannot be inherited.
Public class HtmlTextArea Allows programmatic access to the <textarea> HTML element on the server.
Public class HtmlTitle Allows programmatic access to the HTML <title> element on the server.
AND

다중 업로드

WEB/ASP.NET 2008. 5. 28. 16:43
티스토리식 다중업로드를 찾다가 알게된녀석
그나마 코드 프로젝트중 제일나은듯
http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

플래시를 이용한 업로드이고 화면도 깔끔에 플래시 소스도 공개..
좋아 >_<

사용자 삽입 이미지
사용자 삽입 이미지

음냐냐 그나저나 적용 가능하려나..
플래시에서 데이터 받아오기 지롤인데 ㅠ_ㅠ

*추가
라고 적고보니 이넘은 플렉스 버전이다 =.=
Flex2.0SDK받아서 수작업으로 고쳐서 사용중...
* 요건 상용
http://ajaxuploader.com/
사용자 삽입 이미지

AND

하나의 모달팝업에 여러개의 취소버튼 넣기..
자바스크립트를 이용한 고스트스텝(?) ㅋㅋ
http://mattberseth.com/blog/2007/10/modalpopup_with_multiple_cance.html
AND

보통 인라인 뷰에서 정렬을 시도하면 다음과 같은 에러가 난다.

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.

이럴때 인라인 뷰에서 정렬을 사용하기 위해서는 셀렉트에 TOP 100 PERCENT 를 써주면 된다.
SELECT * FROM
(
   SELECT TOP 100 PERCENT
          TEST1
        , SUM(TEST2) SUM_TEST2
     FROM #TEMP
  GROUP BY TEST1
  ORDER BY SUM(TEST2) DESC
) V


출처 : http://www.lemonee.com/tt/trackback/44
AND

System.Web.HttpResponse objResponse = System.Web.HttpContext.Current.Response;

   objResponse.ClearContent();
   objResponse.ClearHeaders();
   objResponse.ContentType = "application/vnd.msexcel";
   objResponse.AddHeader("content-disposition", "attachment; filename=SearchResults.xls");
   objResponse.AppendHeader("Content-Length", result.Length.ToString());
   objResponse.Charset = "euc-kr";
   objResponse.ContentEncoding = Encoding.GetEncoding(949);
   objResponse.Write(result);
   objResponse.Flush();
   objResponse.Close();
   objResponse.End();

예제는 엑셀 데이터를 다운로드 하는 경우이다. result string 에는 탭으로 분리된 텍스트를 넣어주면 xls파일로 다운로드 된다. 정식 엑셀 파일은 아니고 csv를 xls 확장자로 다운로드 하면 나머지는 엑셀이 알아서 한다. 푸른색으로 된 부분은 한글 코드 문제로 넣어 준것이다. 그냥 Unicode로 보내면 엑셀이 제대로 처리하지 못한다. 이유는 모르겠다.

출처 : http://www.code99.net/Default.aspx?tabid=794&EntryID=186

Exporting DataGrid to Excel

Exporting DataGrid to Excel might sound complex but it's pretty simple. Let's see how this can be done.

Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

The code given above is the complete code to export a DataGrid to an Excel file:

  • Response.AddHeader is letting ASP.NET know that we are exporting to a file which is named FileName.xls.
  • Response.ContentType denotes the type of the file being exported.
  • myDataGrid.RenderControl(htmlWrite) writes the data to the HtmlTextWriter.
  • Response.Write(stringWrite.ToString()); sends the request to the response stream.

As you can see, exporting a DataGrid to an Excel file is pretty simple.

Exporting the DataGrid to a Word file

You can also export a DataGrid to a Word file. You might ask a question that why would anyone like to do that. If you have a Word document which needs a table, then you can simply export the table from the DataGrid to the Word document. The code is similar to the above with minor changes.

Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.word";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

Exporting a DataGrid to a Text File

Sometimes you need to export a DataGrid to a Text file. In this case you need to iterate through the DataSet and concatenate the text to a string or more precisely a StringBuilder object. Let's see how this can be done:

Collapse
Database db = DatabaseFactory.CreateDatabase();
DBCommandWrapper selectCommandWrapper = 
   db.GetStoredProcCommandWrapper("sp_GetLatestArticles");
DataSet ds = db.ExecuteDataSet(selectCommandWrapper);
StringBuilder str = new StringBuilder();

for(int i=0;i<=ds.Tables[0].Rows.Count - 1; i++)
{
  for(int j=0;j<=ds.Tables[0].Columns.Count - 1; j++)
  {
      str.Append(ds.Tables[0].Rows[i][j].ToString());
  }

  str.Append("<BR>");
}

Response.Clear();
Response.AddHeader("content-disposition", 
         "attachment;filename=FileName.txt");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.text";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = 
              new HtmlTextWriter(stringWrite);

Response.Write(str.ToString());
Response.End();

The important thing to note is the two for loops that iterate through the DataSet and append the rows into the StringBuilder object.

Format Issue when Exporting DataGrid to Excel

I would like to thank Sonu Kapoor for helping me with the Format issue in exporting a DataGrid to Excel and Juss for providing the code.

When you export a DataGrid to Excel it loses its format. This means that maybe your DataGrid has a string field which consisted of numbers, say '002345'. But when you export the grid and see it in an Excel file you will find that the number changed to '2345'.

You can solve this problem using Cascading Style Sheets.

Code provided by Juss:

Dim strFileName, strFilePath AsString
Dim oStringWriter AsNew System.IO.StringWriter
Dim oHtmlTextWriter AsNew System.Web.UI.HtmlTextWriter(oStringWriter)
Dim objStreamWriter As StreamWriter
Dim strStyle AsString = "<style>.text { mso-number-format:\@; } </style>"
objStreamWriter = File.AppendText(strFilePath)
DataGrid1.RenderControl(oHtmlTextWriter)
objStreamWriter.WriteLine(strStyle)
objStreamWriter.WriteLine(oStringWriter.ToString())
objStreamWriter.Close()

Most of you might be thinking about that "mso-number-format" stuff in between the code. This is the style in which the column will be exported. For this reason, you need to inject the attribute into the DataGrid column for which you want to change the display format.

DataGrid1.DataBind()
Dim strStyle AsString = "<style>.text { mso-number-format:\@; } </style>"
For intTemp AsInteger = 1 To ds.Tables(0).Rows.Count - 1
   DataGrid1.Items(intTemp).Cells(0).Attributes.Add("class", "text")
Next

You can export in many formats. All you need to know is the mso-number-format:\@;. You can easily find the format by opening an Excel file and typing a number in one of the cells. Now if you want to save this number as a Social Security Pattern (xxx-xx-xxxx), right click on the cell and select a pattern that saves it as a Social Security Number. Next save the Excel file to XML format. Open the XML file in Notepad and see what style the column SSN uses. The SSN style is something like this: mso-number-format:000\-00\-0000.

Simply substitute the new style in the strStyle variable and that's it.

For a complete discussion on this issue, please visit this link.

I hope you liked the article, happy coding!

출처 : http://blog.naver.com/jjigye/30012879332

AND

아래 동영상은 마소의 ASP.net 에서 퍼온것입니다.

 

아래글은 Nx 블로그에서 퍼온글 입니다.


FilteredTextBox 컨트롤은 TextBox 컨트롤에 특정 값만 입력할 수 있는 기능을 제공하는 컨트롤입니다. 즉, 어떠한 TextBox 컨트롤에는 숫자만, 다른 TextBox 컨트롤에는 문자만 입력이 가능한 기능을 제공하는 TextBox 컨트롤을 사용할 때 유용합니다. 기존에는 자바스크립트를 사용하여 유효성 검사를 체크하는 함수를 호출하곤 했는데 FilteredTextBox 컨트롤을 사용하면 그러한 불편을 겪지 않아도 됩니다.

먼저, FilteredTextBox 컨트롤이 가지고 있는 속성부터 알아보도록 하겠습니다.

<ajaxToolkit:FilteredTextBoxExtender ID="ftbe" runat="server"
TargetControlID="TextBox3"
FilterType="Custom, Numbers"
ValidChars="+-=/*()." />


이탤릭체의 속성은 옵션으로 사용할 수 있는 속성입니다.

속성에 대한 설명은 다음과 같습니다.

1. TargetControlID : 동작할 TextBox 컨트롤의 ID입니다.

2. FilterType : TextBox 컨트롤에 적용될 필터의 타입입니다. "Numbers", "LowercaseLetters", "UppercaseLetters", "Custom" 중 하나의 값을 지정하면 되며, "Custom" 속성을 지정하면 ValidChars 속성을 사용하여, 입력할 문자를 설정할 수 있습니다. 또한 "Custom"을 지정하면, 다른 "Numbers", "LowercaseLetters", "UppercaseLetters"와 같은 설정값을 동시에 사용할 수 있습니다.

3. ValidChars : TextBox 컨트롤에 입력할 문자를 정의합니다.

그럼, 웹 폼을 하나 생성하고, 다음과 같이 코드를 작성합니다.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FilteredTextBox.aspx.cs" Inherits="FilteredTextBox" %>


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>제목 없음</title>

</head>

<body>

    <form id="form1" runat="server">

        <asp:ScriptManager ID="ScriptManager1" runat="server">

        </asp:ScriptManager>

        <table border="0" cellpadding="0" cellspacing="0" style="background-color:#959695;" width="600px">

            <tr style="height: 30px" valign="middle">

                <td style="width: 100%; font-size: 11pt; color: White;" align="center" colspan="3">

                    FilteredTextBox Controls

                </td>

            </tr>

            <tr style="height: 30px" valign="middle">

                <td style="width: 1%">

                </td>

                <td style="width: 98%; background-color: White; font-size: 9pt;" align="left">

                    &nbsp;&nbsp;숫자만 입력 가능 : <asp:TextBox ID="txtText1" runat="server" Width="300px"></asp:TextBox>

                </td>

                <td style="width: 1%">

                </td>

            </tr>

            <tr style="height: 30px" valign="middle">

                <td style="width: 1%">

                </td>

                <td style="width: 98%; background-color: White; font-size: 9pt;" align="left">

                    &nbsp;&nbsp;소문자만 입력 가능 : <asp:TextBox ID="txtText2" runat="server" Width="300px"></asp:TextBox>

                </td>

                <td style="width: 1%">

                </td>

            </tr>

            <tr style="height: 30px" valign="middle">

                <td style="width: 1%">

                </td>

                <td style="width: 98%; background-color: White; font-size: 9pt;" align="left">

                    &nbsp;&nbsp;숫자 + 정의된 문자(-)만 입력 가능 : <asp:TextBox ID="txtText3" runat="server" Width="300px"></asp:TextBox>

                </td>

                <td style="width: 1%">

                </td>

            </tr>

            <tr style="height: 2px" valign="middle">

                <td style="width: 100%;" align="center" colspan="3">

                </td>

            </tr>


        </table>


        <cc1:FilteredTextBoxExtender

                                    ID="FilteredTextBoxExtender1"

                                    runat="server"

                                    TargetControlID="txtText1"

                                    FilterType="numbers">

        </cc1:FilteredTextBoxExtender>

        <cc1:FilteredTextBoxExtender

                                    ID="FilteredTextBoxExtender2"

                                    runat="server"

                                    TargetControlID="txtText2"

                                    FilterType="LowercaseLetters">

        </cc1:FilteredTextBoxExtender>

        <cc1:FilteredTextBoxExtender

                                    ID="FilteredTextBoxExtender3"

                                    runat="server"

                                    TargetControlID="txtText3"

                                    FilterType="Custom, numbers"

                                    ValidChars="-">

        </cc1:FilteredTextBoxExtender> 

    </form>

</body>

</html>



3개의 TextBox 컨트롤을 웹 폼에 위치시키고, 또한, 3개의 FilteredTextBoxExtender 컨트롤을 위치시킨 후 각각의 FilteredTextBoxExtender 컨트롤의 TargetControlID를 TextBox 컨트롤의 ID로 지정합니다. 첫 번째 TextBox 컨트롤에는 숫자만 들어가게 하도록, FilteredTextBoxExtender1의 FilterType 속성을 "Numbers"로 정의하고, 두 번째 TextBox 컨트롤에는 소문자만 들어가게 하도록, FilteredTextBoxExtender2의 FilterType 속성을 "LowercaseLetters"로 정의합니다. 또한, 세 번째 TextBox 컨트롤에는 전화번호나 우편번호처럼 숫자와 숫자 사이에 "-" 문자만 들어갈 수 있도록 FilteredTextBoxExtender3의 FilterType 속성을 "Custom, Numbers"로 지정하고, ValidChars 속성을 "-"로 정의합니다.

이제, 웹 브라우저에서 확인해보면 각 FilteredTextBoxExtender 컨트롤에 정의된 FilterType에 맞는 문자 또는 숫자만 각 TextBox 컨트롤에 입력되는 것을 확인할 수 있습니다.



그림 1. FilteredTextBoxExtender 컨트롤이 정의된 TextBox 컨트롤

이상으로 FilteredTextBox 컨트롤에 대해서 알아보았고, 다음 포스트에서 다른 AJAX 컨트롤에 대해서 알아보도록 하겠습니다.


출처 : http://blog.naver.com/handssjh?Redirect=Log&logNo=140041393735&vid=0
AND

1. 자바 스크립트 함수를 폼의 HTML 부분에 먼저 추가 해둡니다.

2. 버튼에 이벤트 핸들러를 추가합니다.

3. 이벤트 핸들러 함수에 다음을 추가합니다.

   RegisterClientScriptBlock("ButtonClickTest", "<script>aaa();</script>");
   RegisterStartupScript("ButtonClickTest", "<script>aaa();</script>");


위 코드 두줄 중 하나만 쓰시면 원하는 결과를 얻으실 수 있습니다.


회색 글자 부분은 아무 값이나 넣으시면 되고, 빨간색 글자 부분에 스크립트 호출하는 코드를 넣으시면 됩니다. 빨간색 부분은 문자열이 그대로 사용되므로 자바스크립트 함수를 호출하려면 <script> ... </script> 블럭으로 감싸주셔야 합니다.


위 두 함수는 PostBack 시점에서 스크립트를 실행하기 위해서 사용합니다.

두 함수의 차이점은 RegisterClientScriptBlock 함수는 서버 Form 시작 부분의 바로 아래줄에 생성되고, RegisterStartupScript 함수는 서버 Form 닫히는 부분의 바로 윗줄에 생성됩니다.

AND

State Management

WEB/ASP.NET 2007. 1. 24. 17:41
상태 저장법

[Client]
Hidden Field/memory
쿠키/memory&file
View State/ASP.NET/memory
연결문자열/aspx?id=...
[Server]
Application/memory
Session/memory
Profile/ASP.NET/DB 이용/MSSQL종속

저장위치종류RamFile공유범위특징
Client
Hidden Field
O




Cookie
OO


View State
O*

Round Trip을 위해 hidden field를 사용

쿼리 문자열




Server
Application State
O
해당 어플리케이션내


Session
O
해당 클라이언트만

AND

PreviousPage란

WEB/ASP.NET 2007. 1. 23. 14:50
a.aspx -> b.aspx 로 이동시 (경우1)
a의 요소의 값에 접근하기 위해 사용

transfer된후(경우3)
이전페이지의 요소값에 접근하기 위해..


AND

a.aspx -> a.aspx  포스트백
          <-             라운트 트립

1) href 연결
a.aspx -> b.aspx 실행  Postback(x)/CrossPagePostBack(x)
b.aspx <-

2) 페이지간 게시(버튼) *PostBackUrl속성이용
a.aspx -> b.aspx   postback(x)/CrossPagePostBack(o)
b.aspx <-

3) 브라우저 리디렉션 Response.Redirection 메서드이용
a.aspx -> a.aspx  post back(o)
(버튼)  <-            post back(o)
(최종)   -> b.aspx (브라우저 리디렉션) post back(x)/CrossPagePostBack(x)
b.aspx <-

4) 서버 리디렉션 (Server.transfer메서드 이용)
a.aspx -> a.aspx -> b.aspx
a.aspx <- (내용은 a.aspx)

AND

AND