How to implement pop-up prompts dialog box in asp.net

Source: Internet
Author: User

In C #, the Code for the pop-up window is:

MessageBox ("User name or password is wrong!", "error:");

In ASP.net, this is not the way to do this, when we can write a class message (name casually), the contents are as follows:

//---------------------------------------
The writer: go begging tomorrow
qq:305725744
//---------------------------------------

Using System;

Namespace Common
{
<summary>
A summary description of the message.
</summary>
public class Message
{
Public message ()
{
//
TODO: Add constructor logic here
//
}

Returns a pop-up window
public static string Show (String strMsg)
{

Here 0 means strmsg this thing, 1 means/this thing.
Return String.Format ("<script language={1}javascript{1}>alert ({1}{0}{1});</script>", STRMSG, "/" ");
}
}
}

Then, on the page where you want to pop up the dialog box, add a Label control, assuming it is named Lblmsg, and then write the code in the background:

Lblmsg.text = Message.show ("Write the content to be bounced here");

This allows you to implement the pop-up prompts. Note that my class is written in the common layer, so I have to refer to the common layer first:

Using Common;

This method is actually provided in the purple language, when I wrote the project encountered this problem, he told me this method, thank him for his help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.