Avatar of Michael Sterling
Michael SterlingFlag for United States of America

asked on 

Why does my 2nd query string parameter always come up null?

I'm trying to pull a 2nd query string parameter value in as a property to a user control, for some reason it is always coming up null. I think it has something to do with the way i'm constructing my redirect string but i'm not sure. below is the the redirect url, and the properties as i'm trying to get / set them. can someone show me what's wrong with what i'm doin.
Response.Redirect(String.Format("/StudentTime.aspx?AddEdit={0}&SearchBy={1}", addEdit, "FirstAndLastName"));

---my properties GET / SET---

    public String AddEdit
    {
        get
        {
            m_addedit = Request.QueryString["AddEdit"];
            return m_addedit;
        }
        set
        {
            m_addedit = value;
        }
    }

    public String SearchBy
    {
        get
        {
            m_searchby = Request.QueryString["SearchBy"];
            return m_searchby;
        }
        set
        {
            m_searchby = value;
        }
    }

---THE INITIAL IF BELOW ALWAYS FAILS--
        if (!string.IsNullOrEmpty(SearchBy))
        {
            if (string.Equals(SearchBy, "FirstAndLastName"))
            {
                iobl = InOutListProcessor.GetInOutRecsByStudentName(SearchBy);
                //iobl.Add(iob);
            }
            if (string.Equals(SearchBy, "StudentID"))
            {
                iob = InOutListProcessor.GetInOutRecsByStudentID(SearchBy);
                iobl.Add(iob);
            }
            if (string.Equals(SearchBy, "TeamName"))
                iobl = InOutListProcessor.GetInOutRecsByTeamName(SearchBy);
        }

Open in new window

C#ASP.NETASP

Avatar of undefined
Last Comment
Michael Sterling
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Michael Sterling

ASKER

thanks
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo