title: 'HttpRequest' does not contain a definition for 'Url'
body: <pre><code>public IActionResult Register(SysUser usr)
      {
          if (!ModelState.IsValid)
          {
              ViewData[&quot;Message&quot;] = &quot;Invalid Input&quot;;
              ViewData[&quot;MsgType&quot;] = &quot;warning&quot;;
              return View(&quot;UserRegister&quot;);
          }
          else
          {
              string insert =
                 @&quot;INSERT INTO SysUser (UserId, UserPw, FullName, Email, CorporateId, UserRole) VALUES
               ('{0}', HASHBYTES('SHA1', '{1}'), '{2}', '{3}', {4}, 'user')&quot;;
              if (DBUtl.ExecSQL(insert, usr.UserId, usr.UserPw, usr.FullName, usr.Email) == 1)
              {
                  usr.ActivationToken = Guid.NewGuid().ToString();
                  if (usr.ActivationToken != null)
                  {
                      string inst = @&quot;INSERT INTO SysUser(Active)VALUES('1')&quot;;
                      if (DBUtl.ExecSQL(inst, usr.Active) == 1)
                      {
  
  
  
                          string template = @&quot;Hi {0},&lt;br/&gt;&lt;br/&gt;
                             you have successfully created an account at Parkway Pantai Health Screening Portal.
  Please click on the link below to verify your email address and complete your registration. Your user id is &lt;b&gt;{1}&lt;/b&gt; and password is &lt;b&gt;{2}&lt;/b&gt;.
                             &lt;br/&gt;&quot;;
  
                          template+= &quot;&lt;/br&gt;&lt;a href= '&quot; + Request.Url.AbsoluteUri.Replace(&quot;CS.aspx&quot;, &quot;CS_Activation.aspx?ActivationToken&quot;+ usr.ActivationToken
                              ) + &quot;'&gt;Click here to activate your account.&lt;/a&gt;&quot;;
  
  
                          string title = &quot;Registration Successul - Welcome&quot;;
                          string message = String.Format(template, usr.FullName, usr.UserId, usr.UserPw);
                          string result = &quot;&quot;;
  
                          bool outcome = false;
                          // TODO: L10 Task 2b - Call EmailUtl.SendEmail to send email
                          //                     Uncomment the following line with you are done
                          outcome = EmailUtl.SendEmail(usr.Email, title, message, out result);
                          if (outcome)
                          {
                              ViewData[&quot;Message&quot;] = &quot;User Successfully Registered&quot;;
                              ViewData[&quot;MsgType&quot;] = &quot;success&quot;;
                          }
                          else
                          {
                              ViewData[&quot;Message&quot;] = result;
                              ViewData[&quot;MsgType&quot;] = &quot;warning&quot;;
                          }
                      }
                      else
                      {
                          ViewData[&quot;Message&quot;] = DBUtl.DB_Message;
                          ViewData[&quot;MsgType&quot;] = &quot;danger&quot;;
                      }
                  }
              }
              return View(&quot;UserRegister&quot;);
          }
      }
  </code></pre>
  <p>Hi all, I am trying to send a activation link using Guid.NewGuid() and when I want to generate a link using &quot;Request.Url.AbsoluteUri.Replace&quot; it shows a error where it says:</p>
  <blockquote>
  <p>'HttpRequest' does not contain a definition for 'Url' and no accessible extension method 'Url' accepting a first argument of type 'HttpRequest' could be found (are you missing a using directive or an assembly reference?).</p>
  </blockquote>
  <p>Is there any workaround to this? The framework i am using is c# .net framework 3.1. Thanks in advance for the help!</p>