object instances when querying strings

Discussion in 'ASP .Net' started by Carlos, Feb 2, 2006.

  1. Carlos

    Carlos Guest

    Hi all,



    I get: Object reference not set to an instance of an object

    when trying tomdo the following:

    sEvent = Request.QueryString["EventId"];

    if (sEvent.Length == 0)

    Response.Write("empty");

    Which instance, and how is it to be created. I just want to test when the
    string

    is being passed with a value.

    Thanks in advance,

    Carlos.
     
    Carlos, Feb 2, 2006
    #1
    1. Advertisements

  2. sEvent = Request.QueryString["EventId"] == null ? "" :
    Request.QueryString["EventId"].ToString();
     
    Gabriel Magaña, Feb 2, 2006
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus Prediger
    Replies:
    2
    Views:
    1,847
    Markus Prediger
    Sep 28, 2005
  2. Albretch
    Replies:
    0
    Views:
    512
    Albretch
    Dec 12, 2004
  3. Dhruv
    Replies:
    6
    Views:
    932
    Dhruv
    Jul 2, 2003
  4. Dimitris Kamenopoulos

    Re: Limit Object Instances

    Dimitris Kamenopoulos, Jun 26, 2003, in forum: C++
    Replies:
    1
    Views:
    961
    amitpethkar
    Jun 27, 2003
  5. John Wohlbier
    Replies:
    2
    Views:
    560
    Josiah Carlson
    Feb 22, 2004
  6. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    1,116
    Malcolm
    Jun 24, 2006
  7. Replies:
    8
    Views:
    689
    James Stroud
    Jan 29, 2009
  8. Kenneth McDonald
    Replies:
    1
    Views:
    162
    Robert Klemme
    Aug 27, 2007
Loading...