Link to home
Start Free TrialLog in
Avatar of KeeterBlack
KeeterBlackFlag for United States of America

asked on

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

Hi,
  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..

Thanks,
Keith
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

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.  

http://msdn.microsoft.com/en-us/library/ms973814.aspx

http://www.daniweb.com/web-development/asp/tutorials/19997/understanding-asp-classes
Avatar of KeeterBlack

ASKER

Paul...

   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"
                                    onclick="btnSubmit_Click">
                              </igtxt:WebImageButton>
                              <igtxt:WebImageButton id="btnDismiss" runat="server" autosubmit="False" height="40px"
                                    text="Dismiss Changes">
                                    <ClientSideEvents click="CancelClicked" />
                              </igtxt:WebImageButton>
                              <igtxt:WebImageButton id="btnDelete" runat="server" height="40px" text="Delete Record">
                                    <ClientSideEvents click="delRecord" />
                              </igtxt:WebImageButton>
                        </div>
                  </asp:Panel>

===========================================
The above code is needed in many different forms.

Thanks,
Keith
ASKER CERTIFIED SOLUTION
Avatar of Gerry Bartley
Gerry Bartley
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks...

That will work!!!!