Thats not what I wanted.
I have created an object to do the trick. Code is posted
here for anyone else who wants this functionality.
Jacob, if there is an object in the framework that
already does this, let me know. And the
Page.Request.QueryString is no good, as I am not adding
this querystring to the current page. I am making up 10
different links to place in anchors on the web page. I
must make a querystring for each of these 10 links.
==================================
using System;
using System.Collections.Specialized;
namespace ITR.Web.HttpUtility
{
/// <summary>
/// Summary description for QueryString.
/// </summary>
public class QueryString : NameValueCollection
{
private string _queryStringStartChar
= "?";
private string _queryStringSeparatorChar
= "&";
/// <summary>
/// Returns a UrlEncoded Querystring
representation of the values in the namevaluecollection
/// </summary>
/// <returns></returns>
public override string ToString()
{
System.Text.StringBuilder
ReturnValue = new System.Text.StringBuilder();
bool FirstValue = true;
// Only fill the Stringbuilder if
there are values in the NameValueCollection
if (this.Count > 0)
{
// Add the questionmark
ReturnValue.Append
(_queryStringStartChar);
// Add all the values in
the NameValueCollection
foreach (string Key in
this.AllKeys)
{
// Add an
ampersand if this is not the first value
if (!FirstValue)
ReturnValue.Append(_queryStringSeparatorChar);
// Add the next
value
ReturnValue.Append
(System.Web.HttpUtility.UrlEncode(Key) + "=" +
System.Web.HttpUtility.UrlEncode(this[Key].ToString()));
}
}
return (ReturnValue.ToString());
}
} // QueryString
} // ITR.Web.HttpUtility
====================================
David
-----Original Message-----
Hi David,
I am not sure where you want to append the querystring
to a URL. As I understood, if you want to change the action property of
this webform by appending the querystring, you can override the Render
method, where you can replace the name of current web form with the same
one followed by the querystring.
If I have misunderstood your concern, please feel free
to let me know.
Best regards,
Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and
confers no rights.
.