473,804 Members | 3,123 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display Session Variable in textbox?

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

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

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

Help please?

Sean
Jul 22 '05 #1
4 16067
<%
Session("MySess ion")="abcdefg "
sTemp = Session("MySess ion")
%>

<input type="text" value="<%=sTemp %>" name="txtSessio nValue">

--
Regards

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

Keeping it FREE!

"What-a-Tool" <Di************ *************@I HateSpam.Com> wrote in message news:KDh%d.7011 4$SF.58946@lake read08...
I want to display a session variable as a textbox value:

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

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

Help please?

Sean



Jul 22 '05 #2
Does it work if you just do <%=Session("myv ar")%> 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@lakeread0 8,
"What-a-Tool" <Di************ *************@I HateSpam.Com> wrote:
I want to display a session variable as a textbox value:

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

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

Help please?

Sean


Jul 22 '05 #3
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]" <te*****@dnartr eb.noraa> wrote in message
news:BE631B1B.4 07C%te*****@dna rtreb.noraa...
Does it work if you just do <%=Session("myv ar")%> 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@lakeread0 8,
"What-a-Tool" <Di************ *************@I HateSpam.Com> wrote:
I want to display a session variable as a textbox value:

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

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

Help please?

Sean

Jul 22 '05 #4
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]" <te*****@dnartr eb.noraa> wrote in message
news:BE631B1B.4 07C%te*****@dna rtreb.noraa...
Does it work if you just do <%=Session("myv ar")%> 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@lakeread0 8,
"What-a-Tool" <Di************ *************@I HateSpam.Com> wrote:
I want to display a session variable as a textbox value:

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

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

Help please?

Sean

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
4392
by: | last post by:
Hi, I want to do things this way: I have a bunch of stuff that I want to keep track of while a user is connected to the site. Maybe 50 little peices of information. So I know I can make 50 session variables , or an store an array in a session variable, but what I wanna do is store it all in a class so I can use property get and property let.
5
4799
by: Scott | last post by:
I'm trying to set a session variable after displaying a form, then capture the Session variable on postback. For some reason, the below code always returns the form, not the "Step 2" results part. What am I doing wrong? It's on a local network server, not on the web if that matters. <% '* Step 2: Display results '**********************************************
2
6172
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and then appends the data to a dataset that is built in the Page_Load code in the if(!isPostBack) block. When I try to add a row in the button click event code I get an error saying that "Object reference not set to an instance of an object". I'm...
2
6167
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on which is loosely based on the e-commerce example in the quickstarts tutorial. In the cart display I have provided functionality so that when a user clicks on a product name a popup is opened with the full product details displayed.
2
1500
by: Todd | last post by:
Here's one that has been stumping people: I'm writing in ASPX with VB.NET On the login page I set the entered usename text to a session variable. ************************************************************************ Private Sub lbtnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbtnSubmit.Click Dim bolLogin As Boolean
5
3183
by: TRB_NV | last post by:
I'm losing information from my Session when I change pages or start the same page over again. I simplified the code so the example is really clear. The sample code that follows is supposed to generate a random number and put it into an Array and store it in the Session variable and then when it runs the next time, generate another random number and display the entire Array contents, by pulling the information out of the Session. I'd...
1
1745
by: SLH | last post by:
i have an asp page with a form that posts to itself. (the action of the form is the same page the form is on). i validate input and dont accept it if there is something wrong with it. problem is that when the form is submitted, and i display the error message, the data the user typed in the box is gone. i work around this by setting a session variable as soon as the user hits submit and store the data the user typed. then for the default...
1
1346
by: adriann | last post by:
Hi, I have a page that displays Mysql query results in either "simple" or "detailed" format. The directive to display in the desired format is obtained by looking at the value of a Session variable. If the variable is not set, (ie: first time a search has been initiated), then "simple" mode is assumed and the session variable set accordingly. As part of the finished page, there is a link to advise the user to click HERE to swap-over to...
7
2710
by: ltarrant | last post by:
Hi, I'm having problems with a DataTable I'm storing in a session variable. I use this as a temporary store for a shopping cart until a customer goes through the checkout and the cart is saved to my database. I have used DataTables stored in sessions before for shopping baskets with no problems. However, on this occasion I am only passing the AddHandler the product id and the quantity being added. The Handler then calls a getProductDetail...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.