.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Losing the value

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :ASP.Net

Theres is a variable in my program but I always lose the value . I want to stay with this values to use . How i could do this ?

Partial Class pages_dossie_relatorio
    Inherits System.Web.UI.Page

    Dim tam As Integer = 10



View Complete Post

More Related Resource Links

Transactions: Build Scalable Systems That Handle Failure Without Losing Data


Systems that handle failure without losing data are elusive. Learn how to achieve systems that are both scalable and robust.

Udi Dahan

MSDN Magazine July 2008

Request.PathInfo losing Master Page content and CSS link


Hi All-


I'm using Request.PathInfo to response.redirect as user to a different page ( based on the content after .aspx ).  It redirect just fine however, once redirected, the page loses all content from the master page and the CSS link.  I've searched and can't find an answer. 

Does anyone have a solution for this?

Losing responses from the device- UdpClient

Hi all,    In my application i am using UdpClient class for communication between the PC and the device. There are 3 tabs, on click of each tab a WindowsFormsControlLibrary (a dll) is opened an on click of any button in these tabs a request to the device is sent via udp socket and the device sends the response for the corresponding request. On receiving any response from the device the respective slot is called by the use of events and delegates.  A thread is created to notify the respective slots in the different tabs  when some response is received. For every 1 second the device sends a response to indicate that the device is active. These responses are displayed in the datagridview in one of the tab. The problem is some responses are lost and because of which the order of responses is not correct. The code is as shown below: </> public void dataReceived()                                 {                                                 IPEndPoint remoteIp

HTTPContext.Current.Session losing the variable sporatically

I have noticed a strange behaviour in my ASP.net 2.0 application. I have some logic in my aspx page that accesses some Session variables fine, then accesses some app_code and most of the time the HTTPContext.Current.Session returns the variable back fine.  However, I have noticed that sometimes this Session returns null, like it has lost it's "pointer" to the current HTTPContext. Is this a known bug, has anyone seen something like this before?   Any help would be appreciated, thanks, Mark. 

Problems with Farm Account magically losing permissions to certain things

I don't know what's going on, but this has now happened two times in a row during my rebuild from TP to Beta (completely new build from the OS up).  I'm using the same service account (domain account) as my setup and farm account.  While logged in with my farm account, I install the SP2010 pre-reqs, then the bits, then give it dbcreator and securityadmin roles in SQL, then run the SPT wizard.  Within the wizard, I specify the same account as my farm account, and all works fine and dandy.  After it's done, I'm able to get into Central Admin with this same account and see/do everything.After working with things a while and following the MS instructions for getting the User Profile SA working, if I reboot or logout/login, then I suddenly don't have access to some very important things, such as:- System Settings > Manage Services on Server.  It just disappears completely- Security > Configure Service Accounts.  This does not disappear, but clicking on it causes a prompt saying "Error:Access Denied."  Previously, I was able to go in here and set my service accounts for things like search, user code service, etc (I set them to the proper service accounts)- Configuration Wizards > Launch Configuration Wizard.  I used this multiple times when getting my farm setup, but now it's gone.I've gone so far as to make my farm account all of these things:- Member of B

CREATE GLOBAL CUBE statement - losing hierarchies due to slicing

Hi,   I have a SSAS cube from which I generate local cubes with the MDX statement below:   CREATE GLOBAL CUBE MyLocalCube   storage 'MyLocalCube.cub'   FROM [MyCube]  (          MEASURE [MyCube].[Measure1],          MEASURE [MyCube].[Measure2],           DIMENSION [MyCube].[Dimension1],          DIMENSION [MyCube].[Dimension2]          (             LEVEL [HLevel1],                     LEVEL [HLevel2],                     LEVEL [HLevel3],             MEMBER [Dimension2].[Hierarchy1].[HLevel2].&[MemberX]       ),         DIMENSION [MyCube].[Dimension3]  )   The problem is that this statement generates a local cube file which works fine but all other hierarchies defined in Dimension2 are not included. I cannot find the syntax for adding them manually. So, in other w

Losing Focus..

I have the code and  it is below. I have eliminated the errors and  it debugs fine. But it is not doing what I want it to. In fact it's doing nothing. Just want the textbox1 to increment when it loses focus. I believe I have all the hooks etc... So the big concern is when the Alt key is held down and then the print screen key is released (the up) it should increment  the textbox1 if  the focus is lost.   So maybe  if there might be someone out there who might give me some pointers and head me in the right direction I can final call this finished. I appreciate it. Thank You.    public partial class Form2 : Form     { private KeyboardProcedure keyboardProcedure;    public Form2()         { InitializeComponent();   this.KeyUp += new KeyEventHandler(Form2_KeyUp);           }  public void Form2_KeyUp(object sender, KeyEventArgs e)         {                    //If the Alt key was pressed and the PrintScreen key was the one released, bump the counter and update the                                 //textbox.             if (e.Alt && (e.KeyCode ==

Explorer view losing folder path information

Hi all, I am writing a custom webpart to replace SP's default ListWebPart in my document library view page. But I found it can't keep the folder information when showing the "Explorer View". For example, I enter a subfolder "root/folder 1" and select "Explorer View" in  ViewToolbar, it returns the root folders content. But when I click the "Open in Windows Explorer" in ActionMenu, it returns contents of folder 1. I see the Sharepoint's ListViewWebpart does not have this problem. It can return correct contents when I enter a sub folder and click "Explorer View". The page's url contains correnct query strings about folder path (in my own webpart the query string is missing). Is it because I forget some config for the toolbar since I add it via codes? Below is my code to add the toolbar:   SPView view = this.CurrentView; if (view == null) return null; this._toolbar = new ViewToolBar(); this._toolbar.ID = this.ID + "_ViewToolBar"; this._toolbar.RenderContext = SPContext.Current; if (!String.IsNullOrEmpty(view.ToolbarTemplateName)) { this._toolbar.TemplateName = view.ToolbarTemplateName; } return this._toolbar;   Thanks a lot.  

Windows 7, Office 2007, and WSS 3.0: Losing file path when saving to Document Library.

A client of ours recently purchased 5 desktops with Windows 7 and Office 2007.  They use Sharepoint to share all documents for their company. The computers that have Windows XP on them can browse the Sharepoint site, open documents (read only or edit), and chose to Save or Save As.  A new window pops open with their current file path of the Sharepoint Document Library so they can save the file in the same folder they opened it from.  I have tested this with Office 2003 and 2007 (Word and Excel) on XP and it always works. The 5 new desktops running Windows 7 cannot do this.  When a user opens a document by browsing to it from Internet Explorer and chooses to Save or Save As, they are kicked back to their last successful save point (usually My Documents or Desktop). The current work around is mapping a drive to the root Document Library directory and having them traverse through the folders to save it back in the original location. I've tried changing the Check Out save settings in Word 2007 and Excel 2007 to edit directly on the server, but I run into the same problem.  I've also made sure that IE sees the site as a Local Intranet site and Protected Mode is off. Any help would be appreciated.  Thanks in advance.

Losing Session after redirect.


Hello everyone.


I am having an issue with a piece of code. Everything else on the site works perfect except for this part.
Basically, there is a button on a page that says 'Download images', what this does is compress a list of files and then redirects the user to the .zip file.

EDIT: The problem I am having is as soon as the 'Download Images' button is clicked and they are prompted to download the file their session is lost. It does not matter if they download the file or not, as soon as the button is hit the file copy process takes at most 10 seconds and then the download box is shown.

Here is the code on the 'Download Images' button:


Dim bpoClass As New BpoClass


Response.Redirect("zipfiles/" & Request.QueryString("UniqueID") & ".zip")


Now, if I comment out the bpoclass.compresszipfile function, it works; the session is not lost. So it  might have something to do with the code inside the fu

User keeps losing Session on Anonymous site?


This code was working before, but something has changed and I don't know what.  I have an anonymous registration page.  On it, I have a CAPTCHA image, with a URL pointing to an ASPX page that is generating the image.  On the Registration page I am generating a 6 digit code to be displayed in the CAPTCHA image, then saving it to a Session variable.  On the CAPTCHA ASPX page, I am grabbing that Session variable and creating the image.  However, the Session is resetting when the CAPTCHA ASPX page is called.  If I debug it, it has a different ID and the variable is gone.

Why is this happening and how can I fix it?  I have Sessions enabled in SharePoint 2007.

SQLExpress 2008 R2 64bit using NewName results in logical filename losing last letter in Backup


We have a problem that is only occurring on the 64 bit edition of SQL 2008 R2 (the 32 bit R2, and 64 bit original are fine). 

As part of our install we restore a database called TaxMasterFresh’ and rename it to ‘TaxMaster’. We have a step to rename the logical files of the database to complete the operation:



Losing my mind, trying to publish a site with a .ashx handler


Happy Saturday everyone -


I am trying to work on a bit of a new idea to me, using .ashx files.  I understand that .ashx files need to be registered in the web.config, but I am not understanding how that works.

My .ashx file is 'album.ashx'.  My issue is that my site runs properly locally when I test it, I am just unable to publish it (locally or otherwise) - I receive the following error:

There is no build provider registered for the extension '.ashx'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.   


Inside of system.web I realize that I need to register this file, and using a template I found online this is what I have so far:




Calendar NOT losing focus WPF 4.0


I have a WPF 4.0 Calendar control (Selection Mode: MultipleRange) and a button in a grid.

After selecting dates in the calendar, when I click on the button, the calendar is not losing its focus.  i.e., It leads me to click twice on the button to fire the button_click event.

Is that a known bug? I binged my level best but not finding any answer. I will appreciate if someone could solve it.

Thank you.



Losing Data on GridView Control


VWD 2008 Express.  Visual Basic.

Please bear with me as I explain.  I have a page I use to update a student's personal and grade information.  I use a formview control to enter and update a students personal information.  I use a gridview control to enter and update the student's grades.  When the user wants to make edits to the data, they make the changes in the formview and the gridview, then press a "Save" button, which runs code behind that reads the formview and gridview data, builds two SQL UPDATE statements, then performs the update on two SQL tables (the Students table and the Grades table).  This seems to work fine in most cases.

I have had students reporting that at times segments of the student grades are lost when they make updates.  For instance, the student has 180 grades and grade dates recorded, thee user makes some updates on the end of the student's grade record, saves the changes, then goes back later and finds that a large contiguous block of previously entered grades and grade dates have been nulled out.  One user said this happened when they were on the student record and they hit the "back" arrow in the browser, then hit the forward arrow and saved the student record.  Can anyone think of a circumstance (like with a back arrow and fo

Why do I keep losing my changes (VS2005) ?

I'm a newbie to both Windows Forms development and SQL Server CE, so please bear with me...

I am developing a vocabulary builder application, and my data keeps reverting to the data set I originally imported. I keep losing the records I've added using the application I'm developing, or from within VS2005. I know about the 'Copy To Output Directory' option in the Solution properties and I set this to 'Do not copy'.

What gives? Not sure what other information you might need, but I suspect it's something really basic...

Need to save unique state for each PAGE (losing current filters)



Nutshell: App has the ability to show same page with different settings at the same time, and the session state is too broad for that. I need to have a set of states, one for each page. 

My web page can display a scorecard that allows user to view or change scores for one or more possible sports teams (I changed actual business requirements to keep problem simple). For example, Team 1 can have positive score for some aspects of a game and negative for other aspects of a game. This page can show one or more teams side by side for comparison. The ability to add teams to the view is called filtering. There can be more than one view in a browser's tabs or new windows.

Here are my problems:

1. If the user presses Browser Refresh, they lose all current filters unless I use Session or TempData. Using Form Post does not work here. 

2. However, solution 1 doesn't work for multiple pages where the user wants to bring up 2 different views of the same page (for example, page 1 has Teams 1 and 2, and Page 2 has Teams 3 and 4). They cannot do this using Session or TempData. This only works if I pass the current filters to the controller via a Post Form Data data or in the Url.

3. The use of a url won't work because the data that needs to pass to the controller sometimes exceeds 500 characters.

I have googled this to no

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend