Click here to Skip to main content
16,021,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create aspx page at run time , and add its contents
like controls and text
Posted
Comments
Sandeep Mewara 1-May-11 4:09am    
Not clear on what are you trying? If you elaborate on what and why then people might suggest something to you.
ArchanaSinghviJain 29-Sep-11 3:08am    
hey,
I have also the same requirement . Actually i also want to create the ASpx pages for different products as they have the add to Cart button and i also want them to be indexed by the Google search engine.
My requirement is to generate them i mean (Aspx and aspx.vb) like the normal aspx page having all functions Page_load etc on the fly.

How can i do this please suggest me.

To implement what you want to achieve you need to fully udnerstand how ASP.net request processing architecture works. So i'll suggest you first understand how ASP.net works and re-analyze your requirements.

I can provide some logic here. lets divide the requirements in possible sections:

1- Create a user interface where you will provide stuff to add to your asp.net page. i.e. controls and text
2- A storage for the information you have added in point 1 with some unique idnetifier say dynamicpage.aspx.
3- Provide the user link to your newly created page.

Now we'll go into details:
Point # 1: You need to decide how will you supply information to a system that will generate .aspx page for you. you can create an IDE have some options or textbox for some script information.

It wont be easy because you need to pass:
a- event binding information like what will happen when user will click a button on dynamic page
b- Data binding information like from where will the page fetch data and to which control what information will be assigned.
c- decision making statements if your page do some decision making process you would need to pass true & fail information to it - like if a=100 then redirect to page a otherwise page b.

Point # 2: The information you have passed in Point # 1 you need to store it somewhere so that when user will hit the link to your newly created page the iis will pass the information to ASP.net to process now you will need either:
a- locate the aspx file on disk.
b- if a custom handler exists it will pass the request to it. Now the custom handler should do some url routing to the pagewhich will do a url routing to a specific page who will see the parameter and fetch the information from some custom storage (may be a database or some flat file...)

Point # 3: You need to decide that how will the user can request for dynamic page. if a link how will you generate the link and where will you add it. if its a redirection how will redirection happen.

Its not impossible but it is very difficult.

Thanks,
Hemant
 
Share this answer
 
v2
Comments
ArchanaSinghviJain 29-Sep-11 3:23am    
your questions are right but there is no help how to handle and generate the pages.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900