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. Advertising

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

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. Mark
    Replies:
    0
    Views:
    329
  2. John Wohlbier
    Replies:
    2
    Views:
    399
    Josiah Carlson
    Feb 22, 2004
  3. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    813
    Malcolm
    Jun 24, 2006
  4. Replies:
    8
    Views:
    489
    James Stroud
    Jan 29, 2009
  5. Kenneth McDonald
    Replies:
    1
    Views:
    107
    Robert Klemme
    Aug 27, 2007
Loading...

Share This Page