c# - Get the URI of a specific webform -


i'm in process of learning .net, , need uri of specific webform.

the framework asp.net 3.5

example: i'm in aboutme.aspx.cs , need find out uri of contactme.aspx be. edit clarify: give method path contactme.aspx --> "~/contactme.aspx" , "www.porcupine.com/contactme.aspx"

the reason i'm trying figure out want render email template page, has specific variables per person, , able copy entire page string via webclient().downloadstring() method. method requires uri of page convert string.

does know of way this? or of elegant alternative way (i.e., without writing out entire page body of message, etc.)?

this should work need:

string url = request.url.scheme + system.uri.schemedelimiter + request.url.host + (request.url.isdefaultport ? "" : ":" + request.url.port) +  resolveurl("~/contactme.aspx"); 

in case returns:

http://localhost:3165/website88/contactme.aspx 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -