CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of querystring
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Collections.Specialized;
 
namespace WebControls
{
    /// <summary>
by Arjan   May 12, 2010 @ 4:34am
264 Views
no comments
 
function getQueryStringParams( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
by pushp   January 21, 2010 @ 2:38am
275 Views
no comments
 
C#
/// <summary>
/// Allows setting of a value in a UrlEncoded string. If the key doesn't exist
/// a new one is set, if it exists it's replaced with the new value.
/// </summary>
/// <param name="urlEncoded">A UrlEncoded string of key value pairs</param>
/// <param name="key"></param>
/// <param name="value"></param>
/// <returns></returns>
public static string SetUrlEncodedKey(string urlEncoded, string key, string value)
{
by Rick Strahl   November 30, 2009 @ 4:07pm
563 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate