성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
[정성태] 저렇게 조각 코드 말고, 실제로 재현이 되는 예제 프로젝트를 압...
[정성태] Modules 창(Ctrl+Shift+U)을 띄워서, 해당 Op...
[정성태] 만드실 수 있습니다. 단지, Unity 엔진 내의 스크립트와 W...
[공진영] 안녕하세요 좋은글 감사합니다. 현재 제가 wpf로 관제 모...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
닷넷
.NET 3.0
.NET 3.5
.NET 4.0
COM 개체 관련
Win32
Vista
Windows 7
Windows 8
Windows 서버
데이터베이스
웹폼 코딩 규약
윈폼 코딩 규약
공통 코딩 규약
명령행
레지스트리
기타
부모글 보이기/감추기
내용
Tip/Trick: Enabling Back/Forward-Button Support for ASP.NET AJAX UpdatePanel<br /> ; <a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2006/09/14/Tip_2F00_Trick_3A00_-Enabling-Back_2F00_Forward_2D00_Button-Support-for-ASP.NET-AJAX-UpdatePanel.aspx">http://weblogs.asp.net/scottgu/archive/2006/09/14/Tip_2F00_Trick_3A00_-Enabling-Back_2F00_Forward_2D00_Button-Support-for-ASP.NET-AJAX-UpdatePanel.aspx</a><br /> <br /> <hr /> <font face="arial" size="2"> <p>Nikhil <a href="http://www.nikhilk.net/BackButtonSupport.aspx">recently posted</a> a nice blog post that includes a new ASP.NET AJAX-enabled control called "HistoryControl". When added to a page it allows developers to programmatically add logical views into a browser's history list. This enables you to make AJAX enabled sites much more useful, and to follow the standard back/forward navigation paradigm that traditional web apps follow.</p> <p>For example, the below code could be written by a developer in response to a selection change within a list to to add the previous list selection to the browser's history via Nikhil's "HistoryControl":</p> <div style="border-right: white 2px ridge; padding-right: 10px; border-top: white 2px ridge; padding-left: 10px; font-size: 10pt; padding-bottom: 10px; margin: 10px; border-left: white 2px ridge; padding-top: 10px; border-bottom: white 2px ridge; font-family: courier new; background-color: #eeeeee; word-wrap: break-word"><font color="blue">private void </font><font color="black">ContentList_SelectedIndexChanged(</font><font color="blue">object </font><font color="black">sender, EventArgs e) {<br> history.AddEntry(contentList.SelectedIndex.ToString()</font><font color="blue">;<br></font><font color="black">}</font> </div> <p></p> <p>Once you add entries into the history control, the back/forward button will be enabled in the browser. Nikhil's history control then exposes a "Navigate" event which fires when you press the forward or back button in the browser, and this event then exposes the identifier entry provided before when the view was added into the browser history. You can then use this to restore the page to whatever state it should be in to match the previous history item and update the page:</p> <p> <div style="border-right: white 2px ridge; padding-right: 10px; border-top: white 2px ridge; padding-left: 10px; font-size: 10pt; padding-bottom: 10px; margin: 10px; border-left: white 2px ridge; padding-top: 10px; border-bottom: white 2px ridge; font-family: courier new; background-color: #eeeeee; word-wrap: break-word"><font color="blue">private void </font><font color="black">HistoryControl_Navigate(</font><font color="blue">object </font><font color="black">sender, HistoryEventArgs e) {<br><br> </font><font color="blue">int </font><font color="black">selectedIndex </font><font color="blue">= </font><font color="maroon">0</font><font color="blue">;<br><br> if </font><font color="black">(String.IsNullOrEmpty(e.Identifier) </font><font color="blue">== false</font><font color="black">) {<br> selectedIndex </font><font color="blue">= </font><font color="black">Int32.Parse(e.Identifier)</font><font color="blue">;<br> </font><font color="black">}<br><br> </font><font color="darkgreen">// Update the content being displayed in the page<br> </font><font color="black">contentList.SelectedIndex </font><font color="blue">= </font><font color="black">selectedIndex</font><font color="blue">;<br><br> </font><font color="darkgreen">// Mark the update panels as needing an update<br> </font><font color="black">mainUpdatePanel.Update()</font><font color="blue">;<br></font><font color="black">}</font> </div> <p></p> <p>And now your end-users get forward/back button history navigation working with AJAX. You can <a href="http://www.nikhilk.net/BackButtonSupport.aspx" target="_blank">download the code for Nikhil's history control and start using it here</a>.</p> <p>Hope this helps,</p> <p>Scott</p></font> <div class = "shareblock"><strong>Share this post:</strong> <a title="Email Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel" href = "mailto:?body=Thought you might like this: /scottgu/archive/2006/09/14/Tip_2F00_Trick_3A00_-Enabling-Back_2F00_Forward_2D00_Button-Support-for-ASP.NET-AJAX-UpdatePanel.aspx&subject=Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel">Email it!</a> | <a href = "http://del.icio.us/post?url=/scottgu/archive/2006/09/14/Tip_2F00_Trick_3A00_-Enabling-Back_2F00_Forward_2D00_Button-Support-for-ASP.NET-AJAX-UpdatePanel.aspx&title=Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel" title="Submit Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel to del.icio.us" >bookmark it!</a> | <a href = "http://www.digg.com/submit?url=/scottgu/archive/2006/09/14/Tip_2F00_Trick_3A00_-Enabling-Back_2F00_Forward_2D00_Button-Support-for-ASP.NET-AJAX-UpdatePanel.aspx&phase=2" title="Submit Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel to digg.com">digg it!</a> | <a href = "http://reddit.com/submit?url=/scottgu/archive/2006/09/14/Tip_2F00_Trick_3A00_-Enabling-Back_2F00_Forward_2D00_Button-Support-for-ASP.NET-AJAX-UpdatePanel.aspx&title=Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel" title="Submit Tip%2fTrick%3a+Enabling+Back%2fForward-Button+Support+for+ASP.NET+AJAX+UpdatePanel to reddit.com">reddit!</a></div>
첨부파일
스팸 방지용 인증 번호
1542
(왼쪽의 숫자를 입력해야 합니다.)