数据列表新文本框变为空白 [英] Datalist new textbox become blank

查看:106
本文介绍了数据列表新文本框变为空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个从数据库绑定的数据列表.有一个添加按钮可在数据列表中添加新文本框.

现在的问题是,当我在新文本框中和页面上写一些内容时,回发文本框文本变为空白,这是新生成的.为此,我无法将文本保存到数据库中.有什么解决方案吗?

Hello to all,

I have a datalist which is binded from database. There is an add button to add new text box in datalist.

Now the problem is that when I write something in the new textbox and on the page postback textbox text become blank which is new generated. For that I am not able to save the text into the database. Is there any solution for that?

推荐答案

我在新文本框中写了一些内容,在页面上发回文本框的文本变成空白
听起来像发生了回发,但一切都消失了.重置为旧值.

您已禁用页面或控件的视图状态,或者正在重置页面加载中的控件值.
继续阅读:了解ASP.NET视图状态 [ ASP.NET页面生命周期 [ ^ ],并了解如何使用 Visual Studio调试器 [使用调试器 [
I write something in the new textbox and on the page postback textbox text become blank
Sounds like a postback happened and all gone. Reset to old values.

Either, you have disabled viewstate for the page or controls or you are resetting the control values in your pageload.
Read on: Understanding ASP.NET View State[^]

But, before moving any forward, you need to read on ASP.NET Page Lifecycle[^] and learn on how to use Visual Studio DEBUGGER[^].
This also: Using the DEBUGGER[^]


这篇关于数据列表新文本框变为空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆