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