一个页面中的多个表单或具有会话状态变量的3个不同页面? [英] Multiple forms in one page or 3 different pages with session state variables?

查看:83
本文介绍了一个页面中的多个表单或具有会话状态变量的3个不同页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将一个classis ASP Web应用程序转换为Asp.net



应用程序相对简单,它是一个3页的网页应用。



Page 1:将信息输入文本框(时间,日期,名称,名称,名称,yadda yadda yadda),一些单选按钮,一些复选框选项等。



第2页:鉴于第一页上的选择(如果单击了复选框1,则显示与复选框1相关的类别等)和第一页中的信息输入,所有这一切都显示在这里,在第2页,以及新的单选按钮和复选框,更多文本框等,可能总共100左右。



第3页:一切都汇总然后输入数据库



我的问题如下:



我去过致力于将旧的asp应用程序转换为.net



无论如何,我得到了复选框,单选按钮的会话变量(使用复选框列表和radiobuttonlists,因为这些可以是很容易保存到会话变量中的arraylist),文本框信息等等等。



突然,我的同伴告诉我最好将所有信息转储到包含多个表单的ONE PAGE中,每次隐藏两个表单...一次只显示一个表单...行为像一个单独的页面(每个表单模拟一个页面)..就这样,我们不会处理会话变量!



我没有想到这一点,但有些东西告诉我这不是正确的方法......此外,将所有东西都倾倒到一个页面上会有很多代码!!!!



谁是正确的或者什么是正确的方法呢?



谢谢!

I'm currently in the process of transforming a classis ASP web application to Asp.net

THe application is relatively simple, it is a 3-page web application.

Page 1: enter info into textboxes (time, date, name, name, name, yadda yadda yadda), some radio buttons, some checkbox choices, etc.

Page 2: Given the choices made on page one (if Checkbox 1 was clicked, then display categories pertaining to checkbox 1, etc.) and the info input in page one, all of this is displayed here, on page 2, along with new radio buttons and checkboxes, more textboxes, etc. perhaps 100 total or so.

Page 3: Everything is summarized and then entered into a DB

My question is the following:

I have been working on transforming everything from the old asp application to .net

Anyway, I got the session variables for the checkboxes, radio buttons (using checkboxlists and radiobuttonlists as these can be easily saved into an arraylist in a session variable), textboxes info, etc, etc, etc.

Suddenly, my peer tells me it is best to dump all the info into ONE PAGE with multiple forms, two of each forms hidden at a time... only one form displayed at once... behavnig like an individual page (each form simulating a page)... that way, we would not deal with session variables!

I had not thought of that, but something tells me that is not the correct approach... besides, dumping everything into one page would be A LOT OF CODE!!!!

Who is correct or what would be the right approach for this?

Thank you!

推荐答案

我喜欢Multiview控件。没有要显示和隐藏的复杂代码,使用按钮事件来设置活动视图。状态保存在View State的页面上。技术上只是一个表单,但只有活动视图被发送到浏览器,因此它的功能很像多个页面。 Theres'没有管理会话变量本身,所有对象都可用于服务器端。唯一的缺点是任何客户端Javascript的控件ID,并使用FindControl来定位控件。
I LOVE the Multiview control for this. No complex code to show and hide, use button events to set the active view. State is held on the page in View State. Technically just one form, but only the active view is sent to the browser so it functions much like multiple pages. Theres' no management of session variables per se, all objects are available server side. The only down sides are control IDs for any client Javascript and using FindControl to locate the controls.


这篇关于一个页面中的多个表单或具有会话状态变量的3个不同页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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