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...
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
I am trying to use this query in a form view "Select * from actions where emp_id = " & session("emp_id") for the select command. This is the format I am used to in classic asp. How can I acheive the same results in asp.net.
I have a page with 2 dropdown menus and 2 datagrids.
The datagrids get populated by a database based on a dropdown menu slection.
This page links to another page which in turn links back to the original. If the user leaves the first page and then returns back I want to keep the dropdown menus and datagrids populated.
I tried doing this with session variables but can't get the datagrids to stay populated ...
I have dropdown and I have to bind that dropdown on the basis of user login so that when the page load the drop down should show only one item on the basis of user login and i may have use that dropdown item as a search parameter.I have a objectdatasource named TblFltReg having one of the fields named "Owner" which is the SectionId.
There is a table named TblSections having "SectionId" and "Description".User can be selected in a Session variable.I have another table "Users" having "UserName", "UProfile", "SectionId".Actually I dont know how can I get SectionId from Users table into Session variable.So I have two tasks: one to get SectionId into Session Variable and another is to show dropdown item on the basis of User login.Hope you understand. How can I perform that task?
Nested GridView Control returns "Object variable or With block variable not set" when outer GridView returns rows.
The Nested GridView Control works as long as the outer GridView returns rows, the following code works: [Code]....
Object variable or With block variable not set.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object variable or With block variable not set.
Source Error:
Line 118: If e.Row.RowType = DataControlRowType.DataRow Then Line 119: Dim myStatus_ID As SqlDataSource = CType(e.Row.FindControl("sqlDeviceStatusAssign"), SqlDataSource) Line 120: If Not e.Row.DataItem("Status_ID") Is Nothing Then Line 121: myStatus_ID.SelectParameters(0).DefaultValue = e.Row.DataItem("Status_ID") Line 122: End If
I have tried checking for IsDbNull and checking to see if a label exists in a given row. This code *If Not e.Row.DataItem("Status_ID") Is Nothing Then* appears to do nothing.Same with the following:
*Dim localLblItemReference As Label = CType(e.Row.FindControl("lblItemReference"), Label)
To further clarify my question above, I am looking for a method to detect e.Row.DataItem("Status_ID") is nothing/null due to the outer GridView returning 0 results in a query.I have a (Outer) GridView Control with another GridView Control inside of a template field with it's associated SqlDataSource control.
In the "Protected Sub GridViewReport_RowCreated", I provide the Select Parameter for the associated SqlDataSource with the DataItem row value.When the (Outer) GridView Control does not return any rows, the "e.Row.DataItem("Status_ID")" throws a:
Exception Details: System.NullReferenceException: Object variable or With block variable not set.
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.
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?
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.
I'm attempting to create a mailto in a gridView as follows:Code Behind (Page_Load)
[Code]....
ASPX Page
[Code]....
The hyperlink field will not grab the mailString variable. It's blank whether I use my constructed string or just the basic "TEST" string. What am I doing wrong?
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?
Its related to datatable in gridview store in session and then session retrive and store to database. basically i am using gridview here creating new row for button click and these row adding untill user's last entry then submit all these entry to database. so i want to use session variable to store this data temporarily and after final entry user click on submit button and all data shold be save in db.
I believe my SQL statement is sound. UPDATE [062610] SET abc = @abc FROM [062610] WHERE (dayID = @dayID) I cant seem to get my stupid variable @abc to sync with my GridView update command. I understand that I can let the GridView take care of my editting for me without having to write any code. But, I am running multiple tables and will be eventually needing to do this manually. Or at least as far as I know.
On Page1 of a project, I have a Gridview showing a table of customer names (showing CustID, CustName, CustJoinDate). When I click on a record, I have passed a querystring to Page2 showing an address table for that customer. This part works for me.
The SQL statement in simply: Select * from CustAddress where CustID = @cust
What I would like to do though, is capture that @cust to a session variable so that I can use it later on.
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.
Then in the rowDataBound event i add the total to the gridview footer:
[code]....
I would like to know how i can set the gridview display=false if the begBal variable above =0?
also I set the format of amount columns in the html and code as {0:n2}. How could i add a check box to show no decimal places {0:n0} in the grid (columns and footer)?