Link to home
Start Free TrialLog in
Avatar of omegalove
omegalove

asked on

c#

       uxSendMessage.DefaultRecipient = QueryHelper.GetString("requestid", string.Empty);

how can I rewrite this?
Avatar of chapmanjw
chapmanjw
Flag of United States of America image

What are you trying to accomplish?
Avatar of omegalove
omegalove

ASKER

QueryHelper.GetString("requestid", string.Empty);
to remove thie queryhelper
#region Assembly CMS.GlobalHelper.dll, v2.0.50727
// C:\inetpub\wwwroot\KenticoCMS\Bin\CMS.GlobalHelper.dll
#endregion

using System;

namespace CMS.GlobalHelper
{
    // Summary:
    //     QueryString helper methods
    public static class QueryHelper
    {
        // Summary:
        //     Returns true if query parameter is present in the query string
        //
        // Parameters:
        //   name:
        //     Query parameter
        public static bool Contains(string name);
        //
        // Summary:
        //     Returns the boolean representation of a query parameter or default value
        //     if parameter is not boolean.
        //
        // Parameters:
        //   name:
        //     Query parameter
        //
        //   defaultValue:
        //     Default value
        public static bool GetBoolean(string name, bool defaultValue);
        //
        // Summary:
        //     Returns the double representation of a query parameter or default value if
        //     parameter is not an integer number.
        //
        // Parameters:
        //   name:
        //     Query parameter
        //
        //   defaultValue:
        //     Default value
        public static double GetDouble(string name, double defaultValue);
        //
        // Summary:
        //     Returns the GUID representation of a query parameter or default value if
        //     parameter is not GUID.
        //
        // Parameters:
        //   name:
        //     Query parameter
        //
        //   defaultValue:
        //     Default value
        public static Guid GetGuid(string name, Guid defaultValue);
        //
        // Summary:
        //     Generates hash for given QueryString
        //
        // Parameters:
        //   input:
        //     Query string starting with '?' or complete url
        //
        // Returns:
        //     SHA256 hash of query string
        public static string GetHash(string input);
        //
        // Summary:
        //     Generates hash for given QueryString
        //
        // Parameters:
        //   input:
        //     Query string starting with '?' or complete url
        //
        //   isQueryString:
        //     Indicates if input is query string or url
        //
        // Returns:
        //     SHA256 hash of query string
        public static string GetHash(string input, bool isQueryString);
        //
        // Summary:
        //     Returns the integer representation of a query parameter or default value
        //     if parameter is not an integer number.
        //
        // Parameters:
        //   name:
        //     Query parameter
        //
        //   defaultValue:
        //     Default value
        public static int GetInteger(string name, int defaultValue);
        //
        // Summary:
        //     Returns query string parameter or default value if query string is not defined.
        //
        // Parameters:
        //   name:
        //     Query parameter
        //
        //   defaultValue:
        //     Default value
        public static string GetString(string name, string defaultValue);
        //
        // Summary:
        //     Returns HTML encoded query string parameter or default value if query string
        //     is not defined.
        //
        // Parameters:
        //   name:
        //     Query parameter
        //
        //   defaultValue:
        //     Default value
        public static string GetText(string name, string defaultValue);
        //
        // Summary:
        //     Validates given QueryString against hash
        //
        // Parameters:
        //   name:
        //     Name of hash parameter in query string
        //
        // Returns:
        //     True if querystring is valid.
        public static bool ValidateHash(string name);
        //
        // Summary:
        //     Validates given QueryString against hash
        //
        // Parameters:
        //   name:
        //     Name of hash parameter in query string
        //
        //   excludedParameters:
        //     Parameters to exclude from hash validation. Multiple names separated by ';'.
        //
        // Returns:
        //     True if querystring is valid.
        public static bool ValidateHash(string name, string excludedParameters);
        //
        // Summary:
        //     Validates given value against hash
        //
        // Parameters:
        //   value:
        //     Value to validate
        //
        //   hash:
        //     Hash value
        //
        // Returns:
        //     True if hash is valid.
        public static bool ValidateHashString(string value, string hash);
    }
}

Open in new window

If I read it right, you are trying to get a Query String called "requestid".  This is how you would do it if that is the case:

uxSendMessage.DefaultRecipient = Request.QueryString["requestid"].ToString();
but is this doing for empty string?
SOLUTION
Avatar of chapmanjw
chapmanjw
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't understand what the problem is with the question.
Can one of you gentleman split the points between you two.
ok thanks.