none
Base Class Inheritance

    Question

  • I was wondering if anyone has discovered a way to change the inherits clause from

    inherits system.web.ui.page

    to

    inherits mybaseclass

    as a default setting in projects in visual studio?

    Every time I add a new aspx page I would like that inherit statement to already contain my baseclass instead of having to change it each time.

    I know this is trivial but if there is a setting in Visual Studio I would love to know about it.

    Thank You

    Wednesday, October 12, 2016 5:50 PM

Answers

  • Hi Roy1958,

    >>I know this is trivial but if there is a setting in Visual Studio I would love to know about it

    We could not set the WebForm format through some settings in VS by default, but we could through the custom template to implement your idea, please refer to the following steps:

    1). Based on your description, I modified the webform as the following scrennshot:

    2). Click File->Export Template->Item template->Next-> check WebForm1.asp-> Next->Next->Type the template name (myWebForm)-> Finish

    3). Reopen the VS and open above project-> right click the project and add a new Item, select myWebForm template:

    4). Then we will get the custom template as the following screenshot:

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    • Edited by qing__Moderator Thursday, October 13, 2016 7:43 AM
    • Marked as answer by Roy1958 Thursday, October 13, 2016 12:11 PM
    Thursday, October 13, 2016 7:42 AM
    Moderator

All replies

  • Hi Roy,

    Welcome to MSDN forum.

    Visual Studio Setup and Installation is to talk about the installation and setup of visual studio, your thread is more related to visual studio general questions, I will move the thread to https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=visualstudiogeneral for a professional support.

    Best regards,

    Joyce


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, October 13, 2016 5:44 AM
  • Hi Roy1958,

    >>I know this is trivial but if there is a setting in Visual Studio I would love to know about it

    We could not set the WebForm format through some settings in VS by default, but we could through the custom template to implement your idea, please refer to the following steps:

    1). Based on your description, I modified the webform as the following scrennshot:

    2). Click File->Export Template->Item template->Next-> check WebForm1.asp-> Next->Next->Type the template name (myWebForm)-> Finish

    3). Reopen the VS and open above project-> right click the project and add a new Item, select myWebForm template:

    4). Then we will get the custom template as the following screenshot:

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    • Edited by qing__Moderator Thursday, October 13, 2016 7:43 AM
    • Marked as answer by Roy1958 Thursday, October 13, 2016 12:11 PM
    Thursday, October 13, 2016 7:42 AM
    Moderator
  • Outstanding. Thank you so much.
    Thursday, October 13, 2016 12:12 PM