wtf | Dmytro Shteflyuk's Home https://kpumuk.info In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming. Mon, 07 Sep 2015 23:49:38 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 Crazy piece of code: Checking query parameter https://kpumuk.info/asp-net/crazy-piece-of-code-checking-query-parameter/ https://kpumuk.info/asp-net/crazy-piece-of-code-checking-query-parameter/#comments Mon, 17 Dec 2007 20:47:35 +0000 http://kpumuk.info/asp-net/crazy-piece-of-code-checking-query-parameter/ How often you are laughing out loud when looking on the someone’s code? Today I found great code in my current project and I can’t hold posting this to my blog. So, 1234567891011if (Request.QueryString.HasKeys()) {     string[] keys = Request.QueryString.AllKeys;     foreach (string k in keys)     {         […]

The post Crazy piece of code: Checking query parameter first appeared on Dmytro Shteflyuk's Home.]]>
How often you are laughing out loud when looking on the someone’s code? Today I found great code in my current project and I can’t hold posting this to my blog. So,

1
2
3
4
5
6
7
8
9
10
11
if (Request.QueryString.HasKeys())
{
    string[] keys = Request.QueryString.AllKeys;
    foreach (string k in keys)
    {
        if (k == "memberpagemode" && (string)Request.QueryString.GetValues(k).GetValue(0) == "edit")
        {
            pSett.ChangeFormViewMode(FormViewMode.Edit);
        }
    }
}

And how do you search through the hash for a key with specified value?

The post Crazy piece of code: Checking query parameter first appeared on Dmytro Shteflyuk's Home.]]>
https://kpumuk.info/asp-net/crazy-piece-of-code-checking-query-parameter/feed/ 13