C # background code pop-up page or mode window

Source: Internet
Author: User

For example, B. aspx B a = new B ();

Replace page with;

Open a. Net window, And the. NET window is located at the beginning
/** // <Summary>
/// Open a. Net window, And the. NET window is located at the beginning
/// </Summary>
/// <Param name = "page"> used page </param>
/// <Param name = "url"> URL to be opened </param>
/// <Param name = "pagename"> name of the page to be opened </param>
/// <Param name = "win_width"> window width </param>
/// <Param name = "win_hight"> window height </param>
/// <Param name = "Left"> left position of the window </param>
/// <Param name = "TOP"> position on the right of the window </param>
/// <Param name = "centerflag"> whether the right center is yes/no </param>
/// <Param name = "status"> whether to display the status bar yes/no </param>
/// <Param name = "parentflag"> true: If the pop-up window is not closed, the parent window cannot be operated. False: the parent window can be operated. </param>
Public static void opennewwinodw (page, string URL, string pagename, string win_width, string win_hight, string left, string top, string centerflag, string status, bool parentflag)
{

String scriptstr = "";
If (parentflag)
{
Scriptstr = "<script language = JavaScript> showmodaldialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft:" + Left + "PX; dialogtop:" + TOP + "PX; center:" + centerflag. tostring () + "; help: No; resizeable: Yes; Status:" + status + "') </SCRIPT> ";
}
Else
{
Scriptstr = "<script language = JavaScript> showmodelessdialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft:" + Left + "PX; dialogtop:" + TOP + "PX; center:" + centerflag. tostring () + "; help: No; resizeable: Yes; Status:" + status + "') </SCRIPT> ";
}
Page. response. Write (scriptstr );
}
/** // <Summary>
/// Open a window that is located at the top of the window. If it is not closed, the parent window cannot be operated.
/// </Summary>
/// <Param name = "page"> used page </param>
/// <Param name = "url"> URL to be opened </param>
/// <Param name = "pagename"> name of the page to be opened </param>
/// <Param name = "win_width"> window width </param>
/// <Param name = "win_hight"> window height </param>
/// <Param name = "Left"> left position of the window </param>
/// <Param name = "TOP"> position on the right of the window </param>
/// <Param name = "centerflag"> whether the right center is yes/no </param>
/// <Param name = "parentflag"> true: If the pop-up window is not closed, the parent window cannot be operated. False: the parent window can be operated. </param>
Public static void opennewwinodw (page, string URL, string pagename, string win_width, string win_hight, string left, string top, string centerflag, bool parentflag)
{
String scriptstr = "";
If (parentflag)
{
Scriptstr = "<script language = JavaScript> showmodaldialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft:" + Left + "PX; dialogtop:" + TOP + "PX; center:" + centerflag + "; help: no; resizeable: Yes; Status: no') </SCRIPT> ";
}
Else
{
Scriptstr = "<script language = JavaScript> showmodelessdialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft:" + Left + "PX; dialogtop:" + TOP + "PX; center:" + centerflag + "; help: no; resizeable: Yes; Status: no') </SCRIPT> ";
}
Page. response. Write (scriptstr );
}

/** // <Summary>
/// Open a window that is located at the top of the window. If it is not closed, the parent window cannot be operated.
/// </Summary>
/// <Param name = "page"> used page </param>
/// <Param name = "url"> URL to be opened </param>
/// <Param name = "pagename"> name of the page to be opened </param>
/// <Param name = "win_width"> window width </param>
/// <Param name = "win_hight"> window height </param>
/// <Param name = "Left"> left position of the window </param>
/// <Param name = "TOP"> position on the right of the window </param>
/// <Param name = "parentflag"> true: If the pop-up window is not closed, the parent window cannot be operated. False: the parent window can be operated. </param>
Public static void opennewwinodw (page, string URL, string pagename, string win_width, string win_hight, string left, string top, bool parentflag)
{
String scriptstr = "";
If (parentflag)
{
Scriptstr = "<script language = JavaScript> showmodaldialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft:" + Left + "PX; dialogtop:" + TOP + "PX; center: No; help: No; resizeable: yes; Status: no') </SCRIPT> ";
}
Else
{
Scriptstr = "<script language = JavaScript> showmodelessdialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft:" + Left + "PX; dialogtop:" + TOP + "PX; center: No; help: No; resizeable: yes; Status: no') </SCRIPT> ";

}
Page. response. Write (scriptstr );
}

/** // <Summary>
/// Open a window that is located at the top of the window. If it is not closed, the parent window cannot be operated.
/// </Summary>
/// <Param name = "page"> used page </param>
/// <Param name = "url"> URL to be opened </param>
/// <Param name = "pagename"> name of the page to be opened </param>
/// <Param name = "win_width"> window width </param>
/// <Param name = "win_hight"> window height </param>
/// <Param name = "parentflag"> true: If the pop-up window is not closed, the parent window cannot be operated. False: the parent window can be operated. </param>
Public static void opennewwinodw (page, string URL, string pagename, string win_width, string win_hight, bool parentflag)
{
String scriptstr = "";
If (parentflag)
{
Scriptstr = "<script language = JavaScript> showmodaldialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft: 0px; dialogtop: 0px; center: No; help: No; resizeable: Yes; Status: no ') </SCRIPT> ";
}
Else
{
Scriptstr = "<script language = JavaScript> showmodelessdialog ('" + URL + "', '" + pagename + "', 'dialogwidth:" + win_width + "PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft: 0px; dialogtop: 0px; center: No; help: No; resizeable: Yes; Status: no ') </SCRIPT> ";
}
Page. response. Write (scriptstr );
}
/** // <Summary>
/// Open a window that is located at the top of the window. If it is not closed, the parent window cannot be operated.
/// </Summary>
/// <Param name = "page"> used page </param>
/// <Param name = "url"> URL to be opened </param>
/// <Param name = "win_width"> window width </param>
/// <Param name = "win_hight"> window height </param>
/// <Param name = "parentflag"> true: If the pop-up window is not closed, the parent window cannot be operated. False: the parent window can be operated. </param>
Public static void opennewwinodw (page, string URL, string win_width, string win_hight, bool parentflag)
{
String scriptstr = "";
If (parentflag)
{
Scriptstr = "<script language = JavaScript> showmodaldialog ('" + URL + "','', 'dialogwidth: "+ win_width +" PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft: 0px; dialogtop: 0px; center: No; help: No; resizeable: Yes; Status: no ') </SCRIPT> ";
}
Else
{
Scriptstr = "<script language = JavaScript> showmodelessdialog ('" + URL + "','', 'dialogwidth: "+ win_width +" PX ;"
+ "Dialogheight:" + win_hight + "PX; dialogleft: 0px; dialogtop: 0px; center: No; help: No; resizeable: Yes; Status: no ') </SCRIPT> ";
}
Page. response. Write (scriptstr );
}
# Endregion

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.