Newbie question: session state:

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Newbie question: session state:

    I am fairly new to ASP.NET so please forgive errors in terminology.

    I am using the CrystalReportsViewer control to display report data over the
    web. Data is posted to the .aspx page from a different form on a standard
    ..html page. (I know ASP.NET likes to use postback to get form data, but I
    decided not to do that here.)

    The first page of the report loads fine, looks pretty, we're very happy, but
    when I try to browse to the another page, I get an error (string reference
    not set to an instance of String). I am 99% certain that this error occurs
    because the form data from the original .html page is getting dropped.

    My first inclination is to just stick that original form data into Session
    variables, and recode so that the report params are pulling from those
    Session variables instead of the original .html form variables. I'm pretty
    sure this will work, and doesn't seem ugly to me.

    But, I also know there is all sorts of fancy stuff in ASP.NET to manage
    persistence, and maybe there is a better or cleaner way. Any suggestions?

    Thanks,
    Matt
    Matt C. Guest

  2. Similar Questions and Discussions

    1. Urgent question regarding Session state in webservice
      hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the...
    2. newbie session question
      Hi, Normally to start a session one would use session_start(); Is there a different command to do this if you're instead using the...
    3. Session state question
      Inactivity, meaning no new request from the client. Note that this means that if the user sits at his browser for one minute, and then makes a new...
    4. Yes ... yet another question about Session State!! - Long
      Hi all As my posting title suggests I'm having problems using InProc Session state in my ASP .NET app. I wrote a site for a friend which uses...
    5. Blatant newbie question - killing a session
      Hi, this is my first question to the list and ... Yes I'm a newbie, verrry wet behind the ears. I am trying to set up a secured site under IIS. ...
  3. #2

    Default Re: Newbie question: session state:

    Instead of being 99% sure, why don't you set a breakpoint and make 100% sure
    where and what the error is?

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Matt C." <canimal@my-deja.com> wrote in message
    news:Xns93C0640DDD442canimalmydejacom@68.12.19.6.. .
    > I am fairly new to ASP.NET so please forgive errors in terminology.
    >
    > I am using the CrystalReportsViewer control to display report data over
    the
    > web. Data is posted to the .aspx page from a different form on a standard
    > .html page. (I know ASP.NET likes to use postback to get form data, but I
    > decided not to do that here.)
    >
    > The first page of the report loads fine, looks pretty, we're very happy,
    but
    > when I try to browse to the another page, I get an error (string reference
    > not set to an instance of String). I am 99% certain that this error
    occurs
    > because the form data from the original .html page is getting dropped.
    >
    > My first inclination is to just stick that original form data into Session
    > variables, and recode so that the report params are pulling from those
    > Session variables instead of the original .html form variables. I'm
    pretty
    > sure this will work, and doesn't seem ugly to me.
    >
    > But, I also know there is all sorts of fancy stuff in ASP.NET to manage
    > persistence, and maybe there is a better or cleaner way. Any suggestions?
    >
    > Thanks,
    > Matt

    Kevin Spencer Guest

  4. #3

    Default Re: Newbie question: session state:

    Well, I'm glad you identified the problem. Using Session is tricky, however,
    as Sessions time out. How are you transferring to the next page? You might
    be able to pass the document through using Server.Transfer to transfer to
    the next page, but before transferring, add the document to the HttpContext
    of the current page. Then you can grab it out of the context in the next.
    And you don't have to worry about Session time-outs.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Matt C." <canimal@my-deja.com> wrote in message
    news:Xns93C0C5E077660canimalmydejacom@68.12.19.6.. .
    > "Kevin Spencer" <kevin@takempis.com> wrote in
    > news:umh#6zHUDHA.2520@tk2msftngp13.phx.gbl:
    >
    > > Instead of being 99% sure, why don't you set a breakpoint and make 100%
    > > sure where and what the error is?
    >
    > Well, I was more like 99.9% sure. Sometimes I'd rather fix what I think
    is
    > the problem than spend time troubleshooting. :)
    >
    > I ended up setting the whole report document as a session variable, which
    > solved the problem nicely, for anyone else in similar straits.
    >
    > Matt

    Kevin Spencer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139