1 stringInsertorupdatequerystringitem (stringKeystringvalue)2 {3 if(Request.QueryString.HasKeys ())4 {5 if(! array.exists<string> (Request.QueryString.AllKeys, (qs) + = {returnQs. Equals (key); }))6 {7 return string. Format ("{0}&{1}={2}", Request.rawurl, key, value);8 }9 ElseTen { OneSystem.Text.StringBuilder Pathbuilder =NewSystem.Text.StringBuilder (request.path); APathbuilder.append ("?"); - stringKeyValue; - stringkeycurrent; the intHandedcount =0; - - foreach(varKinchRequest.QueryString.AllKeys) - { + - if(!k.equals (key)) + { AKeyValue =Request.querystring[k]; atKeycurrent =K; - } - Else - { -KeyValue =value; -Keycurrent =key; in } - to if(string. IsNullOrEmpty (keyValue)) + { - Continue; the } * $ if(handedcount++! =0)Panax Notoginseng { -Pathbuilder.appendformat ("&{0}={1}", Keycurrent, keyValue); the } + Else A { thePathbuilder.appendformat ("{0}={1}", Keycurrent, keyValue); + } - } $ returnpathbuilder.tostring (); $ } - } - return string. Format ("{0}? {1}={2}", Request.path, key, value); the}