C # Some message processing methods.
/// <Summary>
/// Client Script: Alert (MSG) I;
/// </Summary>
/// <Param name = "MSG"> Message to be displayed </Param>
/// <Returns> Client script of the alert function </Returns>
Public Static String Client_alert ( String MSG)
{
Return " <Script language = " Javascript " > Alert ( "" + MSG + "" ); </SCRIPT> " ;
}
/// <Summary>
/// Client Script: Alert (MSG) II; /// </Summary>
/// <Param name = "MSG"> Message to be displayed </Param>
/// <Param name = "returnurl"> Return address </Param>
/// <Returns> Returns the specified URL. </Returns>
Public Static String Client_alert ( String MSG, String Returnurl)
{
Return " <Script language = " Javascript " > Alert ( "" + MSG + "" ); Location. href =' " + Returnurl + " '; </SCRIPT> " ;
}
/// <Summary>
/// Client Script: confrim (MSG) I;
/// </Summary>
/// <Param name = "MSG"> Message to be confirmed </Param>
/// <Param name = "url"> Address to be switched after confirmation </Param>
/// <Returns> Client script of the confirm Function </Returns>
Public Static String Client_confirm ( String MSG, String URL)
{
String Scripts = " <Script language = " Javascript " > " +
" If (confirm (' " + MSG + " ')) " +
" {Location. href =' " + URL + " ';} " +
" </SCRIPT> " ;
Return Scripts;
}
/// <Summary>
/// Client Script: confrim (MSG) II;
/// </Summary>
/// <Param name = "MSG"> Message to be confirmed </Param>
/// <Param name = "cfmurl"> Address to be switched after confirmation </Param>
/// <Param name = "retrunurl"> Address to be switched after cancellation </Param>
/// <Returns> Client script of the confirm Function </Returns>
Public Static String Client_confirm ( String MSG, String Cfmurl, String Retrunurl)
{
String Scripts = " <Script language = " Javascript " > " +
" If (confirm (' " + MSG + " ')) " +
" {Location. href =' " + Cfmurl + " ';} " +
" Else {location. href =' " + Retrunurl + " ';}</SCRIPT> " ;
Return Scripts;
}
/// <Summary>
/// No message is displayed when the window is closed!
/// </Summary>
Public Static String Client_closewindow ()
{
Return " <SCRIPT> window. Opener = NULL; window. Close (); </SCRIPT> " ;
}
/// <Summary>
/// A prompt is displayed before closing the window.
/// </Summary>
/// <Param name = "MSG"> Message for disabling </Param>
Public Static String Client_closewindow ( String MSG)
{
Return " <SCRIPT> If (confirm (' " + MSG + " ') {Window. Opener = NULL; window. Close () ;}else {return false ;}</SCRIPT> " ;
}
/// <Summary>
/// Client Script: Redirection URL
/// </Summary>
/// <Param name = "url"> Redirected URL </Param>
/// <Param name = "copyhistory"> Record history? </Param>
/// <Returns> Client script block for Redirection URL </Returns>
Public Static String Client_redirect ( String URL, Bool Copyhistory)
{
Return (Copyhistory) ? " <Script language = " Javascript " > Top. Location. href =' " + URL + " '; </SCRIPT> " : " <Script language = " Javascript " > Top. Location. Replace (' " + URL + " '); </SCRIPT> " ;
}
# Endregion