How do build aspx code that allows you to re-use code.

  How do you build aspx code that re-uses aspx code that you have developed instead of adding the same code over and over again?

  I have some lines of aspx code that are used in the forms that I want to maintain in one place instead of sticking it on each new form..

Who is Participating?
Gerry BartleySoftware EngineerCommented:
Try putting this in  a usercontrol ascx. Then it's available in one place and any mods are reflected on all existing forms

Can be dropped onto any page like any page control
Paul MacDonaldDirector, Information SystemsCommented:
They're called "classes".  You can have as many or as few as you want, and use them to organize your code any way you like.
KeeterBlackAuthor Commented:

   No... Not Classes..  

  I am talking about adding plain old aspx code(markup) that I use over and over again.

  Unless there is someway to make a class with Aspx code.

Example of code used in many different forms:
                  <asp:Panel id="Panel1" runat="server" horizontalalign="Center">
                        <div id="submitbutton" runat="server">
                              <igtxt:WebImageButton id="btnSubmit" runat="server" text="Submit Changes" height="40px"
                              <igtxt:WebImageButton id="btnDismiss" runat="server" autosubmit="False" height="40px"
                                    text="Dismiss Changes">
                                    <ClientSideEvents click="CancelClicked" />
                              <igtxt:WebImageButton id="btnDelete" runat="server" height="40px" text="Delete Record">
                                    <ClientSideEvents click="delRecord" />

The above code is needed in many different forms.

KeeterBlackAuthor Commented:

That will work!!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.