关于一个用户可以看到网格分页或刷新页面上的另一个用途的细节 [英] Regarding one user can see details of another use on grid paging or refresh pages

查看:34
本文介绍了关于一个用户可以看到网格分页或刷新页面上的另一个用途的细节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的会员,



我使用的是asp.net应用程序C#。在一个应用程序中,我使用DATATABLE来绑定网格。为了处理分页,我避免使用VIEWSTATE存储DATATABLE。为此我创建了一个公共类,在该类中我定义了public static DataTable dt_GetMenus = new DataTable()并在整个应用程序中正确使用。



我已经为数据库操作创建了服务,它在我们的应用程序中充当了数据库层。



我在IIS中创建了两个不同的数据库SAMPLE1和SAMPLE2,其中包含不同的数据和托管站点。我有两个用于SAMPLE1的USER1和SAMPLE2的USER2。



问题:

而USER1使用SAMPLE1数据库登录应用程序,使用SAMPLE2登录USER2(使用登录页面动态发送数据库名称。)然后在刷新或分页后,第一个用户自动查找同一页面的USER2详细信息。



Dear Members,

I am using asp.net application C#. In an application i have use "DATATABLE" for binding grid. I have avoid "VIEWSTATE" for stored "DATATABLE" for handling pagination. For that purpose i create a "Public Class", into that class i define "public static DataTable dt_GetMenus = new DataTable()" and use in entire application properly.

I have create services for database manipulation which is act as database layer in our application.

I have create two different databases "SAMPLE1" AND "SAMPLE2" with different data and hosted site in IIS. I have two uses "USER1" for "SAMPLE1" and "USER2" for "SAMPLE2".

Issue :
while "USER1" login to application with "SAMPLE1" database and "USER2" with "SAMPLE2" (send database name dynamically by using login page.) then after refresh or paging first user automatically find details of USER2 for same page.

Exa: 

We have grid view
For USER1 details

ON FISRT PAGE
 Country Name | Status           | Default Country 
 -------------------------------------------------
 India        |   Activated      |   Yes  
 US           |   Activated      |   No 
 ABC1         |   Activated      |   No 
 ABC2         |   Activated      |   No
 ABC3         |   Activated      |   No

ON SECOND PAGE
 Country Name | Status           | Default Country 
 --------------------------------------------------
 ABC4         |     Activated    |   No 
 ABC5         |     Activated    |   No 
 ABC6         |     Activated    |   No 
 ABC7         |     Activated    |   No
 ABC8         |     Activated    |   No

For USER2 details

 N FISRT PAGE
 Country Name | Status           | Default Country 
 -------------------------------------------------
 XYZ1         |   Activated      |   Yes  
 XYZ2         |   Activated      |   No 
 XYZ3         |   Activated      |   No 
 XYZ4         |   Activated      |   No





刷新或分页后,USER1会自动在其页面上看到用户2的详细信息,如果两者都使用不同数据库浏览相同页面,则反之亦然。



两个用户的会话ID不同,因为会话变量没有变化我已经检查了会话。



我无法找到相同的解决方案。请指导我或提供任何解决方案。



谢谢



Chetan Chopkar



After refresh or paging USER1 automatically see details of user 2 on his page if both using browsing same page for different database vice versa.

Session id for the both user are different because session variable does not changes i have checked for the session.

I am not able to find out solution for the same. Please guide me or provide any solution for the same.

Thanks

Chetan Chopkar

推荐答案





public static DataTable dt_GetMenus = new DataTable(),这就是你用来拉动网格视图的数据并存储它,以便您可以处理分页等,?



如果是这样,那么就会出现问题,因为静态变量。当第一个USER1登录时,您正在选择记录SAMPLE1并将它们存储在静态变量中。

当USER2登录时,您再次查询SAMPLE2并将数据存储在数据表的同一静态实例中。如果两个用户同时使用正在浏览相同的页面然后页面将显示登录的用户的数据。



我宁愿建议使用其他一些技术来实现相同的结果静态实例。



希望有所帮助,
Hi,

public static DataTable dt_GetMenus = new DataTable() , is this what you are using to pull the data for the grid view and store it so that you can handle the paging etc,?

If so, then there is the issue, because of the static variable. When first USER1 logs in you are selecting records "SAMPLE1 and storing them in static variable.
When USER2 logs in you are again querying SAMPLE2 and storing the data in same static instance of data table. If both users are browsing the same page then the page will show the data of the user who logged in second.

I would rather suggest use some other techniques to achieve the same result instead of static instance.

Hope that helps,


这篇关于关于一个用户可以看到网格分页或刷新页面上的另一个用途的细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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