You can write a simple message box by using the following line of code:
Response.Write("<script>alert('Your alert box')</script>");
You can write any kind of HTML code back to the browser in this way, to put a link in the popup (which is not possible with the bare JavaScript Message Box) you would need to write actual HTML code instead of
Quote:
"<script>alert('Your alert box')</script>"
Another side note:
The above code can only be used from an *aspx.cs file ("default.aspx.cs", in case the site is called "default.aspx"). Otherwise you would need to do something like:
//default.aspx.cs:
public partial class Default : System.Web.UI.Page
{
UserController controller = new Controller();
protected void Page_Load(object sender, EventArgs e)
{
if(controller.Getapi_login("YourId") == null)
{
Response.Write("<script>alert('Your alert box')</script>");
}
}
}