Asp.net background prompts

Source: Internet
Author: User

1. How to bring up prompt information in the background

Response. Write ("<scripttype =" text/JavaScript "> alert ('the data you queried does not exist! '); </SCRIPT> ");

// The prompt is displayed, but the page is blank.
Page. registerclientscriptblock ("tishi", "<scripttype =" text/JavaScript "> alert ('data You queried does not exist'); </SCRIPT> ");

// The prompt is displayed, but the page is blank.
Page. registerstartupscript ("tishi", "<scripttype =" text/JavaScript "> alert ('data You queried does not exist'); </SCRIPT>"); // expired,

// The prompt message is displayed. The page is not blank.
Clientscript. registerclientscriptblock (this. GetType (), "tishi", "<SCRIPT type =" text/JavaScript "> alert ('the data you queried does not exist! '); </SCRIPT> ");

// The prompt is displayed, but the page is blank.
Clientscript. registerstartupscript (this. GetType (), "tishi", "<SCRIPT type =" text/JavaScript "> alert ('your queried data does not exist! '); </SCRIPT> ");

// The prompt message is displayed. The page is not blank.

// System. Web. Extensions. DLL needs to be introduced in vs2005.
Scriptmanager. registerclientscriptblock (this. btntishi, typeof (button), "tishi", "alert ('your queried data does not exist! '); ", True );

// The prompt is displayed, but the page is blank.
Scriptmanager. registerclientscriptblock (this, this. GetType (), "tishi", "alert ('your queried data does not exist! '); ", True );

// The prompt is displayed, but the page is blank. This indicates page
Scriptmanager. registerstartupscript (this. btntishi, typeof (button), "tishi", "alert ('your queried data does not exist! '); ", True );

// The prompt message is displayed. The page is not blank.
Scriptmanager. registerstartupscript (page, typeof (PAGE), "tishi", "alert ('your queried data does not exist! '); ", True );

// The prompt message is displayed. The page is not blank.
Scriptmanager. registerstartupscript (this, typeof (_ default), "tishi", script, true );

// The prompt is displayed. The page is not blank. This indicates the page.

// The backend obtains the confirm return value and has the selected execution statement block.
C # end:
Protected void page_load (Object sender, eventargs E)
{
If (! Ispostback)
{
This. btntishi. Attributes. Add ("onclick", "tishi ()");
}
}

Protected voidbtntishi_click (Object sender, eventargs E)
{
If (this. hidevalue. value = "1 ")
{
Response. Write ("success ");
}
Else
{
Response. Write ("failue ");
}
}

JS end:
<SCRIPT type = "text/JavaScript">
Function tishi ()
{
If (confirm ('Are you sure you want to delete it? '))
{
Document. getelementbyidx_x ('hidevalue'). value = '1 ';
// Window. Location. href = Window. Location. href;
}
Else
{
Document. getelementbyidx_x ('hidevalue'). value = '0 ';
}
}
</SCRIPT>

 

Related Article

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.