dynamically adding a FormView

J

justin

I am trying to make a page that has a drop down list at the top, and
based upon the selection in the drop down list, inserts a FormView in
the bottom of the page. I tried to create each of my FormView's in
seperate files, and then use the following method.

<!--#include file=<name of correct file>-->

It worked fine to include my control. The problem occured when I
wanted to have a code behind for each FormView. I cannot have a page
declarative where I specify the code-behind b/c I get a compiler error
stating that I cannot have more than one page declarative (I already
have one for the page this FormView is being added to).

Is there a better way to dynamically add and remove FormView's that
have code-behind files to a standard ASP.NET page? Do I need to try a
completely different approach? Any help would be greatly appreciated.
 
J

justin

I am trying to make a page that has a drop down list at the top, and
based upon the selection in the drop down list, inserts a FormView in
the bottom of the page. I tried to create each of my FormView's in
seperate files, and then use the following method.

<!--#include file=<name of correct file>-->

It worked fine to include my control. The problem occured when I
wanted to have a code behind for each FormView. I cannot have a page
declarative where I specify the code-behind b/c I get a compiler error
stating that I cannot have more than one page declarative (I already
have one for the page this FormView is being added to).

Is there a better way to dynamically add and remove FormView's that
have code-behind files to a standard ASP.NET page? Do I need to try a
completely different approach? Any help would be greatly appreciated.

Sorry, I'm still learning. I changed my FormView's from aspx files to
ascx files. Everything is happy now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top