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 | 31 |
Tags
- Maven
- Java
- C#
- TextBox
- 자바
- 웹뷰
- 자바스크립트
- jsp
- Android
- Eclipse
- Redirect
- MANTIS
- scrollView
- SpringSource Tool Suite
- 이클립스
- javascript
- 안드로이드
- html
- Bootstrap
- varags
- 컬럼명
- asp.net
- 웹 서비스
- decompiler
- Apache Lucene
- Web Service
- MSsql
- STS
- WebView
- MS-SQL
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)