Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 컬럼명
- varags
- Bootstrap
- Android
- MANTIS
- Redirect
- SpringSource Tool Suite
- STS
- C#
- TextBox
- Apache Lucene
- 이클립스
- Web Service
- 웹뷰
- MS-SQL
- 자바스크립트
- jsp
- decompiler
- html
- Java
- 안드로이드
- scrollView
- 웹 서비스
- MSsql
- Eclipse
- asp.net
- Maven
- 자바
- javascript
- WebView
Archives
- Today
- Total
bboks.net™
ASP.NET 코드 비하인드에서 경고창 띄우기 본문
ASP.NET 코딩을 하다보면 코드 비하인드에서 경고창을 띄워야 하는 경우가 발생
1. UpdatePanel을 사용할 경우
public void CreateMessageAlertInUpdatePanel(UpdatePanel updatePanel, string message) { string script = "alert('" + message + "');"; Guid guidKey = Guid.NewGuid(); ScriptManager.RegisterStartupScript(updatePanel, updatePanel.GetType(), guidKey.ToString(), script, true); }
CreateMessageAlertInUpdatePanel(this.UpdatePanel1, "message") 로 호출
2. UpdatePanel을 사용하지 않을 경우
public void CreateMessageAlert(string message) { string script = "alert('" + message + "');"; Guid guidKey = Guid.NewGuid(); Page.ClientScript.RegisterStartupScript(typeof(Page), guidKey.ToString(), script, true); }
CreateMessageAlert("message")로 호출
[참조] Creating javascript alerts in ASP.NET with UpdatePanel (or without)