C #. net output message class

Source: Internet
Author: User

 

  Using  System;
Using System. Web;
Using System. text;

Namespace Pub. Class {
/// <Summary>
/// Output Message class
/// </Summary>
Public Class MSG {
# Region Write
/// <Summary>
/// Output Message
/// </Summary>
/// <Param name = "MSG"> Message Content </Param>
Public Static Void Write ( String MSG) {httpcontext. Current. response. Write (MSG );}
Public Static Void Write ( String Format, Params Object [] ARGs) {httpcontext. Current. response. Output. Write (format, argS );}
Public Static Void Write ( Object MSG) {write (msg. tostring ());}

Public Static Void Writeend ( String MSG) {MSG. Write (MSG); MSG. End ();}
Public Static Void Writeend ( String Format, Params Object [] ARGs) {MSG. Write (format, argS); MSG. End ();}
Public Static Void Writeend ( Object MSG) {writeend (msg. tostring ());}

/// <Summary>
/// Output messages to the htmlgenericcontrol Control
/// </Summary>
/// <Param name = "control"> Htmlgenericcontrol Control </Param>
/// <Param name = "MSG"> Message Content </Param>
/// <Param name = "isadd"> Tired or not </Param>
Public Static Void Write (system. Web. UI. htmlcontrols. htmlgenericcontrol control, String MSG, Bool Isadd ){
If (Isadd) control. innerhtml + = MSG; Else Control. innerhtml = MSG;
}
# Endregion

# Region End
/// <Summary>
/// Terminate page running
/// </Summary>
Public Static Void End () {httpcontext. Current. response. End ();}
# Endregion

Public Static Void Redirect ( String URL) {httpcontext. Current. response. Redirect (URL );}
}
}

 

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.