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. Clearing Texbox text in ASP.Net MVC

Clearing Texbox text in ASP.Net MVC

Scheduled Pinned Locked Moved ASP.NET
asp-netcsharparchitecturequestion
5 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.
  • P Offline
    P Offline
    Priya Prk
    wrote on last edited by
    #1

    Dear All, How can i clear the textboxes ofter a postback. I tried it with code below, but it doesn't work: ViewData.ModelState.Remove("txtPassword"); Thanks in advance.

    K 1 Reply Last reply
    0
    • P Priya Prk

      Dear All, How can i clear the textboxes ofter a postback. I tried it with code below, but it doesn't work: ViewData.ModelState.Remove("txtPassword"); Thanks in advance.

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      ViewData.ModelState.Clear();? Sorry I can't test this, I'm in the middle of and installation at the mo'.

      Sort of a cross between Lawrence of Arabia and Dilbert.[^]
      -Or-
      A Dead ringer for Kate Winslett[^]

      P 1 Reply Last reply
      0
      • K Keith Barrow

        ViewData.ModelState.Clear();? Sorry I can't test this, I'm in the middle of and installation at the mo'.

        Sort of a cross between Lawrence of Arabia and Dilbert.[^]
        -Or-
        A Dead ringer for Kate Winslett[^]

        P Offline
        P Offline
        Priya Prk
        wrote on last edited by
        #3

        Hi Keith, Thanks for your response. But unfortunately it does'nt work.

        K 1 Reply Last reply
        0
        • P Priya Prk

          Hi Keith, Thanks for your response. But unfortunately it does'nt work.

          K Offline
          K Offline
          Keith Barrow
          wrote on last edited by
          #4

          Oh well, worth a punt.

          Sort of a cross between Lawrence of Arabia and Dilbert.[^]
          -Or-
          A Dead ringer for Kate Winslett[^]

          V 1 Reply Last reply
          0
          • K Keith Barrow

            Oh well, worth a punt.

            Sort of a cross between Lawrence of Arabia and Dilbert.[^]
            -Or-
            A Dead ringer for Kate Winslett[^]

            V Offline
            V Offline
            vanikanc
            wrote on last edited by
            #5

            Why don't you try setting that text box to empty something like -- txtBoxPassword.Text = "";

            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