문제

I am writing asp.net C# project and testing this in Chrome browser.

The page consists several textboxes: one for user name, one for email, one for phone, password, etc.

I run the project and fill textboxes. Next time when I start typing in userName textbox all the previously typed words including email,address, phone.. start to appear as hint under the textbox, for example, like in the following picture(but this is not exactly in my project): enter image description here

Suppose that stack overflow is username typed before in this textbox, and stackhash_0a9e is useraddress typed before in address textbox. I want that stackkash_0a9e will not appear in this textbox, this should appear in textbox for address when user is typing there.

Is there solution of this, if so how? Thanks

도움이 되었습니까?

해결책

Textbox only shows that data which is entered in it, I don't know why your username textbox is also showing useraddress, probably you had entered useraddress in the username textbox. The textbox retains the previous value due to viewstate. You can disable the viewstate but it will stills shows you the previous data bcz it was also cached in browser. To disable the cache Add the ViewStateMode to your textbox and set it to ViewStateMode="Disabled" ViewStateMode is only available in .net 4

 <asp:TextBox ID="TextBox1" runat="server" ViewStateMode="Disabled"></asp:TextBox>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top