0

I have 2 aspx pages A and B which share the same logic on codebehind aspx.cs except for 1 method and i am thinking to reuse the code of A by letting class of B inherit the class of A in the codebehind and overriding the 1 method. But I encountered this error "Object reference not set to an instance of an object" when loading the page after doing so. Both pages have the same ids for the objects (labels, etc) referenced from the codebehind. I am guessing i shouldn't be doing it this way or i have left out something.

Appreciate any help directing me in the right direction on how i can reuse the same code without duplicating them on the codebehind files. Thanks!

1 Answer 1

0

set Page B's CodeBehind page attribute to CodeBehind="A.aspx.vb" for method that is only specific to B use any identifier like form name or form id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.