Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4017430
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:51:36+00:00 2026-05-20T09:51:36+00:00

We had a very strange issue on our servers this week, where a method

  • 0

We had a very strange issue on our servers this week, where a method in an aspx script (with no code-behind file) was somehow getting called from completely unrelated pages elsewhere on our site. Basically, the script said this:

   <script language="c#" runat="server">
   public void Page_Load(object sender, EventArgs e)
   {
        // some initializer logic
        PageMethod("data");
   }
   public string PageMethod (string strInput) 
   { 
        // More logic
   }
   </script>

We operate a farm of four servers, and we were seeing the PageMethod getting called by scripts in several places on all servers, so while my first instinct was that this was a corrupted cache on the server (and I still suspect it might be), my gut tells me that we were allowing this to happen with our code. We’ve been using this code style for yonks, but recently upgraded our servers to .NET 2.0.

My first question is, should a public method in an aspx every be accessible to a script elsewhere on a website? And my second question is, should we be using private or protected methods on aspx pages (I always figured the code in a stand-alone page was self contained, so sloppy access modifiers shouldn’t make a difference).

(Note: I don’t write much c#, so my grasp of the language is pretty much just theoretical. I’m just trying to troubleshoot this issue before it becomes a real issue.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:51:37+00:00Added an answer on May 20, 2026 at 9:51 am

    My first question is, should a public method in an aspx every be accessible to a script elsewhere on a website?

    In order to invoke a public instance method, an instance of this class is required. I suspect that your issue is not related to other scripts calling this method directly. It’s more probable that there is an HTTP request being sent to the corresponding ASPX page which in turns invokes the method. This request could be done by the client (some link on a page, …) or directly by the server (using HttpWebRequest). To further debug the problem try looking at the web server log files to see all the requests being made to this page.

    And my second question is, should we be using private or protected methods on aspx pages (I always figured the code in a stand-alone page was self contained, so sloppy access modifiers shouldn’t make a difference).

    If those method are not intended to be used by other parts of the code it is a good practice to make them private or protected and that’s not only related to ASP.NET.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Subversion has very strange behavior when moving/deleting folder. I had this error Subversion unreliable:
StackOverflow user jolson had a very nice piece of code that exemplifies how one
Having a very strange issue with a few creative banners. On some computers when
Has anyone seen this very strange behaviour before? I've got a solution whith 70
I had found a strange output when I write the following lines in very
I have a very strange problem with my code. It will fully run the
Well. This night was a very strange night to me. I am sorry to
The company I work for has historically had very little process as far as
I have some questions about customers about NF mode for DB2. Google had very
I am very new to creating webservers - and I have had several goes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.