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