Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Session Variable in Insert Record

Guest
Jun 12, 2008 Jun 12, 2008
I am using the Insert Record server behavior to add records to a database. What I want to do is have the user select their name from a list when they first come to the site. Then I want to remember that value so that every single time they enter a new record, they don't have to pick their name from the drop down. Instead, the application would just insert that variable it got from the first page, and insert it into the Name field wherever it needs to. Was thinking a session variable could help do this, but not sure. Can someone point me in the right direction?
TOPICS
Server side applications
394
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 12, 2008 Jun 12, 2008
>I am using the Insert Record server behavior to add records to a database.
> What I want to do is have the user select their name from a list when they
> first come to the site. Then I want to remember that value so that every
> single time they enter a new record, they don't have to pick their name
> from
> the drop down. Instead, the application would just insert that variable it
> got
> from the first page, and insert it into the Name field wherever it needs
> to.
> Was thinking a session...
Translate
LEGEND ,
Jun 12, 2008 Jun 12, 2008
>I am using the Insert Record server behavior to add records to a database.
> What I want to do is have the user select their name from a list when they
> first come to the site. Then I want to remember that value so that every
> single time they enter a new record, they don't have to pick their name
> from
> the drop down. Instead, the application would just insert that variable it
> got
> from the first page, and insert it into the Name field wherever it needs
> to.
> Was thinking a session variable could help do this, but not sure. Can
> someone
> point me in the right direction?


You're on the right track.

On your first page:
<% Session("Username") = Request.Form("Username") %>

Then, on the page with the Insert Record behavior, add a hidden field with
the value:
<%=Session("Username")%>

Or in a form with the Username field, set the default value to:
<%=Session("Username")%>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 12, 2008 Jun 12, 2008
>
> On your first page:
> <% Session("Username") = Request.Form("Username") %>



More....
Set the form action = page2.asp, form method = post, then put that line of
code on page2.asp.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2008 Jun 17, 2008
LATEST
thanks for the info
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines