在Web应用程序中存储信息 [英] Storing information in a web application

查看:79
本文介绍了在Web应用程序中存储信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要一些有关如何将信息存储在页面中以满足特定要求的指导.
该过程涉及以下步骤.

1)Web应用程序A具有默认页面,该页面包含两个框架a)下拉菜单框架(dd.aspx)b)表单框架(form.aspx)
2)default.aspx在页面加载时调用Web服务.
2)网络服务返回一些信息,例如公司名称,部门,每个部门的员工,每个员工的详细信息到Web应用程序A.

问题1:网络服务应采用哪种格式返回信息.数据集还是XML或JSON?
3)Web应用程序的default.aspx形式与dd.aspx中的下拉列表相关(框架1)
4)当用户从下拉列表中选择公司名称,相关部门,特定员工并单击确定
5)第二帧(form.aspx)获取信息并使用此信息动态生成表单.在这里,它使用一些javascript,这些javascript基于从选定的下拉列表中接收到的信息,并用于创建数据etnry表单.

问题2:网络服务是否应该发送现成的javascript? (对于每个发送的对象,这将是巨大的信息)或
Web应用程序是否应具有基于所选下拉列表生成javascript的代码?

问题3: default.aspx或dd.aspx应该如何存储信息?应该是会话变量还是viewstate?数据应采用数据集格式吗?如果要存储javascript,则在页面级存储大量信息时会导致性能问题.

问候
Vijay

Hi,

I need some guidance on how to store the information in a page for the specific requirement.
There are following steps involved in the process.

1) Web application A has deafult page hosting two frames a)frame for drop downs (dd.aspx) b) frame for forms (form.aspx)
2) default.aspx calls a webservice on page load.
2) webservice returns some information e.g. company name, departments, employees in each department, each employees details to Web application A.

Question 1: which format the webservice should return the information . Dataset or XML or JSON?
3) Web application''s default.aspx forms related drop down lists in dd.aspx (Frame 1)
4) When user selects company name, related dept, a specific employee from the drop down list and clicks ok
5) Second frame (form.aspx) gets the information and generates a form dynamically using this information. Here it uses some javascripts which are based on the information recieved from selected Dropdowns and used to create the data etnry form.

Question 2: Should web service be sending the ready made javascripts? (which will be huge information for each object sent) or
Should the webapplication has code to generate the javascript based on the selected drop down lists?

Question 3: How should the default.aspx or dd.aspx should store the information? Should it be session variable or viewstate? should the data be in dataset format? If the javascripts are to be stored then will it cause performance problem in storing the huge information at page level.

regards
Vijay

推荐答案

其中大多数是主观设计决定,具体取决于您的能力和其他要求.但是,我会给您一些初步印象.

Most of that are subjective design decisions that depend on your ability and other requirements. However, I''ll give you some initial impressions.

vjvjvjvj写道:
vjvjvjvj wrote:

Web服务应以哪种格式返回信息.

which format the webservice should return the information .



查看ASP.Net Web服务.基本上,您将创建类,并为您处理序列化.取决于您想对数据做些什么以及其他一些因素(例如数据类的数量),您可能会或可能不想走这条路.



Look into ASP.Net Web Services. You basically create classes and the serialization is handled for you. Depending what you want to do with the data and some other factors (e.g., amount of data classes), you may or may not want to go that route.

vjvjvjvj写道:
vjvjvjvj wrote:

Web服务应该发送现成的JavaScript吗?

Should web service be sending the ready made javascripts?



除非您需要这样做.



Not unless you need to do that.

vjvjvjvj写道:
vjvjvjvj wrote:

根据所选的下拉列表生成javascript?

generate the javascript based on the selected drop down lists?



看起来很理想.



That seems ideal.

vjvjvjvj写道:
vjvjvjvj wrote:

应该是会话变量还是视图状态?

Should it be session variable or viewstate?



如果您不需要每次都来回传递它,或者您最需要在服务器端传递它,则可以使用该会话来存储信息.这将导致流量减少.



If you don''t need to pass it back and forth each time or you mostly need it on the server side, then use the session to store the info. That will lead to less traffic.

vjvjvjvj写道:
vjvjvjvj wrote:

数据应采用数据集格式吗?

should the data be in dataset format?



使用似乎最自然使用的任何对象结构.



Use whatever object structure seems most natural to use.

vjvjvjvj写道:
vjvjvjvj wrote:

如果要存储javascript,那么在页面级存储大量信息时会导致性能问题.

If the javascripts are to be stored then will it cause performance problem in storing the huge information at page level.



如果JavaScript不太动态,则可以对其进行缓存. ASP.Net应该能够为您缓存一些JavaScript(请阅读前一句中的链接)...如果没有,那么您应该能够为具有URL参数(又称查询字符串)的网页生成JavaScript.要返回的JavaScript的ID.这样,该文件"(实际上是浏览器将视为文件的资源)就生成一次,然后缓存在客户端. ASP.Net实际上有时在后台执行此操作(我和一个朋友想知道ASP.Net页的所有JavaScript都在哪里,我们发现它是在运行时使用虚拟资源动态生成的.)



If the JavaScript isn''t too dynamic, you can cache it. ASP.Net should be able to cache some JavaScript for you (read the link in previous sentence)... if not, then you should be able to generate the JavaScript for a webpage that has a URL parameter (aka query string) that indicates the ID of the JavaScript to return. That way, that "file" (really a resource that the browser would see as a file) gets generated once then cached on the client side. ASP.Net actually does this sometimes in the background (me and a friend were wondering where all the JavaScript was for the ASP.Net page and we found it was generated dynamically at runtime using a virtual resource).


这篇关于在Web应用程序中存储信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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