Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > loading dinamically webforms

Reply
Thread Tools

loading dinamically webforms

 
 
=?Utf-8?B?am9zZXBt?=
Guest
Posts: n/a
 
      10-07-2005
Hello,
My doubt is arround webforms and its load programatically. I have a class
derived from System.Web.UI.Page (clsWebForm), with their own properties and
methods. Inside another webform I instanciate clsWebForm, filling their
properties, but how can I load the webform inside the web explorer?

public class clsWebForm : System.Web.UI.Page
{
....
}

In another page:

private void cmdOk_Click(object sender, System.EventArgs e)
{
clsWebForm clsFrm = new clsWebFormt();
// here I want to load the new web form bu I do not
how!!!!
}



Thanks!


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      10-07-2005
On Fri, 7 Oct 2005 06:51:03 -0700, josepm
<(E-Mail Removed)> wrote:

> private void cmdOk_Click(object sender, System.EventArgs e)
> {
> clsWebForm clsFrm = new clsWebFormt();
> // here I want to load the new web form bu I do not
>how!!!!
> }
>


If you want to move processing to a second web form there are a few
techniques that can work. There is Response.Redirect, Server.Transfer,
and in 2.0 there is a cross page post back.

I have an article on these topics here:
http://odetocode.com/Articles/421.aspx

What you don't want to do is create a webform with the new operator,
as you really need ASP.NET's help to properly create and initialize a
form and get it into the processing pipeline.

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/
 
Reply With Quote
 
 
 
 
=?Utf-8?B?am9zZXBt?=
Guest
Posts: n/a
 
      10-07-2005
Thanks Scott, but I 'm deceived because I thought I could treat webForms as
pure classes and manipulate so. So, I will use Response... and pass Request
parameters until migrate to ASP 2.0.

Best regards,

josepm
 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      10-07-2005
Webforms are just classes, and you can technically new one up and
manipulate it ... but ...

To do this the right way you need the runtime to create and init the
form via PageParser.GetCompiledPageInstance, because that method knows
who to call for code-generation of the ASPX page, who to call to wire
up implicit event handlers, and all the other "stuff" that needs to
happen for a webform that is going to be part of an HTTP request and
render to the client.

--
Scott
http://www.OdeToCode.com/blogs/scott/


On Fri, 7 Oct 2005 08:47:02 -0700, josepm
<(E-Mail Removed)> wrote:

>Thanks Scott, but I 'm deceived because I thought I could treat webForms as
>pure classes and manipulate so. So, I will use Response... and pass Request
>parameters until migrate to ASP 2.0.
>
>Best regards,
>
>josepm


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dinamically loading an image into a iframe spallared Javascript 1 04-26-2007 04:57 PM
dynamically loading user controls in webforms nemesis.saurabh@gmail.com ASP .Net 2 08-08-2006 06:51 AM
webforms reports throws error while loading Mahdi Haeri ASP .Net Web Controls 0 05-29-2006 08:15 AM
HowTo Loading ActiveX dinamically at runtime ? Leo sailer ASP .Net Web Controls 4 05-05-2005 04:45 PM
Creating JavaScript Dinamically JMMB ASP .Net 1 08-26-2003 04:18 PM



Advertisments