Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Setting Texbox(Password mode) viewstate property true?????

Setting Texbox(Password mode) viewstate property true?????

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kapil Thakur
    wrote on last edited by
    #1

    i have a password textbox,a combobox (autopostback true) and a save button on my .aspx page. On combo SelectedIndexChanged, the page refreshes and the textbox doesn't saves the value in it.it becomes blank. So,how to save the text entered into it? its enable viewstate property is true.Even if i save its value in a viewstate variable (or session variable or global variable) and then re-assign the textbox that viewstate variable value on page refresh.it doesn't shows any text in it.it remains nothing.

    B E K 3 Replies Last reply
    0
    • K Kapil Thakur

      i have a password textbox,a combobox (autopostback true) and a save button on my .aspx page. On combo SelectedIndexChanged, the page refreshes and the textbox doesn't saves the value in it.it becomes blank. So,how to save the text entered into it? its enable viewstate property is true.Even if i save its value in a viewstate variable (or session variable or global variable) and then re-assign the textbox that viewstate variable value on page refresh.it doesn't shows any text in it.it remains nothing.

      B Offline
      B Offline
      babamara
      wrote on last edited by
      #2

      Try to use cookies. That works for me.

      1 Reply Last reply
      0
      • K Kapil Thakur

        i have a password textbox,a combobox (autopostback true) and a save button on my .aspx page. On combo SelectedIndexChanged, the page refreshes and the textbox doesn't saves the value in it.it becomes blank. So,how to save the text entered into it? its enable viewstate property is true.Even if i save its value in a viewstate variable (or session variable or global variable) and then re-assign the textbox that viewstate variable value on page refresh.it doesn't shows any text in it.it remains nothing.

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        Hi there, password text box is a bit different from normal one. To assign the value to the password textbox, you cannot do this by code-behind, you have to do this by js. Before the page get posted back, you save the password into an hidden field, then when the page reloaded, you wrote a js snipet code on bodyload event to read the password from the hidden field and assign to the password text box Hope u get the idea << >>

        1 Reply Last reply
        0
        • K Kapil Thakur

          i have a password textbox,a combobox (autopostback true) and a save button on my .aspx page. On combo SelectedIndexChanged, the page refreshes and the textbox doesn't saves the value in it.it becomes blank. So,how to save the text entered into it? its enable viewstate property is true.Even if i save its value in a viewstate variable (or session variable or global variable) and then re-assign the textbox that viewstate variable value on page refresh.it doesn't shows any text in it.it remains nothing.

          K Offline
          K Offline
          Kapil Thakur
          wrote on last edited by
          #4

          this is how you can do it , i found out: txtPassword.Attributes.Add("value", "the text you want to show")

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups