I want to show all the activities of the logged in user in a gridview. I am using VS 2010. please suggest some good ways of doing it.
View Complete Post
Hi to all,
I have some things that I want to know. I am right now using a free asp.net webhosting ("somee.com"). The problem is that when I am visiting a page, there's a tendency that values stored in my session variables are lost. Therefore, it causes an error when the requested page is loaded.
1. I am thinking of using sessionState mode="SqlServer". Will it solve my problem?
Actualy Im working on it but Im having problems when connecting to the sql database.
2. Is that a problem in the webhost?
3. Do free webhosting sites provide allow session state in the sql server?. Because ive tried it locally into my computer and error say's i should intall the ASP.NET Session State SQL Server version 2.0 or above.
I come from corporate asp.net development, and I am now working on a public website which will get a lot of traffic, perhaps a million users a day. So I am faced with a ton of performance and scalability questions.
I would like to share some thoughts and see if my approaches resonate with any good practices, or perhaps I am heading down the wrong path... Either way, I want to hear opinions.
(My number one concern is the fact that I am using asp.net for a public website. I don't know of a lot of websites using asp.net)
I am using asp.net 2.0 (I know, its not the latest technology but I don't need any advanced features of asp.net 3.5 or 4, unless there are significant improvements geared towards what I am doing)
On launch date, this will be running on a dedicated Windows Server 2008 running on Intel ATOM 330 1MB L2 Cache 1.6Ghz Dual-Core with 2GB DDR RAM. Its fully managed by a full service hosting company which gives me an option to upgrade to a bigger server within a few hours. I can even move the site to a webfarm if the traffic demands it.
So I have a User Dashboard, where users can create albums and upload pictures. So what I am doing
Am trying to store a generic list in Session to act as a simple shopping cart. Am getting a weird casting error when I try and retrieve it from Session.
A critical error has occurred.[A]System.Collections.Generic.List`1[MyCartItem] cannot be cast to [B]System.Collections.Generic.List`1[MyCartItem].Type A originates from 'mscorlib, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\WINDOWS\assembly\GAC_32\mscorlib\184.108.40.206__b77a5c561934e089\mscorlib.dll'.Type B originates from 'mscorlib, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\WINDOWS\assembly\GAC_32\mscorlib\18.104.22.168__b77a5c561934e089\mscorlib.dll'.
I have a class variable defined:
In the Load event I have:
_cart = (Session["MyCart"] != null) ? (List<MyCartItem>)Session["MyCart"] : new List<MyCartItem>();
I have the following in my code (Login.aspx page)
I am using vb.net (Visual Studio 2008 with framework 3.5). I have a server that exposes several services requiring sessions. I am using wsHttpBinding for all. One of my requirements is to allow non-dot net third parties to access these services. When a
client connects to a service and then some time later the server goes away, the state of the connection is still reporting "open".
Currently I have implemented a "ping" function on the server. My client calls this function every 5 to 10 seconds and if the server does shutdown, I get alerted with an exception error. This works, but I was wondering if there is a way where I don't
have to call my ping function?
I don't want to use a dual connection binding and I was hoping to use the connection state variable? But, I don't know how to get it to update by itself. The client user application could just wait until it goes to invoke a service method, but I was wondering
if there was another way.
Thanks in advance!!
My ASP.NET web application is hosted in multiple servers with a Network Load balancer Hardware. I am facing issues in session management during the site navigation. Frequently the session values are lost and application errors out with session not found. Currently the Site is configured with the Session mode as Inproc.
I would like to know:
1. Whether changing the Session mode to State server will solve the session management issue. 2. If changing the session mode then what would be the best configuration for the state server.3. Is there any other configuration settings that needs to be done in the State server as well as in the application
Hi I have a strange problem in a website that runs in a server to which I am connected through VPN...
I use some session variables to get the job done(shopping cart, etc) but it is not stable..manytimes I get no items in session object and other times(refreshing the page) I get missing data...I downloaded the entire site code to my local pc and debugged it and run it succesfully without any session data missing...When I run it in the server, I get bad session again: no products in shopping cart or products with missing quantities...
The same website runs smoothly in our production server too....The problem is with our development server...
Any help would be greatly appreciated..
Thanks in advance,
I'm trying to make a dropdown list with data available based on the users login name. Heres what I have as my SQL Query in the SQLDataSource:
SELECT Client_Name, Client_ID FROM Client WHERE (Client_Name LIKE '%@Client_Name%')
So say if the login username is "User1" but the database client name is "User1 Steel" I want the dropdownlist to pull "User1 Steel" as the display and Client_ID as the value from the dropdown list.
I dont know how to use the session data!
I am experimenting with an asp.net application wherein I do the following things (simplified for the purpose of this discussion):
1. Take user's gmail username/password (don't fret, I am not doing any nasty stuff ).
2. Create TcpClient object and connect it to the Gmail's POP email server using the provided username/password.
3. I am going to use this TcpClient object to download mails for the user.
Following is the problem I face:
1. Say I have presented the user with the subject lines of all his emails.
2. Now he clicks one subject line to download the message. (This will create the post-back to the aspx page)
3. When I receive the post back, will I be able to re-use the same TcpClient object which I connected to the POP server, if I store that object as a Session variable?
I doubt the streams associated with the object will not remain valid.
Is this even the right method to achieve what I am trying to achieve?
i studied like state server retrieve the session if the web server restarts.
here my doubt is application will not work while webserver restarts.then what is the use of retrieve the session after restrart the webserver?
I have a gridview and a checkbox. I am able to pass the checkbox id to a textbox in the same page. This is then passed as a session variable. However, when I place an option to page and select the checkbox items in the next page, the session variable resets.
Please see below code, how do I store "all checkbox" throughout all paging and store it in the session page?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BorderStyle="Solid" CellPadding="4" DataKeyNames="Categoryid"
BorderColor="Silver" BorderWidth="1px" Width="300px"
I have the need to play a wav file continously until a condition occurs. Within our application I am creating an instance of system.media.soundplayer, setting the path a wav file, and calling PlayLooping. I wrote and tested the code
locally (VS 2010, 3.5 framework, C#) on my windows 7 machine and it worked fine but when I deployed it to a Windows Server 2003 machine and logged in via an RDP connection the sound only plays once and then stops.
I did some searching and only found one instance where someone else had this issue. Is this a known issue?
Is it possible to store gridview session data after each postback. I have a gridview and a checkbox within. Each time a user clicks the checkbox, I like to store the gridview ID in a session. After browsing through various pages, I like this session data to continuously store the information up to 20mins?
How can I continously store the session variable. Please can someone provide a sample? Say a text box and if I enter 1 click on a hyperlink (where session variable is stored) return back to the page, enter 2 click hyperlink then I should get in the session 12?
Any one know how to do this? Please provide code in VB.