如何从一个aspx页保留到另一个然后返回的gridview或datagrid的值 [英] How to retain the values of a gridview or a datagrid from one aspx page to another and then back

查看:57
本文介绍了如何从一个aspx页保留到另一个然后返回的gridview或datagrid的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要创建在网格视图或数据网格中具有内容的网页. (控件类似于Excel工作表).在此输入一些数据后,我需要继续在第二个网页中填充数据,该网页具有一些文本框和添加的详细信息.我打算通过链接或下一步"按钮来实现此目的.
在第二个网页中输入数据后,我希望返回以查看我填写的内容.
然后最后单击一个保存按钮,它将把两种形式的数据放到一个表中.

请帮助我找到一种解决方案,当我单击下一步"然后返回同一页面时,将内容保留在网格中.返回页面时,我应该输入先前输入的值.

在Windows中,我通过不允许创建的表单的另一个实例(对象)来解决此问题.
由于我是ASP的新手,所以我不知道如何解决此问题.从概念上讲,在登录之前,我不希望创建该页面的另一个实例.

Hi,
I need to create web page that has content in grid view or data grid. (the control is similar to an excel sheet). After entering some data in this i need to continue filling the data in a second web page which has some text boxes and added details. I plan this to do with a link or button "Next".
After entering the data in the second web page i wish to come back to review what i have filled.
and then finally click a save button that will put the data in the two forms to one table.

please help me find out a solution to keep the content in the grid when i click next and then come back to the same page. on coming back to the page i should have the values entered previously.

In windows i had solved this issue by not letting another instance(object) of the created form be allowed.
As i am new to ASP i cant figure out how to solve this issue. conceptually i dont want another instance of that page be created till i am logged in.

推荐答案



据我所知,您可以将首页数据保存在会话变量中,例如


Hi,

Upto my knowledge you can save your first page data in session variable like


DataTable dt=new DataTable();
dt.rows[0][0]=(gridView.rows[0].findcontrol("TextBox")).Text;
//..
//..
 Session["frstdata"]=dt;
response.redirect("nextpage.aspx");



将此类型的代码放置在下一步"按钮单击事件中

进入下一页后,您可以在第二页或其他任何地方检索第一页信息

喜欢



place this type of code in next button click event

After entering into next page you can retrieve first page information in second page or any where

like

DataTable dt=(DataTable)Session["frstdata"];
//you can use this table data 



您可以尝试这种方式.如果用户未保存该数据,则在用户会话超时后将其清除

我希望你能理解我说的话

最好的



You can try this way .If user didn''t save that data its just cleared after user''s session timeouts

I hope you understood What I said

All the Best




.net中有一个名为创建用户向导"的控件,该控件默认情况下会显示您在问题中提到的所有功能.基本上,此控件用于用户注册表单和所有控件,但您可以根据以下说明利用其属性您的要求.

您可以访问以下链接,以获取有关此控件的更多详细信息

http://www.4guysfromrolla.com/articles/050609-1.aspx [ ^ ]


我想这会帮到你.


祝您编码愉快!
Hi,

There is a control in .net called "create user wizard" in that control all those features you mentioned in your question are present there by default.Basically this controls is used for user registration forms and all, but you can exploit its properties according to your requirements.

You can visit the below link on more details about this control

http://www.4guysfromrolla.com/articles/050609-1.aspx[^]


I think this will help you out.


Happy coding!!!


Muralikrishna8811
可以通过将其保留在会话变量中,然后将其作为会话变量返回来实现.
但是我觉得这是开销,因为我不仅要网格而且要保留一些其他控件.如果找不到其他选择,我将执行此操作.

sujit0761,
我找不到创建用户向导,
但是我找到了一个名为向导"的控件,提示是找到创建用户向导.


这正是我所需要的.
谢谢.
Hi Muralikrishna8811
it can be done by keeping it in session variable and then returning it back as a session variable.
But i feel this as a overhead as i not only grid but also some other controls which i want to keep. I will do this if i am not able to find any other option.

sujit0761,
i couldn''t find the create user wizard,
but i have found a control called "wizard" with the hint of finding create user wizard.


This is exactly what i need.
Thanks.


这篇关于如何从一个aspx页保留到另一个然后返回的gridview或datagrid的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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