Create Client Side MessageBox : Write « Response « ASP.NET Tutorial






<script language="C#" runat="server">
protected void Page_Load(object o, EventArgs e) {
    if(IsPostBack) {
        CreateClientSideMessageBox("IsPostBack is true");
    }
    else {
        CreateClientSideMessageBox("IsPostBack is false");
    }
}


protected void CreateClientSideMessageBox(string message) {
    Response.Write("<script language=\"javascript\">");
    Response.Write("alert(\"" + message + "\");");
    Response.Write("</" + "script>");
}
</script>

<form runat="server">
this page displays a client side message box<br/>
<asp:button runat="server" Text="go" />
</form>








6.4.Write
6.4.1.Use Response.Write to output message based on HTML tags (VB.net)
6.4.2.Calculation in Response.Write (VB)
6.4.3.Calculation in Response.Write (C#)
6.4.4.Output integer and string in Response.Write
6.4.5.Output HTML tags in Response.Write, change the tag properties dynamicallys (VB.net)
6.4.6.Create Client Side MessageBox
6.4.7.Send text file to client