在ASP.NET C#中添加动态行 [英] Adding dynamic rows in ASP.NET C#

查看:94
本文介绍了在ASP.NET C#中添加动态行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

这里我想在Gridivew中添加动态行。在这里,我使用Viewstate完成。但在我的项目中,我需要做一些计算看起来像销售或购买屏幕。并有项目下拉列表加载和项目至少有500个计数。如果我使用Viewstate Grid应该是30行的慢速。任何其他建议动态网格快速(这里我需要添加每个发票最少100行)。



我尝试过:



这里我使用Viewstate,FirstRow,SetPreviousRow,SetRowdata完成DynamicGridView。

解决方案

你需要使用 ViewState 时要小心,以避免页面性能问题。此外 ViewState 在大小方面有限制,因此请确保不要在其中存储大量数据。



如前所述,您可以使用JavaScript / jQuery在客户端添加动态控件。这样,所有交互只发生在浏览器上,因此您可以快速响应。只需谷歌使用jquery添加动态文本框来获取更多示例。这是我发现的一个:如何使用jQuery动态添加/删除文本框 [ ^ ]

Hi to all,
Here i want to add dynamic row in Gridivew. Here i done using Viewstate. But in my project Here i need to do some calculation look like sales or purchase Screen. and have Item dropdown To load and Item Have minimum 500 count. If i using Viewstate Grid should be Slow for 30 rows. Any Other suggestion to do Dynamic Grid be Fast(Here I need to add minimum 100 row of per Invoice).

What I have tried:

Here i done DynamicGridView Using Viewstate,FirstRow,SetPreviousRow,SetRowdata.

解决方案

You need to be careful when using ViewState to avoid page performance issue. Also ViewState has a limit when it comes to size, so make sure that you don't store a huge amount of data in it.

As already suggested, you can use JavaScript/jQuery to add dynamic controls at the client. That way all interactions only happens at the browser, so you can have a fast response. Just google "adding dynamic textbox using jquery" to get more examples. Here's one I found: How to add / remove textbox dynamically with jQuery[^]


这篇关于在ASP.NET C#中添加动态行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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