J
Jeff
Greetings
I am beginning a web app. I am using C# aspx forms for my web pages.
Is it possible to create/use one aspx file as a base from which to
derive other aspx files? I can not get this to work.
What I tried was this:
Create a new web project.
- rename WebForm1.aspx to MyBase.aspx
- Add (grad from tool box) a label to the html form
- Then create another aspx file (using "Add Web Form"). This produces
WebForm2.aspx.
- Then, I tried several ways of getting WebForm2.aspx to inherit or
appear like MyBase
1. In the WebForm2.aspx.cs file, I changed the class declaration
to:
Public Class WebForm2 : MyBase.aspx{
........
}
No good.
2. In the html view I changed the first line parameters to:
Codebehind="MyBase.aspx.cs"
&
Inherits="MyBaseNameSpace.MyBase.aspx"
No good.
3. A combination of both of the above also does not work
No Matter what I do, I can get the WebForm2 page to load, but it does
not display the label that I have on the base page.
I find lots of references too and documentation about inheriting
windows forms, but nothing on web pages(forms)
Can this be done somehow?
Thanks
Jeff
I am beginning a web app. I am using C# aspx forms for my web pages.
Is it possible to create/use one aspx file as a base from which to
derive other aspx files? I can not get this to work.
What I tried was this:
Create a new web project.
- rename WebForm1.aspx to MyBase.aspx
- Add (grad from tool box) a label to the html form
- Then create another aspx file (using "Add Web Form"). This produces
WebForm2.aspx.
- Then, I tried several ways of getting WebForm2.aspx to inherit or
appear like MyBase
1. In the WebForm2.aspx.cs file, I changed the class declaration
to:
Public Class WebForm2 : MyBase.aspx{
........
}
No good.
2. In the html view I changed the first line parameters to:
Codebehind="MyBase.aspx.cs"
&
Inherits="MyBaseNameSpace.MyBase.aspx"
No good.
3. A combination of both of the above also does not work
No Matter what I do, I can get the WebForm2 page to load, but it does
not display the label that I have on the base page.
I find lots of references too and documentation about inheriting
windows forms, but nothing on web pages(forms)
Can this be done somehow?
Thanks
Jeff