views:

92

answers:

2

Well The title might be a lil confusing, what I am currently doing is creating an aspx form dynamically and saving its data by using Server.Transfer("PrssPage.aspx").

On ProcessPage.aspx I am using the Previous Page property to save the data entered by the user using the dynamically created form.

Each Dynamic Form is provided an ID for example 123.aspx

Now what I want to achieve is to repopulate the dynamically created aspx page with the user input values from database, plz note here that I do not have an aspx.cs page getting dynamically generated. I am only generating aspx page.

Any suggestion ?

A: 

If you are creating the form dinamically, why not retrieve the data from the database and populate the form fields with this data, dinamically of course?

Take a look in Reflection if it helps.

Leniel Macaferi
Hi Leniel, I am able to get the data back from the database, since there is no associated .cs file with the form that's getting dynamically generated I am unable to populate its fields, What I need is to dynamically load this file just as we load ascx file.
Sandhurst
@Sandhurst: i got the point. I've never seen something to load an .aspx page. I've just used the dynamic loading with ascx custom controls.
Leniel Macaferi
A: 

My suggestion is to crack open your nearest ASP.NET book. Your question is too vague to give you any helpful answers. Here are some things to ponder:

Are you really creating a NEW .aspx Page? WHY? I find it hard to picture a scenario where this is helpful or desirable. Are you sure you don't mean that you're just dynamically creating controls on a given page? (and if not... why not?)

Why are you processing the input on a different page? Unnecessary. If you use a single page, then the ViewState will repopulate the page's controls for you.

Your comment to the first answer makes little sense. Your code is running somewhere, and that is where you can reload the DB data and populate the fields.

Bryan