Gridview - Multiple Entries Through A Session Variable?
Nov 25, 2010
I'm creating a shopping basket in ASP.NET using session variables to pass the data from a shopping.aspx page to basket.aspx, currently I have the pages passing the primary key of the product with a gridview on the basket.aspx used to display the data from the database.However this only works for one item at a time, how can I extended the session variable so multiple products can be added, as well as quantities etc?
View 4 Replies
Similar Messages:
Aug 6, 2010
I have some data displayed in GridView and there are multiple (repeat) entires.
There are about 20 rows of the same data, but I only want to display 1 row.
I know can amend PageSize="1" but then it shows multiple pages which I also don't want.
The multiple rows - are all of the exact same data - but it should only appear once!
View 2 Replies
Mar 16, 2010
I'm having problems with retrieving multiple instances of a session variable from an InProc session state. In the following code I persist a simple BusinessObject into a session variable on the Page_Load event. On the click of a button I try to retrieve the object back into 2 new declared instances of the same BusinessObject. All works great until I change one of the properties in the first instance, it changes the second instance as well. Is this normal behaviour? I would have thought as these were new instances they wouldn't demonstrate static behaviour?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
' create a new instance of a business object and set a containg variable
Dim BO As New BusinessObject
BO.SomeVariable = "test"
' persist to inproc session
Session("BO") = BO
End If
End Sub
Protected Sub btnRetrieveSessionVariable_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRetrieveSessionVariable.Click
' retrieve the session variable to a new instance of BusinessObject
Dim BO1 As New BusinessObject
If Not Session("BO") Is Nothing Then BO1 = Session("BO")
' retrieve the session variable to a new instance of BusinessObject...............................
View 2 Replies
Jan 9, 2011
consider this scenario: a user on my website has a profileID. There are some pluginID's associated with this profileID.
E.g.: User1 might have 2, 3 and 5 plugins associated with his profile.
When the user logs in, I store the profileID of the user in a session variable cod. ON a certain page, the user tries to edit the plugins associated with his profile. So, on that page, I have to retrieve those pluginID's from the DB.
I have applied this code but this fetches only the maximum pluginID from the DB and not all the pluginID's.
[Code]....
I was trying to figure out how can I store multiple pluginID's in this session variable?
View 2 Replies
Mar 30, 2011
how to manage multiple sites on a session variable?
View 4 Replies
Oct 13, 2010
I have a web application using window authentication. There are a search page and a edit page in the application. In search page, user can enter some search criterias in the textboxes and the search result will be displayed in the gridview by clicking the "Search" button. User can select any row from the gridview and it will take him to the edit page. In the edit page, there is a "Back" button to take the user back to the search page. I use session variables to remember what the search criterias the user entered in the textboxes and what page number the user was in the gridview. So when the user goes back to the search page, the textboxes are pre-populated with the search criterias and the gridview is displayed in the correct page number.
The problem is: If user1 opened one browser window and did a search using search criterias1, then user1 opened a 2nd browser window and did a search using search criterias2. When the user1 went back to the search page from the edit page using the first browser window, all the textboxes and page numbers are from the 2nd browser window, instead of the 1st one. Can anyone explain this problem to me and how to prevent it? It will be helpful too if you can give me some links about the similar problem. I am thinking if the same user logged on two different machines and did the search on each machine, what is the result?
View 4 Replies
Jan 27, 2010
I would like to wrap Session variables in a manner similar to that discussed on CodeProject.
[code]....
Here is my question: if I have to access CurrentUser multiple times in the same page, would I get a performance improvement by assigning it to a local variable instead of accessing the wrapping property? Or does the HttpSessionState make sure the object is only deserialized once per request, so that subsequent calls in the same http request don't cost any more?
View 4 Replies
Aug 24, 2010
I want to store employee name,designation and department in session variable and retrieve in another page how to do this.
View 2 Replies
Nov 22, 2010
Currently in an .aspx file, I am storing a value (filename that was created in that session) in an hidden text box. When the user clicks on the "Print" labeled Hyperlink control, it opens the file that was stored in the hidden text box control. But when the user goes to different screen (in the same session), I loose the filename value that is stored in the hidden text box control. So I would like to store the filename variable in a session variable. So that if the user leaves this .aspx file and comes back to this .aspx file I can load the value into the hidden text box from the session variable.
View 11 Replies
Jul 7, 2010
I have a Company model and an Employee model and I want to create a Company and then create multiple employees for the company in one view.
How should I do this in the view?
And what should I do in the Create POST method to support this multi-entry view?
View 4 Replies
May 24, 2010
I am wondering how to handle and setup a means to submit multiple data entries via ASP.NET MVC.
Suppose I have a product database table such as: ProductId, ProductTitle, Price.
From the view, I was thinking to code the HTML form as:
<form ... >
<table>
<tr>
<th>ProductId</th>
<th>ProductTitle</th>.......
Suppose the form is to be submitted to Controller: Product, Action: Add. What sort of coding techniques can I use to handle this dynamic form, such that I follow good or best practice, and if possible also be elegant.
The solution I see so far is to test the Request.Form (or Formcollection) indexer/dictionary for existence for the dynamic input fields. E.g.
public ActionResult Add(Formcollection form)
{
int productEntry = 1;
string productPrefix = "Product";
while(true)
{........
View 1 Replies
Feb 26, 2010
how am I be able to validate multiple entries (textbox control). It seems that using custom validate is not possible because each validator has one control to validate. In my case, I have to determine if at least one entry was filled with data.
View 4 Replies
Mar 17, 2011
I need to get the value from a field in a GridView and and set that to a Session variable, however, it does not seem to be working...
Here is what I have:[Code]....
I am getting System.NullReferenceException: Object reference not set to an instance of an object.
View 6 Replies
Dec 5, 2010
I have a collection of objects that are display in google maps. This map is refresh (using Javascript, a call to the server using WebServices) every minute.
I need to display some of the information of these objects in a gridview control.
When I get the collection I store them in a session variable.
Can i use this variable (session) to bind to my gridview? I would like to avoid to go twice to the server, one to get the collection for display the map and other to get the collection for the gridview.
View 4 Replies
Mar 24, 2010
An option to add a range of computers based on tag numbers, for instance, user input 800101 and 800110 would add computers SYS800101, SYS800102, SYS800103, SYS 800104, SYS800105, SYS800106, SYS800107, SYS800108, SYS800109, and SYS800110. Currently the app adds a single computer at a time.
Here I am using ASP.NET using C# and my backend in active directory.
View 12 Replies
Oct 18, 2010
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?
[Code]....
Behind code VB:
[Code]....
[Code]....
[Code]....
View 4 Replies
Apr 27, 2016
With reference to the following link: [URL]
I have a column on Page1 gridview which holds Edit and Delete button.My question is how can i remove or hide theĀ Edit and Delete button column on Page2 gridview so that the buttons are not visible?NB: The Gridview is tied to a session which was from page1. So on Page2 the buttons should not be seen...
View 1 Replies
Jan 12, 2010
I am creating a web service that returns the list of states. How do I create an object in C# in the web service that will return multiple values (of properties of an object). Currently, the way I am doing it, it only returns the last value pulled from the database. Do I need store an array of properties?
[code]....
View 5 Replies
Dec 9, 2010
can we grab a global variable or Session or View State variable in the javascript or using jquery?
View 2 Replies
May 17, 2010
I have a web application which uses a session variable to store the logged in userid. If no user is logged in, of course this variable will be empty and the contents displayed on my website are meant for guests. If there is a user logged in, the user specific controls/access/links will then be a displayed.
I am now having issues with my hosting where on shared application pool, the worker recycle is triggered every 90 minutes, this will clear sessions causing all my users to be logged out. I opted for a dedicated application pool, which got worse because I am only allocated 50MB memory limit and if this is reached, the worker recycle is triggered and I lose my sessions again. I have tried as much as possible optimization techniques, e.g. dispose where possible, close connections, disable viewstate for static controls etc but my memory per instance keeps building up from page to page without any signs of improvement. I don't use loops nor store huge objects like bitmaps etc but my sessions are now gone even faster than 90 minutes in shared application pool before.
I have considered using SQL Session State but there isn't a simple guide on using this with MySQL. I am getting desperate and considering using a public variable, a string as a replacement to store logged in user id instead of in a session variable. I am pretty sure this will solve my issue with sessions being recycled but are there any negative consequences of doing this? One problem I can think of is if the user closes the browser, the system will never know that the user is now logged out and this public variable should be nothing. In this scenario, will the GC eventually clear this abandoned public variable.
View 10 Replies
Aug 1, 2010
I am trying to get the drop down list to only include table1 entries where table3.int1 is the current selection in another drop down list (table2.id). Example:
Table1: id, string1, int
Table2: id, string1, string2, dec
Table3: id, int1 (ref table2.id), int2 (ref table1.id)
Both drop down lists are inside of a FormView object for a asp.net page. My current select command(s) are having the DropDownList for Table1 display all Table3 entries, instead of just the ones Tied to Table2 id from the other DropDownList.
View 8 Replies
Nov 6, 2013
i have a gridview with link button and one field called "ID" i have five values....when i click the link button that row value ill show in next page in textboxes ,txtid, txtage, txtsalary,......... if i click that link button that "Id" values should pass to next page using "SESSION" variable in C#.net
View 1 Replies
Apr 8, 2010
I'm using Visual Studio 2008 with SQL Server Express databases in my .net 3.5 website
I have three tables I'd like to make entries to when the user completes a wizrd i've setup on a web form.
The First Step - The user enters basic information about their "Case". The table looks like so:
db_Cases - CaseId PK auto int, CustomerId, etc fields
The Second Step - The user enters information about the "Debtors" that are related to this "Case". Think of this as being products....The only difference is these records wont be used over and over again like a product would. The user may need to enter data about several "Debtors", just like if you needed to show several different products on an invoice. For example the user may need to enter information about a husband and wife. This means two entries in the "Debtors" table. The table looks like so:
db_Debtors - DebtorId PK auto int, etc fields
The Third Step - Here's my problem. This step needs to make entries into a third table called "CaseDetails". Again, this is just like if you were creating an invoice with several different products on it, where you would want to get a subtotal of each product's cost. The table looks like so:
db_CaseDetails - CaseDeatailId PK auto int, CaseId int, DebtorId, int
* When this table is later viewed, It will reflect all "Debtors" attached to the specific "Case" being viewed.
The first two steps aren't a problem, I pretty well have that handled in the wizard. BUT How do I create the entries in the "CaseDetails" table when the user finishes?
My idea right now is..... Considering the "Debtors" will be re-used but only on rare occations, I'm thinking I should just add the "CaseId" that was created in step one, to the "Debtors" table at the same time the "Debtor" is created. So the table would look like so.
db_Debtors - DebtorId PK auto int, CaseId int, Name, Address, etc
View 1 Replies
Dec 2, 2010
What would be the proper syntax in ASP.NEt 3.5 C# to assign a TextBox value to a temporary or session variable to be manipulated (added, subtracted, multiplied, divided) at different points in the application? I want to add a decimal number to this variable in almost every instance as well.
View 3 Replies
May 25, 2010
I have the dataset. in this i am having total 20 tables with huge amount of data..I want use this data over all the page..so where i can keep this data..
before i used viewstate but the viewstate data is render to page every postback ..so this time the page size is increasing(interanlly viewstate is rendered to page)..so performence wise it was very slow..
Now i change my logic insted of viewstate to i used Globel Dataset on Page Level.. now the performence wise better than viewstate..
i used Like shared dsControls as Dataset at top of the page..so every time i use this dataset..
my quesation is session is better or Globel variable is better way use in my situavation..
View 3 Replies