Unable to view codebehind in a ascx file - c#

I downloaded an open source project in ASP.NET language.
And I couldn't find any Codebehind file for example inside the Login.aspx the Codebehind is Login.aspx.cs but I cant find it anywhere in the source file. and the Line Codebehind="Login.aspx.cs" identified as "File Login.aspx.cs was not found" but yet the function is still working.
Where can I access those .cs file?

It seems that code you are looking for is compiled in DLL files. Try to get full source code instead of compiled one.
As mentioned by VKX, download link would help...

Verify that the file exist on disk. It may not be included in the project.
You could view all files by clicking the "Show all files" button on top of solution explorer.
If the file does not exist on disk, or reside in some other folder, move it to the appropriate folder. If the file is missing, redownload/unpack it to the correct folder.

For your confirmation once again recomplie the Application if application run successfuly then your file would be existed in the drive. As per your question, might be your application is working on the complied dll.
Just open the Login.aspx in the Visual studio just right click on the tab of the Login.aspx page and select the option "Open the Contaning folder". Check Login.aspx file is existed or not in that folder.

It seems You only have compiled website.So no *.cs file.
You will be able to use website(host using IIS) but cannot change source code.
To view the source code open .dll file using DotPeek Decompiler or RedGate Decompiler
and yes the download link provided in comment is broken.

Related

Cannot find aspx.cs file on Server

I got an asp.net web forms project developed from someone. When I check the httpdocs folder on server, I cannot find the aspx.cs files for the corresponding .aspx files. When I check the CodeBehind attribute, it shows like "[FILENAME].aspx.cs".
I also decompiled the dll of this project but even there the aspx.cs files were not present.
Please tell me where can I find the event handling files of this project.

Shared folder in ASP.NET MVC 4 project is hidden

For some reason, my shared folder ,which contains some error pages and my master _layout.cshtml page, is hidden. I can only access it when I click on show all files in my solution explorer. This is not a real problem, everything still works but I know this is not standard.
I don't know how this folder became a hidden folder, but does anyone know how to set the folder visible?
When I browse to my project folder in my file system, the folder is not a hidden folder...
I use Visual studio 2012, os = windows 7 64 bit
Just a wild guess here, but can you right click it (in Visual Studio) and "Include In Project"?
It will not be included in your .csproj file.
To include it, either open your .csproj file in notepad and add in the lines or remove the folder from the project and add it back in.

How to decompile an asp.net website

I have a website and i can open it with the VS 2010, but it has been compiled, i cannot find the app_code folder and the aspx.cs files. now i wanna see them and make some changes myself. I don't know how.
I know how to do it on a pure dll with the help of the reflector.
Does anyone here help me. Many thanks.
Not sure how you'd modify the compiled asp.net website, but here's how to find the dll's.
In your asp.net site you have for example an file called index.aspx, in your bin Directory there should be a file called something like index.aspx.abcd1234.compiled, open it with Notepad and look for the text assembly="App_Web_y5emcutv", that's the name of the compiled code's dll, just look for that name in your bin directory and open the dll in reflector and look for the ASP namespace.
That's it for the code, it would be rather hard to reverse that into a project file though.

aspx unable to locate code behind

I am able to execute my application fine using the Visual Studio IDE but when I create a release package and put it on the web server it can’t seem to find the code behind. However, if I copy the bin folder (which has the dll files) from the root directory and put it into the “root/reports” directory, everything works fine. The reports directory has all the .aspx web page files. What is causing this problem and what can I do to properly fix this problem?
Since you have published your website, that means your code files were compiled into a DLL. To work properly you have to put your DLL's into the bin folder on your host server.
For Details, Check this link:
An Overview of ASP.NET Code Generation and Compilation

Solution file opens up precompiled code in Inetpub

I have a folder that contains ASPX code and its codebehind (C#) as well as a solution file. The compiled version of the application resides in the inetpub directory.
Whenever I open the solution in Visual Studio, VS warns me that it is attempting to open a precompiled website and asks me if I want to continue. If I click NO it does nothing, but If I click yes it shows me the ASPX files in the inetpub directory.
How do I make the solution work with that code in the directory that it is in (ie with the aspx and codebehind)?
Thanks
Sounds like this solution was created by going to File->Open->Web Site and then saved afterward. In orther words, this is not the original solution file.
I suggest simply creating a new solution. Add the exisitng .csproj if appropriate (ie, you have a Web Application Project), or the existing web site from the directory your code is in.
Before you open your solution try opening your .sln file in Notepad or some other editor and double check that your web site path is right.
Debug.AspNetCompiler.VirtualPath = "/Url..."
Debug.AspNetCompiler.PhysicalPath = "Physical Path from the solution file\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\this might be the same as your physical path?\"

Categories

Resources