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.Qu eryString 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.Collecti ons.Specialized ;
namespace ITR.Web.HttpUti lity
{
/// <summary>
/// Summary description for QueryString.
/// </summary>
public class QueryString : NameValueCollec tion
{
private string _queryStringSta rtChar
= "?";
private string _queryStringSep aratorChar
= "&";
/// <summary>
/// Returns a UrlEncoded Querystring
representation of the values in the namevaluecollec tion
/// </summary>
/// <returns></returns>
public override string ToString()
{
System.Text.Str ingBuilder
ReturnValue = new System.Text.Str ingBuilder();
bool FirstValue = true;
// Only fill the Stringbuilder if
there are values in the NameValueCollec tion
if (this.Count > 0)
{
// Add the questionmark
ReturnValue.App end
(_queryStringSt artChar);
// Add all the values in
the NameValueCollec tion
foreach (string Key in
this.AllKeys)
{
// Add an
ampersand if this is not the first value
if (!FirstValue)
ReturnValue.App end(_queryStrin gSeparatorChar) ;
// Add the next
value
ReturnValue.App end
(System.Web.Htt pUtility.UrlEnc ode(Key) + "=" +
System.Web.Http Utility.UrlEnco de(this[Key].ToString()));
}
}
return (ReturnValue.To String());
}
} // QueryString
} // ITR.Web.HttpUti lity
=============== =============== ======
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.
.