Create ASPX pages on the fly
-
Hi, How can I create ASPX pages on the fly ? I know that this can be done using Reflection, but can any body point me to a good sample ? Also, what should I consider if I have to deploy these pages to some server ? What would you advice me for serializing these pages ? Flat ASPX files or assemblies (DLL) ? Hope for the best suggestions.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
-
Hi, How can I create ASPX pages on the fly ? I know that this can be done using Reflection, but can any body point me to a good sample ? Also, what should I consider if I have to deploy these pages to some server ? What would you advice me for serializing these pages ? Flat ASPX files or assemblies (DLL) ? Hope for the best suggestions.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
I actually solved this problem earlier. My solution worked because I used the same C# code file on each of the aspx pages. I'm sure it could be done otherwise, but it was easy to do that way. What I did was create a base aspx file that had all the things the aspx file would need with a specific comment where the changing data would be. I then used a streamreader and streamwriter to go through the two files. When the file got to the comment it would then use a different stream reader for that sections contents, and then continue to read the rest of the base ifle. There might be an easier solution, but this worked fine for me. -ken