Display Session Variable in textbox?

W

What-a-Tool

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
 
S

Steven Burn

<%
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!
 
A

Aaron [SQL Server MVP]

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 "
 
W

What-a-Tool

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

What-a-Tool

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

Thank you again
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top