简体   繁体   English

从部署的网站查看ascx.cs文件?

[英]View ascx.cs files from deployed website?

I've got a website that I published on IIS, but it seems like I've got the wrong version of source code in my dev environment. 我有一个在IIS上发布的网站,但似乎在开发环境中源代码版本错误。
I just need the code from 1 ascx.cs file. 我只需要1个ascx.cs文件中的代码。

Can I get to the contents of an ascx.cs file from a deployed website? 我可以从已部署的网站获取ascx.cs文件的内容吗?

I've tried using .NET Reflector as suggested on other posts, but it seems like this tool only gives me access to my normal classes and not to the .ascx.cs files. 我已经尝试过按照其他帖子中的建议使用.NET Reflector,但似乎此工具仅使我可以访问常规类,而不能访问.ascx.cs文件。 Or am I just missing that? 还是我只是想念那个?

EDIT: Additional information as requested in answers. 编辑:答案中要求的其他信息。

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="timesheet.ascx.cs" Inherits="controls_timesheet" %>

You should use the DLL of the compiled web site to get the class that represents your .ascx.cs file. 您应该使用已编译网站的DLL来获取代表.ascx.cs文件的类。

For example, if your project is called MyWebSiteProject, you should have a MyWebSiteProject.dll on your /bin folder. 例如,如果您的项目名为MyWebSiteProject,则在/ bin文件夹中应该有一个MyWebSiteProject.dll。

Open this DLL with .net Reflector, or http://ilspy.net/ , if your control is named MyUserControl, it should be inside the namespace MyWebSiteProject. 使用.net Reflector或http://ilspy.net/打开此DLL,如果您的控件名为MyUserControl,则它应位于名称空间MyWebSiteProject中。

Please double check your project's and controls namespace first. 请先仔细检查您的项目和控件的名称空间。

Hope this helps, good luck :) 希望这有帮助,祝你好运 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM