locked
i cant access to the code view of web forms RRS feed

  • Question

  • User2113346311 posted

    i have a default.aspx form created by someone i want to view the code, when i cllick on the view code link its shows me the html coding means font coding but i want to view the C# back end coding how i can solve the problem?

    please help me..

    Monday, January 14, 2013 4:30 PM

Answers

  • User281315223 posted

    Bizarre means strange. (I was saying that this was a strange issue.)

    However - if you recieved the .aspx page from someone and don't have the associated .cs page, it is liked a compiled version of the .aspx page and you most likely won't be able to access the code-behind in it. (Without using a decompiler, which can make things quite messy.)

    Basically - it isn't hidden within your solution, it has been compiled into your .aspx page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 16, 2013 3:45 PM

All replies

  • User281315223 posted

    If you are referring to visiting a default.aspx page online and clicking View Source, then you are not going to be able to view the code-behind on that page. (This is intended as it is referred to as "code-behind" for a reason)

    ASPX pages are composed of two parts from a development standpoint:

    • The .ASPX page, which houses all of the UI elements of the page and what the user is allow to see and interact with.
    • The .CS page, which contains all of the "code-behind" and everything that allows the page to function and the user isn't allow to see.

    I'm sure there are decompilers out there that exist for this very purpose, however if you use one don't expect to see exactly what is in the actual code-behind for the site.

    Monday, January 14, 2013 4:35 PM
  • User2113346311 posted

    i have all the file on my machine. not in online page. yes it is the possible cause that decompilers is exist ! but how i can get rid of it? is there any way to view the actual code behind ? all the needed file is available on my pc for the project.

    Monday, January 14, 2013 5:08 PM
  • User281315223 posted

    You should have two files as mentioned before (default.aspx and default.aspx.cs file) and on your machine you should be able to go into your IDE (Visual Studio or Visual Web Developer) and open the default.aspx.cs file.

    You should see your file(s) appear and you should be able to double-click on one of them, or right-click and Select View Code to access the code-behind.

    If you don't have any IDEs installed - you can use Notepad to open it as well.

    Monday, January 14, 2013 5:13 PM
  • User2113346311 posted

    http://tinypic.com/r/2wnvl7r/6

    please see the image.. i am unable to upload the image here.. there is a default2.aspx which i recently created tha has a .cs file but no other web form has any .cs file why?

    how i can view the .cs file of the others?

    Wednesday, January 16, 2013 11:34 AM
  • User281315223 posted

    You should be able to Right-Click on one of your .aspx pages that does not have an associated .cs file and select the View Code option. This should allow you to view the code-behind for the page.

    If your .cs file does not appear after doing this, click the Refresh button within your Solution Explorer to update your files.

    Wednesday, January 16, 2013 11:57 AM
  • User2113346311 posted

    Rion williams ,

    you are right . but have you seen the image? there are no node for the othere web form, and when i click on view code it shows the html code page. in that page when i click right button there are no any option like view code. can you tell me why?

    thanks for giving me time.... thanks alot.Smile

    Wednesday, January 16, 2013 1:54 PM
  • User281315223 posted

    That is bizarre. How did you create your .aspx pages? Did you use the Right-Click => Add => New Item =>Web Form?

    Wednesday, January 16, 2013 3:21 PM
  • User2113346311 posted

    bizarre means?

    i have written earlier that those web form is not created by me. some one created those. i create the default2.aspx and that has the .cs file but those have nothing. how come? i want the answer? can u help me? is there any process to hide the .cs file?

    Wednesday, January 16, 2013 3:38 PM
  • User281315223 posted

    Bizarre means strange. (I was saying that this was a strange issue.)

    However - if you recieved the .aspx page from someone and don't have the associated .cs page, it is liked a compiled version of the .aspx page and you most likely won't be able to access the code-behind in it. (Without using a decompiler, which can make things quite messy.)

    Basically - it isn't hidden within your solution, it has been compiled into your .aspx page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 16, 2013 3:45 PM