How do I debug an asp.net program without code behind?

不打扰是莪最后的温柔 提交于 2019-12-11 19:04:44

问题


I inherited a web site that I know little about. I've worked with asp.net/C# websites, but this seems to be something different. There is no code behind for me to put a break point and step through it. Also several refernces in the program can't be found. My general question is: How do I debug this program in Visual Studio?

Specifc questions related to this sample code:

  • Where do I put my break point?
  • What happens in this sample when a user clicks the submit button?
  • The program inherits "Company.Program.SystemLogin". I can't find that class in any of the code. Why not and how do I find it?

     <%@ Page Language="vb" AutoEventWireup="false" Inherits="Company.Program.SystemLogin" %>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     <HTML>
      <HEAD>
      <title>Company CMS</title>
      <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
      <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
      <meta name="vs_defaultClientScript" content="JavaScript">
      <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
      <style>
      BODY { FONT-SIZE: 11px; FONT-FAMILY: Verdana, Helvetica, sans-serif; BACKGROUND-COLOR: #ffffff }
       INPUT { FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana, Helvetica, sans-serif }
       TEXTAREA { FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana, Helvetica, sans-serif }
       SELECT { FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana, Helvetica, sans-serif }
        TD { FONT-SIZE: 11px; FONT-FAMILY: Verdana, Helvetica, sans-serif }
       .red { FONT-WEIGHT: bold; COLOR: #851205 }
       .orange { FONT-WEIGHT: bold; COLOR: #e05e02 }
       .message { FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #e05e02 }
       </style>
       </HEAD>
       <body onload="document.getElementById('txtUsername').focus();">
       <form id="Form1" method="post" runat="server">
    
    
                <table width="400" cellpadding="3" cellspacing="3" align="center">
                    <tr>
                        <td colspan="2" align="center"><img src="images/pcms.jpg" alt="Company CMS"></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center"><asp:Label ID="lblMessage" Runat="server" CssClass="message">PLEASE LOGIN</asp:Label></td>
                    </tr>
                    <tr>
                        <td align="right" class="red">Username</td>
                        <td><asp:TextBox ID="txtUsername" Runat="server" />
                            <asp:RequiredFieldValidator ID="rUsername" Runat="server" ControlToValidate="txtUsername" Text="*" Font-Bold="True"
                                Display="Dynamic" ForeColor="#E05E02" /></td>
                    </tr>
                    <tr>
                        <td align="right" class="red">Password</td>
                        <td><asp:TextBox ID="txtPassword" Runat="server" TextMode="Password" />
                            <asp:RequiredFieldValidator ID="rPassword" Runat="server" ControlToValidate="txtPassword" Text="*" Font-Bold="True"
                                Display="Dynamic" ForeColor="#E05E02" /></td>
                    </tr>
                    <tr>
                        <td align="right" class="red"><asp:label id="lblconn" Runat="server" Visible="False">Connection:</asp:label></td>
                        <td><asp:DropDownList ID="conns" Runat="server" Visible="False">
                                <asp:ListItem Value=""></asp:ListItem>
                            </asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center"><asp:Button id="btnSubmit" Runat="server" Text="Log In" CssClass="button" /></td>
                    </tr>
                </table>
    
        </form>
    </body>
    


回答1:


If you have inherited an application without source code, you have a tough challenge ahead of you.

You could use dotpeek or reflector to decompile the DLLs in order to recreate the source code, but this will be an onerous task.

My first point of call would be to find out if the source code was available anywhere.



来源:https://stackoverflow.com/questions/13386273/how-do-i-debug-an-asp-net-program-without-code-behind

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!