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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -