none
code behind issue

    Question

  • hoping this is the correct forum so I don't get my head bit off again :)

    anyway

    I have a project in vs 2015 com. that was goin great.  suddenly code behind is not generated for new objects.

    if I dbl click the object it takes me to the html  code. if I dbl click an object that has vb code behind from working on it earlier in the week it takes me to the html code instead of vb code.

    I can do view code and get to the existing vb code but I really do not want to manually add the default sub routines for objects and would love it to start opening the vb code on dbl click.

    I thought maybe the project was corrupt  but I have a project I created  long ago that also has the issue.

    I created a new project and same problem.

    created another new project and it works  no idea what's different.

    I have uninstalled vs 2015 and reinstalled

    I even installed 2017 and the project has same issue

    in 3 years of making web sites I have never had  this issue

    any ideas appreciated.

    thanks

    Tuesday, December 13, 2016 3:38 PM

All replies

  • Hi Texasmikey,

    According to your description, during the web developing (VB), when double click an object such as a button in Design panel, and VS will jump to Source panel not jump to code-behind panel, am I right?

    In my VS2015 and VS2017, I have created a VB web project separately, and when I double click a button in design panel and VS will jump to code-behind panel. Just like the following screenshot:

    Please refer to the following scenarios to troubleshot this issue:

    1). Delete all files under the following folders:

    C:\Users\<your users name>\AppData\Local\Microsoft\VisualStudio\14.0

    C:\Users\<your users name>\AppData\Roaming\Microsoft\VisualStudio\14.0

    2). We could start VS in safe mode (devenv /SafeMode), which could prevent all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.

    Click Start->Developer Command Prompt for VS-> type “devenv.exe / SafeMode”

    If I misunderstand your issue, please feel free to let me know.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 14, 2016 5:21 AM
    Moderator
  • thanks for the reply that did not  work

    I was back in business with a new project for a while  now its doing same thing

    a few more things that might help

    when I view the vb code that is there it shows warnings for  objects that are on the design page

    it says they are not defined.

    the page will compile and run just fine though when debugging under IE

    I want to say this seems to go  wrong when I do a add new item and select a web page from another project.

    it seems to corrupt all my projects though  not just the one I do that with.

    thanks again

    Friday, December 30, 2016 9:10 PM
  • acting very flakey

    my two biggest issues is dbl click opens html page and does not create subroutine on new objects

    also

    I created a new  web form right from that project  added a button

    had to manually add the code behind  from problem 1.

    I added a

    Response.Redirect to the new form and I get a server error in '/' application  even though I can see the new form in solution explorer

    Friday, December 30, 2016 9:45 PM
  • Hi Texasmikey,

    The HTML item is different from the .aspx item.

    For example, if I open the HTML file as Editor "HTML (Web Forms) Editor with Encoding", and then add a button in the Design page. If I double click "button", I also get the HTML code. I think it is related to the Editor you choose.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 02, 2017 7:52 AM
    Moderator
  • Update:

    If you open .aspx file and get the same issue, please change the editor with the default one "Web Forms Editor(Default)":

    If you choose the HTML Editor like my previous reply for the ASPX file, you will get this issue without the code behind.

    Thanks,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 02, 2017 7:55 AM
    Moderator