User Data Getting Crosses Between Users Accessing Objects
Jan 4, 2010
I've got a website and we just had a huge jump in traffic. Now all of the sudden we're getting sql parameter errors left and right. We switched to a new sql server a few weeks ago and everything has been fine but the added traffic seems to be breaking us.
I have a data access class that is called when each user trys to logon. It runs through several tasks before finally updating the users last login date and forwarding them to the administration section.
What I'm seeing from the trace logs suggests that when I'm logging in the first several tasks are using my data (lets say user=birk pass=word). But at some point the accessor class starts sending over the data from someone else who's trying to login (lets say user=abcxyz)
Every connection we make to the server is closed when we're finished with it. I'm nulling out all of the accessor objects when I'm finished with them. But somehow different user data from different sessions are making their way into other peoples instances of the object.
I'm not using session/application/cache/viewstate to store the objects so I'm not really seeing how they could edit eachother... Its just really weird and I'm not sure how to even go about researching the problem.
This is roughly the accessor class... I trimmed out some of the parts that weren't reliant to the issue
[Code]....
View 3 Replies
Similar Messages:
Jun 21, 2010
firstly a static class only ever exists once and is not an instance. Any static members (ie static int NoOfPeople;) is stored in one place and is shared between all sessions (like the old global variables).
Now static methods is where i'm not 100% sure. If I have a static method that doesn't use any other static members could this cause inconstant results, example (this is a fairly pointless method but just a quick example of the top of my head)
[Code]....
So in this example if two sessions (or threads) were to call this at the same time - would they both get back the expected results, because the method only uses private data (a, b and totalToReturn).Im sure this sounds a little simple but I will be using static methods to build user objects and various other objects that there will have to be a 100% garentee that the objects will not get mixed up between sessions and the wrong things return to the user.
View 5 Replies
Jul 12, 2010
We have a few scenarios which mean users can see other users data if they're on the same machine.
Scenario 1
Login User A Browse to forms with perosnal data Logout User A Login User B Either hit back button until you reach User A's personal data or.. Use browser history to jump directly to user A's personal data.
Scenario 2
Login User A Browse to forms with personal data Close browser New Browser, Use history to go directly to User A's data.
The 2nd one was caused by the browser displaying the page from its cache, so for that one, I added the following to the web.config..
[Code]....
[Code]....
which seems to do the trick, but I need to know how to fix the first part and whether the web.config changes are all that's needed to clear any cache.
View 6 Replies
Sep 7, 2010
In ASP.NET I have a form that has a Textbox named txtOutput and a button. In the main file.aspx.vb I can call a function from the button handler and in that function I can have
txtOutput.Text = "Some Message"
with no problem. I have a bunch of functions in several other classes. For instance I have a class named AbleCommerce that does some database functions. These functions are called from my main class. In those functions, however, I have no visibility of txtOutput. All of my classes are, unfortunately, in the default namespace which I understand is not optimal but didn't seem to impact this issue.
I know this is an easy one I've just not understood properly but it has me stumped. My gut says that I probably need to pass the Textbox object to my "other class" but can't for the life of me figure how.
View 2 Replies
Mar 22, 2011
I have a single master page in my application. It has a Label control for displaying Error Messages. I want to be able to access this Label control from any child page or Class module within the application. How do I reference this label from a Class module. I simply wish to use a Try Catch construct in the Class Module and reference the MP Label in the Catch segment.
View 13 Replies
Jan 25, 2011
I'm trying to add Div Objects to an array and trying to access them later when I call my loadViews function. All of my alerts fire, in the proper order, but the array m_Divs is always of length 0.
I'm re-registering the script each time on Page_Load, due to it throwing an "Error: Object expected" after each page_load when trying to call the javascript if I don't.
.JS file.
[Code]....
View 3 Replies
Jun 6, 2010
I have a gridview control that displays expenses claims received from clients. I have a template field that contains a checkbox - if this is ticked, a value from the gridview is added to a variable and this is outputted to a label control.
What I then want to do is to update the database according to which row has been ticked. I have so far the following code that adds each value to an array, which I was then hoping to access in the sql query i.e. Update table set value = value where id = (id's added to array)..
Code as follows - so far I'm just displaying the count of values in the array to make sure they are actually being added:
[Code]....
View 8 Replies
Feb 24, 2010
I'm working on a project in which we have a database, data layer (entity framework), business layer and web/UI layer.I want to use ASP.NET Dynamic Data for the web layer, but don't want it to access the data layer or database, as I want it to be purely running off business logic, and not directly accessing the data.However, it appears that Dynamic Data only allows Linq-to-SQL or entity framework data sources to be used.Has anyone used it with business-layer objects instead?
View 1 Replies
Nov 17, 2010
have some Objects, lets say Employee and Role defined as below and I have defined relationships in my database that gives me a list of objects say employees and thanks to my framework each employee object also has a Role object linked via the RoleIDID, UserName, Password, Email, RoleIDRoleID, RoleNameSo in code I can do something like this
Employee emp = dataService_GetEmployeeByID(1);
string RoleName = emp.Role.RoleName;
Now here is my problemI can bind any object in a repeater and it works fine for the first level in my relationship
For instance <%# Eval("UserName") %>
But I need to be able to show the details for my child objects as well (Role) so something like this (which does not work)
<%# Eval("Role.RoleName") %>
View 2 Replies
Apr 6, 2010
I know how to bind a simple objects to a dropdown list. However I am having problems binding my objects which contains sub objects to the control.i.e. with simple object i just do ddl.DataValueField = "myproperty"
with my objects they contains sub objects which i want to bind. I have tried ddl.DataValueField = "sub-object.myproperty" which doesnt work.
View 2 Replies
Jul 12, 2010
I have a web site with an administrative section. All administrative pages are stored in a directory called "db/administration". There is only one user that I want to have access to the pages in this directory. That user's username is "system". Currently, I am using the following approach in my web.config file:
[Code]....
When I logged in as another user, I was still able to access pages under db/administration when I navigated to them through the browser's address bar. What am I doing wrong?
View 2 Replies
Jul 23, 2012
How to Protect Web services from Un authenticated users.. right now Im Using Protected Access specifiers.. Is it Correct method To Protect Web services?
View 1 Replies
Sep 14, 2010
I have designed a navigation structure that is customisable from within my application and linked to the users role.
So I can restrict what menu items a user gets based on their role.
I have managed to do this quite well using SQL Tables and an ASP.Net Menu.
I can get it to only show the menuitems that are marked active and I have created an Stored procedure to get the menu items for a particular role.
Where I am struggling is getting the Logged On Users Roleid to pass it to the Stored Procedure.
I can get it using a regular aspx page but my menu is on my masterpage and I do not want to have to code it in each and every page.
I even tried to do it with a user-control but same happens. It seems that the User class is just not available when in a masterpage.
how I can pass the roleid from a Class or something or from the page to the masterpage?
View 2 Replies
Jun 1, 2010
I need to do an insert into a database table (SQL Server). I want to compute value of 1 column based on the existing data and then do an insert. How do I prevent another user from getting access to the database in the middle of this process?
View 2 Replies
Dec 14, 2010
i am still relatively new to web development and have been encountering some issues when multiple users click a button at the same time.
i was wondering what could be causing this as i have already removed all static variables realiseing that was a mistake and replaced them with viewstates were needed then sessions when moving across pages
View 7 Replies
Jul 21, 2010
I have an ASP.Net 4.0 web application which very frequently loads data from the database and does heavy calculations on it. I want to cache this loaded and prepared data in a central cache that can be accessed by every user and computer who uses the application.
Simple use-case:
User 1 accesses webpage, cache is empty, data is loaded/calculated, data is cached
User 2 accesses webpage, cache contains data, data loaded from cache
User 3 accesses webpage, cache contains data, data loaded from cache
User 1 reloads webpage, cache contains data, data loaded from cache
Cache expires
User 3 refreshes webpage, cache is empty, data is loaded/calculated, data is cached
I know that ASP.Net has a built-in cache mechanism. What I don't know is whether it can be shared between different users accessing the site on different computer at the same time. I would also like to know how the system behaves in a web farm environment.
View 3 Replies
Jun 2, 2012
i have create web application for school management system...bt when i run my webside...(my welcome page is defaul.aspx bt if i want to acces studentdetail.aspx then i only enter url and i get studentdetail.aspx)
View 1 Replies
Jan 8, 2011
On our website users can sign up. The sign up controls (converted to a template) has the usual text boxes and then the create user button. When pressing this button the account is created. After reloading the website, the user can see his credentials in his 'my account' tab. Question: How can we access the newly created user (especially his userid) right after the create user button was clicked? Right now this does not work, we can only start accessing this after the page has been reloaded. But surely the account is created the instant the button was pressed. I have tried this:
MembershipUser myObject = Membership.GetUser();
UserID = (System.Guid)(myObject.ProviderUserKey);
But it looks as if the user is not yet logged in at this stage. Can this somehow be forced so that we can access the newly created userid right after the user has clicked the create user button?
View 2 Replies
Jan 28, 2010
which classes/objects store details about the user of a page: things like IP number etc.
View 2 Replies
Apr 1, 2010
I use asp:Login control, user can login properly, but while checking user Profile information within LoggedIn event of Login control, all of the fields in the Profile objects are empty. Also, User.Identity.IsAuthenticated always returns false. But, all of these issue solved while navigating to another page. Why User.Identity.IsAuthenticated returns false, even user logged-in properly? And, is there any way to get user's profile information within LoggedIn event of Login control?
View 2 Replies
Dec 1, 2010
I'm working on a school project where my website idea of choice is one that creates mixtapes (well, you'd download them or burn them from the site, but I need not implement that). The site allows its users to create 6 song mixtapes that are then published into a transaction table.
That part I am fine with. Making the selection page is tough. The way I have it set up is that there are 6 columns with 3 drop downs. First the user picks the genre, then the artist WITHIN the genre, and the song from the artist (GENRE > ARTIST > SONG). So, I would need the ARTIST drop-down list to populate once a SelectIndexChanged occured on GENRE. Same with SONG, but it would use ARTIST instead of genre.
Repeat that 5 more times and click a button, and it would create a table and post it to the database.
I have thought up of 2 ways to go about it.
1) Create a session that expires once the user clicks the "create" button. This would be sluggish, as there would be about 12 page refreshes, and 12 session variables I'd need to store.
2) AJAX/jQuery. This way would be awesome, but I have no idea how in the world to write jQuery in such a manner that on an event it calls a method from a code-behind file.
One thing I found out before my brain went to mush (I've been working on this for 6 hours now), is that one way people have done this is to call a non-related .aspx file that serves as a method. The idea is ok, but how do I go about getting it to update objects on the page the user is currently on? I'd believe there is a simpler way to do this, and am looking to you guys for some guidance on how to dynamically update dropdownlists.
View 2 Replies
Sep 10, 2010
I've got a web site that has a master page and that master page (mpMaster that has a user control ucControl1) which has a sub user control (ucControl2), this user control has a property which accepts a value. Now, I have a page that uses the master page
and on this page I have another user control (ucPageControl), I need to find a way of setting the value in ucControl2 from ucPageControl. Is this possible at all?
View 5 Replies
Mar 31, 2010
Surprised that i havent been able to find this myself, but anyway. Let's say i use my web user control like this:
<myprefix:mytag userid="4" runat="server">Some fancy text</myprefix:mytag>
How would i be able to access the text inside the tags from its codebehind ("Some fancy text")? Was expecting it to be exposed through this.Text, this.Value or something similar.
EDIT:
I even get the following warning on the page where i try to user it:
Content is not allowed between the opening and closing tags for element 'mytag'.
EDIT2:
public partial class mytag: UserControl
{
public int ItemID { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
}
}
View 1 Replies
Mar 24, 2011
To get the current logged in user at the system I use this code:
string opl = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
I work on an ASP.net app where I need this info. So I've put my app on a server and tried the code above and I get "Network Service" in the string opl. I need to know the current user of the PC who accesses my ASP.net app.
View 2 Replies
Jul 4, 2010
I created a user control in Asp.Net which I populate with <asp:Table id = "...." /> this table has columns that contain dropdownlists, textfields and other web controls. In the code behind I am not able to access these web controls, is there a way I can access them. or I shouldn't be doing that in the code behind of the user control? here is my ascx code markup:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MarriageControl.ascx.cs" %>
<%@ Register assembly="BasicFrame.WebControls.BasicDatePicker" namespace="BasicFrame.WebControls" tagprefix="BDP" %>
<asp:TextBox ID = test runat = "server" />
<asp:Table ID = "marriageInfoTable" runat = "server" Caption="معلومات الزواج"
CellPadding="2" CellSpacing="2" Width="979px" Height="164px">
<asp:TableRow runat="server">
<asp:TableHeaderCell runat = "server" Text = " " />
<asp:TableHeaderCell runat = "server" ID = "husbandHeader" Text = "الزوج" HorizontalAlign = "Right" />
<asp:TableHeaderCell runat = "server" ID = "wifeHeader" Text = "الزوجة" HorizontalAlign = "Right" />
</asp:TableRow>
<asp:TableRow runat="server">
<asp:TableCell runat = "server" Text ="الاسم الرباعي" />
<asp:TableCell runat = "server">
<asp:TextBox runat ="server" ID = "fullNameHusbandTextBox" Height = "30px" Width = "250px" Font-Bold = "true" Font-Size = "20px"/>
</asp:TableCell>
<asp:TableCell runat = "server">
<asp:TextBox runat ="server" ID = "fullNameWifeTextBox" Height = "30px" Width = "250px" Font-Bold = "true" Font-Size = "20px"/>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow runat="server">
<asp:TableCell ID="dateOfBirthCell" runat = "server" Text ="تاريخ الميلاد" />......
View 3 Replies