Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7499269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:46:28+00:00 2026-05-29T19:46:28+00:00

I’m trying to figure out how to write a dynamic URL (a.k.a. activationlink) in

  • 0

I’m trying to figure out how to write a dynamic URL (a.k.a. activationlink) in a repository class.

Here’s what was working with but I’m not sure how to do the “http://mysite.com” dynamically:

private static void SendActivationEmail(User user)
{
    string ActivationLink = "http://mysite.com" +
                              user.Username + "/" + user.NewEmailKey;

    var message = new MailMessage("email@email.com", user.Email)
    {
        Subject = "Activate your account",
        Body = ActivationLink
    };

    var client = new SmtpClient("smtp.email.com");

    client.Send(message);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:46:29+00:00Added an answer on May 29, 2026 at 7:46 pm

    for your case you could do something like this

    String.Format("<a href=/"{0}/{1}/{2}">Click Here To Activate</a>",
          user.Username, user.NewEmailKey);
    

    if you know want the user to be redirected to a Activate web page via a url. then you would want to format the link via a query string
    this is an example use it how you need to to fit your UseCase

    HttpContext.Current.Request.Url.Host

    instead of HttpContext.Current.Request.Url

    For your local dev environment you will be getting localhost, but when you deploy this to some web server, this would correctly update itself to the hosted web server url.

    Ideally, you would have some path that would contain the querystring and then corresponding code in page load to validate and use the querystring.

    Example:

    <br/>"+HttpContext.Current.Request.Url.Host + @"/AccountValidate.aspx?id=SomeId"
    

    Note: You could use the HttpContext.Current.Request.Url also and that would redirect you to the current page with querystring:

    <br/>"+HttpContext.Current.Request.Url + "?user=SomeUser " .... same for user.NewEmailKey does this make sense..??
    

    And then in page load of AccountValidate.aspx or current page:

    string user = Convert.ToString(Request.QueryString["user"]);
    if(!string.IsNullOrEmpty(user))
    ... //Code here to inform the user of successful activation
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.