S
Stephen Adam
Hi there,
I want to write a function which will dynamicly create a page - this page
will be a popup page and will convey input back to the page which created
it. Is possible and how should I go about it? Below is the beginings of the
function to create the page, am I barking up the right tree?
private Page CreateDownloadPopupPage()
{
Page aspxDownloadPopupPage;
aspxDownloadPopupPage = new Page();
// Add Header
aspxDownloadPopupPage.Controls.AddAt( 0, new LiteralControl( @"
<html>
<head>
<title> Add Download </title>
</head>
<body>
") );
//Add Form And Contents
HtmlForm frmDownloadPopup = new HtmlForm();
Button btnCancel = new Button();
Button btnOk = new Button();
btnCancel.Text = "Cancel";
btnOk.Text = "Ok";
btnOk.Click += new EventHandler(btnOk_Click);
btnCancel.Click +=new EventHandler(btnCancel_Click);
HtmlInputFile flPopupDownload = new HtmlInputFile();
frmDownloadPopup.Controls.Add(flPopupDownload);
frmDownloadPopup.Controls.Add(btnCancel);
frmDownloadPopup.Controls.Add(btnOk);
aspxDownloadPopupPage.Controls.Add( frmDownloadPopup );
aspxDownloadPopupPage.Controls.Add( new LiteralControl( @"
</body>
</html>
"));
return aspxDownloadPopupPage;
}
I want to write a function which will dynamicly create a page - this page
will be a popup page and will convey input back to the page which created
it. Is possible and how should I go about it? Below is the beginings of the
function to create the page, am I barking up the right tree?
private Page CreateDownloadPopupPage()
{
Page aspxDownloadPopupPage;
aspxDownloadPopupPage = new Page();
// Add Header
aspxDownloadPopupPage.Controls.AddAt( 0, new LiteralControl( @"
<html>
<head>
<title> Add Download </title>
</head>
<body>
") );
//Add Form And Contents
HtmlForm frmDownloadPopup = new HtmlForm();
Button btnCancel = new Button();
Button btnOk = new Button();
btnCancel.Text = "Cancel";
btnOk.Text = "Ok";
btnOk.Click += new EventHandler(btnOk_Click);
btnCancel.Click +=new EventHandler(btnCancel_Click);
HtmlInputFile flPopupDownload = new HtmlInputFile();
frmDownloadPopup.Controls.Add(flPopupDownload);
frmDownloadPopup.Controls.Add(btnCancel);
frmDownloadPopup.Controls.Add(btnOk);
aspxDownloadPopupPage.Controls.Add( frmDownloadPopup );
aspxDownloadPopupPage.Controls.Add( new LiteralControl( @"
</body>
</html>
"));
return aspxDownloadPopupPage;
}