Problem passing spaces in Session Variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vini171285
    New Member
    • Apr 2008
    • 60

    Problem passing spaces in Session Variable

    Hi,

    I am doing a project in ASP.., in which i m including Customers name..I m asked to store customers name in Session variable..& then i m including customers name in the next page..i.e passing the customer name from 1st page to second page..But watever customer name i write...the entire name is not written to the next page...but only the name till space
    e.g if i write name as::
    Xyz Pqr
    It print only Xyz to the next page..
    But the entire name Xyz Pqr is written into the session variable...
    Then y is it not printed entirely in the text box...

    Thanx in Advance !
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi Vini,

    Can you print the code you are using to set and display your session variable please.

    If you use a Response.Write to display it rather than populating a textbox value does it display the full string?

    Dr B

    Comment

    • Vini171285
      New Member
      • Apr 2008
      • 60

      #3
      Hi, Bunchman
      Code on 1st Page:

      Code:
      <tr>
      	<td>
      	Customer's Name:
      	</td>
      	<td><input type=text name=custname size=50 value=<%=Session("custname")%>></td>
      	</tr>
      Code on 2nd Page
      Code:
      <input type=text name=custname size=50 readonly="readonly" value=<% Response.Write Session("custname")%>>
      Code in Session Part

      Code:
      Session("custname")=Request.Form("custname")


      When i just write Response.Write & print the value in the session...then it gives the correct value..but does not print it into the text box on 2nd Page..

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        So doing this:
        Code:
        <input type=text name=custname size=50 readonly="readonly" value=<%=Session("custname")%>>
        Doesn't work? Can you try putting quotes in like this:
        Code:
        <input type='text' name='custname' size='50' readonly="readonly" value='<%=Session("custname")%>'>
        And see what happens. Also you could try:
        Code:
        <%
        Dim sCustName
        sCustName= Session("custname")
        %>
        <input type='text' name='custname' size='50' readonly="readonly" value='<%=sCustName>'>
        Any of these work?

        Dr B

        Comment

        • jhardman
          Recognized Expert Specialist
          • Jan 2007
          • 3405

          #5
          Originally posted by Vini171285
          Hi,

          I am doing a project in ASP.., in which i m including Customers name..I m asked to store customers name in Session variable..& then i m including customers name in the next page..i.e passing the customer name from 1st page to second page..But watever customer name i write...the entire name is not written to the next page...but only the name till space
          e.g if i write name as::
          Xyz Pqr
          It print only Xyz to the next page..
          But the entire name Xyz Pqr is written into the session variable...
          Then y is it not printed entirely in the text box...

          Thanx in Advance !
          Vini,

          Could you please write out whole words? We do not have a limit to the number of characters in a post so there is no reason to write "Then y is it not..." or "I m". The correct way to write this is "Then why is it not..." and "I am" or "I'm".

          moderator

          Comment

          • DrBunchman
            Recognized Expert Contributor
            • Jan 2008
            • 979

            #6
            Originally posted by jhardman
            Vini,

            Could you please write out whole words? We do not have a limit to the number of characters in a post so there is no reason to write "Then y is it not..." or "I m". The correct way to write this is "Then why is it not..." and "I am" or "I'm".

            moderator
            As this is an international forum it makes it easier for everyone to understand you if you write your words correctly as JHardman says.

            Comment

            • Vini171285
              New Member
              • Apr 2008
              • 60

              #7
              The Code is Working..
              Thanx..

              Comment

              • DrBunchman
                Recognized Expert Contributor
                • Jan 2008
                • 979

                #8
                No problems Vini. Which solution worked for you?

                Comment

                • Vini171285
                  New Member
                  • Apr 2008
                  • 60

                  #9
                  Hi,

                  Actually both the code were working..but we used

                  Code:
                  <input type='text' name='custname' size='50' readonly="readonly" value='<%=Session("custname")%>'>
                  Thanx!

                  Comment

                  Working...