당신은 네임 스페이스System.Windows.Forms
를 사용할 필요가 그리고 당신은 예를 들어,
메시지 상자 속성을 사용할 수 있습니다 다른 대안 중
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
**using System.Windows.Forms;**
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MessageBox.Show("Machine Cannot Be Deleted", "Delete from other Places
first", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
A)를 사용하여 자바 스크립트
예를 (하나의 Mr.Brandon에서 떨어져 제안했다)
Response.Write("<script>alert('Machine Cannot Be Deleted')</script>");
b)는 메시지 상자
예처럼 작동하는 사용자 정의 기능을 확인
protected void Page_Load(object sender, EventArgs e)
{
MyCustomMessageBox("Machine Cannot Be Deleted");
}
private void MyCustomMessageBox(string msg)
{
Label lbl = new Label();
lbl.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "')</script>";
Page.Controls.Add(lbl);
}
희망이이 질문에 asp.net 태그 할 수 있도록
가하셨습니까하는 데 도움이? 당신은 MessageBox.Show asp.net에서 최선의 방법은 RegisterClientSideScript 경고 팝업 일부 자바 스크립트를 등록하는 것입니다 .... 사용할 수 없습니다 예외 처리를 위해 이것을 권장하지 않습니다. –
네임 스페이스 System.Windows.Forms –