Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hellow pals,i have an application for registering students.One page is called Registration and another one called CompleteRegistration.What am doing is register students and then send to them the link to complete registration in the email.At now, i have coded the url for my locallhost in my page Registration.But the problem is that i have deployed the application but i need someone to explain to me how i can get the url for Complete Registration since now it would has changed and currently when i send an email,it adds the url for the Locallhost which someone cannot access in his browser.

Thanks
Posted
Comments
Gopi Kishan Mariyala 15-Jan-14 1:24am    
You have to create the link in the c# file. As per my understanding, you are getting the link in email as below
http://localhost/SampleApp/CompleteRegistration.aspx
In the cs file, you have to write some cs code as below
generatedLink = ServerName +"/"+ LocalFolderName+"/"+CompleteRegistration.
Hope this helps
Member 10398773 15-Jan-14 5:11am    
Hi Gopi,the server name will be my url ?i hope that is what i need you to help me understand please.
Gopi Kishan Mariyala 15-Jan-14 5:17am    
We will generally add a key value pair for servername in our web.config file
<add key="ServerName" value="test.com">
Then the next thing is the protocol whether it is http or https.

1 solution

 
Share this answer
 
v2
Comments
Member 10398773 15-Jan-14 5:14am    
What if i run it locally in my machine,will it need to be changed too please?
JoCodes 15-Jan-14 5:27am    
You can use relative path/url so that both works . Like Request.Url.AbsoluteUri
Member 10398773 15-Jan-14 5:35am    
Okey lemme try that i will give you results
Member 10398773 15-Jan-14 8:57am    
Hi,after using the Request.Url.AbsoluteUri method,it adds the url of current page for registration ,how can i b able to script the url to contain the link for completeRegistration only ,This is a sample link send to email below

http://localhost:89192/Staff/Register.aspx?rwndrnd=0.6363636646446373333CompleteRegistration.aspx?id=8901b88k1-81fa-8u10-m96e-892f6aea6710
JoCodes 15-Jan-14 9:22am    
Use relative urls ..eg: .http://stackoverflow.com/questions/2540021/getting-base-url-of-web-sites-root-absolute-relative-url ...can also search for how to use relative urls

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900