简体   繁体   中英

Get the CodeFile property on aspx

How can you get the string on the Code File property of a aspx file using a javascript? I was trying alert(document.codefile); but it just returns undefined .

If you have the window's location, you can use a by-convention approach. There is no way to grab it in the way you showed above because javascript knows nothing of a server.

var loc = window.location + '.aspx';
//or .ascx depending

I don't know this would have any value for you, as it's useful to asp.net, but not JS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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