Display Session Variable in textbox?

Discussion in 'ASP General' started by What-a-Tool, Mar 20, 2005.

  1. What-a-Tool

    What-a-Tool Guest

    I want to display a session variable as a textbox value:

    <input type="text" ...... value="<%=Session("myvar")%>">

    I've tried several different variation of this and can't get it to display
    properly with any.

    Help please?

    Sean
    What-a-Tool, Mar 20, 2005
    #1
    1. Advertising

  2. What-a-Tool

    Steven Burn Guest

    <%
    Session("MySession")="abcdefg"
    sTemp = Session("MySession")
    %>

    <input type="text" value="<%=sTemp%>" name="txtSessionValue">

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    "What-a-Tool" <Die!FrigginSpammers!DieDie!@IHateSpam.Com> wrote in message news:KDh%d.70114$SF.58946@lakeread08...
    > I want to display a session variable as a textbox value:
    >
    > <input type="text" ...... value="<%=Session("myvar")%>">
    >
    > I've tried several different variation of this and can't get it to display
    > properly with any.
    >
    > Help please?
    >
    > Sean
    >
    >
    Steven Burn, Mar 20, 2005
    #2
    1. Advertising

  3. Does it work if you just do <%=Session("myvar")%> straight to the screen?
    (My guess is that the session variable is empty, because your syntax below
    looks fine... as long as the session variable can't contain "


    On 3/20/05 11:36 AM, in article KDh%d.70114$SF.58946@lakeread08,
    "What-a-Tool" <Die!FrigginSpammers!DieDie!@IHateSpam.Com> wrote:

    > I want to display a session variable as a textbox value:
    >
    > <input type="text" ...... value="<%=Session("myvar")%>">
    >
    > I've tried several different variation of this and can't get it to display
    > properly with any.
    >
    > Help please?
    >
    > Sean
    >
    >
    Aaron [SQL Server MVP], Mar 20, 2005
    #3
  4. What-a-Tool

    What-a-Tool Guest

    What my posted code string displays in the text box is :
    "<%=Session(" -inside the text box, and a final ">" -outside the
    text box




    "Aaron [SQL Server MVP]" <> wrote in message
    news:BE631B1B.407C%...
    > Does it work if you just do <%=Session("myvar")%> straight to the screen?
    > (My guess is that the session variable is empty, because your syntax below
    > looks fine... as long as the session variable can't contain "
    >
    >
    > On 3/20/05 11:36 AM, in article KDh%d.70114$SF.58946@lakeread08,
    > "What-a-Tool" <Die!FrigginSpammers!DieDie!@IHateSpam.Com> wrote:
    >
    >> I want to display a session variable as a textbox value:
    >>
    >> <input type="text" ...... value="<%=Session("myvar")%>">
    >>
    >> I've tried several different variation of this and can't get it to
    >> display
    >> properly with any.
    >>
    >> Help please?
    >>
    >> Sean
    >>
    >>

    >
    What-a-Tool, Mar 20, 2005
    #4
  5. What-a-Tool

    What-a-Tool Guest

    Thank you for your help - got it working - just noticed I was doing
    something stupid that I kept overlooking.

    Thank you again


    "Aaron [SQL Server MVP]" <> wrote in message
    news:BE631B1B.407C%...
    > Does it work if you just do <%=Session("myvar")%> straight to the screen?
    > (My guess is that the session variable is empty, because your syntax below
    > looks fine... as long as the session variable can't contain "
    >
    >
    > On 3/20/05 11:36 AM, in article KDh%d.70114$SF.58946@lakeread08,
    > "What-a-Tool" <Die!FrigginSpammers!DieDie!@IHateSpam.Com> wrote:
    >
    >> I want to display a session variable as a textbox value:
    >>
    >> <input type="text" ...... value="<%=Session("myvar")%>">
    >>
    >> I've tried several different variation of this and can't get it to
    >> display
    >> properly with any.
    >>
    >> Help please?
    >>
    >> Sean
    >>
    >>

    >
    What-a-Tool, Mar 20, 2005
    #5
    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. Jeff Smythe
    Replies:
    3
    Views:
    1,225
    Jeff Smythe
    Jan 2, 2004
  2. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    7
    Views:
    863
    Swanand Mokashi
    Apr 5, 2006
  3. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,250
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  4. chowchho
    Replies:
    7
    Views:
    617
    Patrice
    Mar 28, 2008
  5. Jazzis
    Replies:
    2
    Views:
    232
    Jazzis
    Sep 23, 2003
Loading...

Share This Page