Multiplie 2 Session Items?
Oct 9, 2010I have made a small shopping cart, and i need to multiplie the Amounts of the various items with the price. And display the overall price.
View 2 RepliesI have made a small shopping cart, and i need to multiplie the Amounts of the various items with the price. And display the overall price.
View 2 RepliesI'm trying to make a management panel for my controller "Products". People should be able to visit http://something.com/products and see a complete list of the products and be able to order etc.. The administrator should be able to log into a management panel where he can edit the product list (edit/add/delete), now is my question how can I render the management page for Products and still be able to visit the regular product list that customers see?
View 3 Replieshow to display all the items in session in a repeater
View 1 RepliesI need functionality that will allow to discard objects from session if they are not used in specified amount of time. It is simmilar to Cache timeout functionality.
Is there any session provider (possibly free) or pattern that achieves that?
I do not have much experience with asp:menus. How would I be able to make visible or invisible certian pages depending on a factor that I get from a session varaible? I plan on doing this on the backend in VB.net.
View 3 Repliesi've been coding an asp.net site using VS2005 for about one month.
my site uses both application cache and session cache to save data.
the syntax i use for application cache is :
HttpApplicationState appState = Application;
appState["someKey"] = "somevalue";
and for session cache i use :
HttpContext.Current.Session["someKey"] = "Somevalue";
my site is deployed on three standalone servers - each server runs a diffrent instance of the site.
two of the servers work just fine, the third has a stange problem - and also has the least free memory space.
in this server items start dissapearing from both the session and application cache - note that i set no expiration date to the cache items.
does anyone know why this could happen?
seems to me there is perhaps some memory limit for cached items setting that i am missing.
In my online shop, users can search products,each product have a link called add to shopping cart, users can add to the list many products like anonymous user, the question is.How can i do,for not to lose the product list, when user make Log in or create one account in my site
View 1 RepliesI have a multiview inside an updatepanel. in one of the views, I save a value in a session object like this:
Session["xyz"] = "some string value";
Then I switch to another view and try to pick it up the value in a button's OnClick event:
string x = Session["xyz"].ToString();
But I get a null reference error. Debugging it shows that Session["xyz"] is indeed null, yet other Session variables are still there. Is there something special about Session and AJAX?
I have a dropdown menu with too many items bounded by sqldatasource.
I want to show only those records which matches the Session("UserName) so that if user login to the webpage he may be able to see only those records that are related to him and further if he selects it then data should populate to gridview.
I have a listview control, in it each item will have a checklist eg - Pass / Fail which will then have a label displaying the selected value. I also have datapager wired up to the listview.
When i toggle between the datapages and toggle back, any result previously submitted will be wiped.
I am thinking i should be using session state to temporarily store then info, and then once the session is finished use a submit button to send all values and ids into an xml.
1. Is this the right way of approaching the situation?
2. How would i specify session state for listview items, eg would i angle it through a itemdatabound event or the application itself?
below is the code I have but I want to change the ddl.Deal(dropdownlist) to cbl.Deal(checkboxlist).. How can I loop throught each items if checked. and if all items are checked. to filter my data and show in gridview..
protected void btn_Click(object sender, EventArgs e)
{
myAPI.myWeb myAPI = new myAPI.myWeb();
myAPI.SearchParameters sSearchParameters = new myAPI.SearchParameters();
[Code].....
I have a few tables, Listings, ListingImages and a few others related to Listings. ListingImages is related to Listings so that you can have many ListingImages per Listing.
When I query this table I do;
[code].....
Now this is fine. However, I now want to sort the ListingImages independently within each Listing (by an ImageOrder column I have in that table).
How can I do this and pass all my Includes(...). Would it be bad form to sort the ListingImages within the View as this solution seems to work?
I am using Microsoft Visual Studio 2008 Professional Edition on Windows Vista Home Basic SP2 and when I am editing Visual Basic and want to add an item to the toolbox I click on Choose Items... and from that point I can't find important controls (items) like Windows Media Player or Adobe PDF Viewer. I have tried to reinstall and reset the toolbox and program. I can't find this problem anywhere in the web
View 10 RepliesI have 4 Checkboxlists, if i check 1st item of checkboxlist1 -- > populate items in checkboxlist2 if i check 2nd item in checkboxlist1 -- >populate items in checkboxlist2 with last selection as well as 1st checkboxlist items. So I need to Append items in Checkboxlist with existing items and also with previously selected Checkox. Is it any way except DataTable ?
View 2 Replies[Code]......
It always displays ONLY 10 items although there are 30 items in the datatable. If i use GridView ALL the 30 items are displayed just fine.
So I have a ListView (assignmentsListView) in an UpdatePanel, being filtered by a DropDownList in the same UpdatePanel. The DropDownList has a list of persons in it and uses autopostback, and the ListView shows the tasks those persons are assigned to.
I am trying to use code similar to this:
[code]....
When I first load the page, the DropDownList shows the first person in the list, and the ListView correctly shows that persons tasks.
If I then select a person who I know has zero tasks, I get an error at the RegisterPostBackControl() method, saying the passed-in control cannot be null.
When debugging, at the RegisterPostBackControl method, it shows that the ListView Items collection has >0 elements in it (the number of elements matches the person selected before the current person).
I added the following code to global.asax to load up several session variable when a session starts. I'm assuming that when a page goes to use the variable that I should be
1) checking at the page level that the value is valid not 0 when its not expected to be 0, not a zero-length string when its expected to have a length
2) have code at the page level that sets the values if the values have not been set as when the Session timeout, ideally putting the code in a class derived from Page and then deriving all of my pages from the new class so that the code does not have to be repeated in every page
[Code]....
I have a problem by getting session which created for new site visit or session expired.
View 3 RepliesI want the code for showing popup dialog box , to show the time remaining for session closing because of in-activity. and 2 buttons for allowing to stay or to signout.
i want all the settings that are need to achieve the functionality.
I have a class called EditMapUtilities. Here are some class properties that I want to persist:
public class EditMapUtlities
{
public static Boolean isInitialEditMapPageLoad
{
get { return SessionHandler.isInitialEditMapPageLoad; }
set { SessionHandler.isInitialEditMapPageLoad = value; }
}
// REST OF CLASS NOT GERMAIN TO DISCUSSION AND OMITTED
}
Here is my SessionHandler Class following the pattern from this post Static Session Class and Multiple Users:
using System.Web.SessionState;
public static class SessionHandler
{
private static HttpSessionState currentSession
{
get
{
if (HttpContext.Current.Session == null)
throw new Exception("Session is not available in the current context.");
else
return HttpContext.Current.Session;
}
}
//A boolean type session variable
private static string _isInitialEditMapPageLoad = "EditMapInitialPageLoad";
public static bool isInitialEditMapPageLoad
{
get
{
if (currentSession[_isInitialEditMapPageLoad] == null)
return true;
else
return (Boolean)currentSession[_isInitialEditMapPageLoad];
}
set
{
currentSession[_isInitialEditMapPageLoad] = value;
}
}
}
I am still learning OOAD. I want to keep relevant properties with relevant classes. I also want to keep all Session stored variables in one place for ease of maintenance and to encapsulate the session keys and calls. I feel like my design is too coupled though. How can I make it more loosely coupled? Is my editMapUtilities class too tightly coupled to the SessionHandler class? How would you do it better?
Let suppose, I am building an asp.net website which has login scenario in it. I want to provide a certain functionality to the website that if the user is already login on computer 1 and now try to login on computer 2, so he will be allowed to remain login on computer 2, while automatically logout him from computer 1. I also know that http is a stateless medium, so whenever user interact with computer 1 and try to interact with the page, it will get noticed at that time.
View 2 RepliesIs there room for issue in the following code in terms of multiple users of the same web application? I mean, I know that a purely static string will be shared across all sessions for a single ASP.NET application, but since this explicitly refers to the Current.Session, even though it is static it seems like it would always refer to the session instance of the "current user." But an error is happening that could be explained by everyone sharing the current value of Mode and thus the most recent change overwriting everyone else's mode value. (As a background: This string is in a Helpers class that is used throughout the application. I do not want to make references to Session["Mode"] throughout the application and do not want to have to pass Session["Mode"] in every method call from an aspx.cs page.)
public static string Mode
{
get
{
var value = HttpContext.Current.Session["Mode"];
return (value ?? string.Empty).ToString();
}
set
{
HttpContext.Current.Session["Mode"] = value;
}
}
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...
I have some code in my page load event where I just want to fire once when the user opens the Browser. The only issue is if you open a new tab with the same website the session variable does not reset. Is there a way to reset the session variable when you open a new tab or do you have to take the whole web browser down for it to clear the session variable.
In Global Page:
[code]....
i have two web aplications running on different sites.
1. site gets user information and show another website (2. site) in an i frame. but when i do this 2. site session starts again on every page.postback . if i connect to 2. site without 1. site everything works well.