Adding a script to the client on the server to the client to automatically pop up a message

xiaoxiao2021-03-06  38

Adding a script to the client on the server to the client to automatically pop up a message

Principle: In ASP.NET, it is often necessary to automatically pop up a different message based on the different submission information. Therefore, there is a message that automatically pops up when the server is dynamically added to the client to open the web page. Add a client script, .NET already provides convenient information, you can implement it using RegisterStartupScript. To automatically pop up when opening a web page, the earliest idea is to add an OnLoad method to the middle -, it seems that it is difficult to access the Body in the back end. Therefore, the following scenarios are used: directly write the script into the web page without specifying a function name. . . It will be executed.

1. Design period, Label, TextBox, Button

2. Add code, implement the function: When the input is not OK in TextBox, you will prompt you area wong! Please try !; and display the current time in the Label.

3. First open the page

4. Press Button directly, you can see that the time has changed, indicating that the screen has been refreshed, here the error has been bombed. . .

转载请注明原文地址:https://www.9cbs.com/read-118585.html

New Post(0)