In Script.aspx.cs you can just check Request.Path compared to the current execution path.
if ( Request.CurrentExecutionFilePath == Request.Path )
{
} else {
}
Why?
, Server.Execute. , Request.Path Script.aspx.cs Server.Execute - .aspx.cs, , "/Webpage.aspx".
, - Script.aspx, Request.Path Script.aspx.cs "/Script.aspx". CurrentExecutionPath script, .
, .