codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Web form inheritance problem?  ipsoftware at 04:20 on Sunday, January 02, 2005
 

Hi All, suppose I have a common ASP.NET page named CommonPage.aspx which has several user controls (e.g. buttons), how may I create a inherited page which inherits the user controls from CommonPage.aspx, however together with its own other user controls (e.g. checkbox ,text box...). Inheritance is simple in Windows Form applications, however, it becomes unclear how I can do that in ASP.NET web applications. Must a lot of HTML code be written in the code file behind (.aspx.cs)?

Appreciate if you could provide some samples!

Thank you.

  Re: Web form inheritance problem?  tgreer at 01:20 on Monday, January 03, 2005
 

What would you accomplish by inheriting a page? The standard technique for ecapsulation/re-use is to create user controls.


  Re: Web form inheritance problem?  ipsoftware at 01:27 on Monday, January 03, 2005
 

The purpose of inheriting the page is to avoid duplicating code (e.g. function calls) as there are some user controls (e.g. buttons) will be the same in different web pages.

<Added>

is the "user control" you are referring to "web user control"? which we may find in the drop down menu by right clicking a web solution->Add->Add Web User Control?

<Added>

I think web user control may solve my problem. Thanks

  Re: Web form inheritance problem?  tgreer at 02:49 on Monday, January 03, 2005
 

Yes, that's it exactly. You're welcome.









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
• Re: store string from text file to vector
• Re: c# .net Exception of type System.StackOverflowException was thrown.
• Re: error: expression must have a constant value
• Re: Script Does Folder Exist – If Not Create It
• $_GET not working
• GET METHOD
• Re: windows service - web service - com
• Re: Storing data from HTML to Excel or TXT
• Re: Help totalReads=1 totalReads++=2 write totalReads 3 not 2


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010