Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding what method is called

I have an ASPX page with no code behind (that is, no .aspx.cs with the same name). In the code is this line:

<div style="overflow: hidden; text-align: center; z-index: 105;">
    <%= MainNavBarHTML %><%= SubNavBarHTML %>
</div>

I've searched the rest of the program for MainNavBarHTML and SubNavBarHTMl, but can't find any reference to them. How do I find what fills those elements?

like image 212
boilers222 Avatar asked Mar 06 '26 21:03

boilers222


2 Answers

You might want to check out the CodeFile vs CodeBehind question.

If your ASPX markup has the CodeFile directive, it will look for the associated .cs file:

<%@ Page
    Language="C#"
    CodeFile="CustomerDetail.aspx.cs"
    Inherits="SomePage" %>

If, instead, it has the CodeBehind directive listed it will look in the Bin folder for an assembly that has the class defined:

<%@ Page
    Language="C#"
    CodeBehind="CustomerDetail.aspx.cs"
    Inherits="SomePage" %>

The naming of these two directives is beyond unfortunate. If the application is using CodeBehind (which it sounds like it is) you may not have access to the source and will be unable to view the definition for those properties, short of using a .NET reflection tool against the compiled assemblies.

like image 176
Yuck Avatar answered Mar 08 '26 09:03

Yuck


In Visual Studio, Put your cursor on the text and press F12 to jump to definition or right-click on the text and choose "Go to definition".

like image 40
avb Avatar answered Mar 08 '26 11:03

avb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!