Populate Dynamically created ASPX Page
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 u开发者_运维技巧ser 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 ?
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.
If you are creating the form dynamically, why not retrieve the data from the database and populate the form fields with this data, dynamically of course?
Take a look in Reflection if it helps.
精彩评论