score:0

Accepted answer
var path = httpcontext.current.request.url.absolutepath;
var pastslashpos = path.lastindexof('/') + 1;
var countuntildot = path.indexof('.', pastslashpos);
countuntildot = (countuntildot >= 0 ? countuntildot : path.length) - pastslashpos;
pagename = path.substring(pastslashpos, countuntildot);

Related Query

More Query from same tag