kamagra how much to take

Insert Values Into The URL With C#

This method will help you when you need to insert parameters into the URL string.

  1. public static string InsertURLParameters(string url, int listItemID, Page returnToPage)
  2. {
  3.         string firstInjection = SharePointTools.InsertURLParameters(url, listItemID, false);
  4.         string formatInjection = string.Format("Source={0}", SPEncode.UrlEncode(returnToPage.Request.Url.AbsoluteUri));
  5.         return InsertURLParameters(firstInjection, formatInjection, false);
  6. }
  7.  
  8. public static string InsertURLParameters(string url, string parameters, bool insertInFront)
  9. {
  10.         if (url.IndexOf('?') >= 0)
  11.         {
  12.                 if (insertInFront)
  13.                 {
  14.                         url = url.Replace("?", string.Format("?{0}&", parameters));
  15.                         return url;
  16.                 }
  17.                 url = url + string.Format("&{0}", parameters);
  18.                 return url;
  19.         }
  20.         url = url + string.Format("?{0}", parameters);
  21.         return url;
  22. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>