.Net Datagrid内容在回发时丢失 [英] .Net Datagrid contents lost on postback

查看:51
本文介绍了.Net Datagrid内容在回发时丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

回发时是否有数据网格内容丢失的解决方法?

所有其他控件仍然存在。它只是数据网格似乎是重新初始化的。/ /
在回发时不断重建数据网格是没有意义的

其他控件不需要它。


提前致谢。

Is there a workaround for datagrid contents being lost on postback?
All other controls persist. It''s just datagrids that appear to be
reinitialized.
It doesn''t make sense to continually rebuild datagrids on postback when
other controls don''t require it.

Thanks in advance.

推荐答案




你需要显示(代码)如何使用它。否则有点难以帮助

你。


-

Teemu Keiski

ASP .NET MVP,AspInsider

芬兰,欧盟
http: //blogs.aspadvice.com/joteke

" Jeff" < JD **** @ bigfoot.com>在消息中写道

news:11 ********************* @ g14g2000cwa.googlegro ups.com ...
Hi,

you need to show (code) how it is used. Otherwise it is bit hard to help
you.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Jeff" <jd****@bigfoot.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
回发时是否有数据网格内容丢失的解决方法?
所有其他控件仍然存在。这只是数据网格似乎已经重新初始化。
当其他控件不需要时,在回发时不断重建数据网格是没有意义的。

提前致谢。
Is there a workaround for datagrid contents being lost on postback?
All other controls persist. It''s just datagrids that appear to be
reinitialized.
It doesn''t make sense to continually rebuild datagrids on postback when
other controls don''t require it.

Thanks in advance.



你可能已经禁用了viewstate,所以你必须重新绑定(不是

重建)你的数据网格。这是非常普遍的,没有什么不对的。

。除非你想打开viewstate并拥有一个巨大的

视图状态。


其他控件不需要它,因为它们使用表单字段数据

重新填充。数据网格不能这样做。


我不知道这是不是你的问题意味着什么。


-Sam

You''ve probably disabled viewstate so that you have to rebind (not
rebuild) your datagrid. That is very common and there''s nothing wrong
with it. Unless you want to turn viewstate on and have a huge
viewstate.

Other controls dont'' require it because they are using form field data
to repopulate. The datagrid can''t do that.

I dont'' know if this is what your question means.

-Sam


可能性:


1.数据网格的ViewState被禁用(不太可能)

2.数据网格的DataBinding发生在每个页面加载(而不是在

初始加载中)(非常可能)

Jeff" < JD **** @ bigfoot.com>在消息中写道

news:11 ********************* @ g14g2000cwa.googlegro ups.com ...
Possibilities:

1. ViewState of the datagrid is disabled (unlikely)
2. DataBinding of the datagrid occurring at every page load (and not in the
initial load) (very likely)
"Jeff" <jd****@bigfoot.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
回发时是否有数据网格内容丢失的解决方法?
所有其他控件仍然存在。这只是数据网格似乎已经重新初始化。
当其他控件不需要时,在回发时不断重建数据网格是没有意义的。

提前致谢。
Is there a workaround for datagrid contents being lost on postback?
All other controls persist. It''s just datagrids that appear to be
reinitialized.
It doesn''t make sense to continually rebuild datagrids on postback when
other controls don''t require it.

Thanks in advance.



这篇关于.Net Datagrid内容在回发时丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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