I'm trying to set session variables in one page, and retrieve them in my code file in the page that it posts to.
I keep getting this error. I put the correct namespaces in, and enabledSessionState = true to my application files, but no luck.
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration.
I'm just calling a session variable, and I get that error
e.g,
Public AUID As Integer = Convert.ToInt16(Session("AUID"))
Im having problems passing a variable from my c# code behind into my asp as part of a connection string. how do i go about passing in a variable from my code behind into my asp.
I have a question, I am writing a user tracking class that needs to obtain the screen resolution of the user. I have the javascript all written and it is working along with a hidden variable ( used to set the javascript vars so I can access them server side ). What I am running into is when I try to access the value of the hidden variable on Page load it's not there, but If I cause a post back I can get it. How can I access this data on page load? There is no guarantee that the user will ever cause a postback, some users just look at the home page and leave.
I've got a vs08 web site project that was recently added to tfs2010. now when i look at the code behind on a user control, a form object is not found in the code behind.
[code]....
Error:
The name 'txtbxSearchWorkOrder' does not exist in the current context
why this is not working on this page? I've got other pages with textboxes and no issues.
I have a Master Page which controls the styling of my site. In the Code Behind, there are a few class instances instantiated as well as variables. These classes validate user access and then create user objects
I have a few Web Content Forms which carries out instructions based on the user objects. So far it seems that on each Web Content Form I have to create new instances of the classes found on the Master Page. This is doubling my work for every Web Content Form.
Is there anyway I can inhereit Classes and objects instantiated in the Master Page Code Behind?
I'm doing a tutorial for error logging. It seems to be pretty basic. Everything works the way it should but I get an error I did not expect in my error log. The error says file not found for favicon.ico. From what I've read this is a file for the icon that would appear in the address bar, to the left of the url. I don't understand why I'm getting this error. I have no code that does this or references this file. It happens when I run the app in chrome and in firefox. Does the browser automatically look for this file to display to the left of the url? Is it automatically looking for this file as part of it's normal routine when loading a page?
I come from a VB environment. I'm looking at 2 different file extensions. If one doesn't exist look at the next. I was hoping to use the try/catch function. I can get it to find the first extension but not the second. Here is my the try/catch part of code:
The error dialog that pops up shows Connection Error in the title and a yellow exclamation point with File Not Found! I thought the FileNotFoundException would work(?).
i hosted asp.net application in iis 7.. i can browse everything fine.. But while browsing in between i getting 404 error (file not found) even though the file
I have a webpage in which I declared a variable in my code-behind as:
Code : Private ok As New HiddenField
I have a javascript function that sets this variable to either "T" or "F". However, I have a server-side button control that in the click() event, it checks the "ok" variable like this:
Code: If ok.Value = "T" Then FormatFields() End If
The javascript function initializes the "ok" variable to "T". It goes thru a series of field edits. When a field doesn't pass the edit, it sets the "ok" variable to "F". Either way, this variable has a value. When the code-behind event above checks the "ok" variable, it's value is "".
if i browse for a text file and displays it in the text box and trying to save it as the name provided above i am getting the error as Directory Not Found Exception.
I have a problem with my chart image not refreshing and I narrowed it down to the fact that there's an unrelated image that according to MS VS2005 IDE, that the image file is not found... BUT..when I run/debug it... it displays properly.The image is right in the root of the aspx directory so it is not in any folder.<img src="right-thumb.png"> // this works but ide shows error and causes chart to have update problemi get an error in the IDE file is not found. however, if I display a FULL PATH, the problem goes away. WHY? i don't want to display the whole path because i don't want public users to see the server file location.
<img src="c:webapplication ight-thumb.png"> // this works for everything
I've an ASP.NET application running fine locally, I've published the site and copied all files up to the live server and all is not good.99% of the pages are doing just as they should be, but just two pages are complaining that they can't find the code behind file? This is kind of urgent (demo tomorrow), so any help appreciated. Error message below...
Parser Error Message: The file '/CompanyRoot/_ReactiveTaskManagement/ReactiveTaskPage/ReactiveTaskEdit.aspx.cs' does not exist.
I have this code in javascript: var x = e.mapX; It gets the X-coordinate of a map. What I want to do is that I want to store this into a c# variable. I have a class named Test with an integer property X. I want to store var x into X. In the codebehind, I have this on the Page_Load: Test test = new Test(); Then I am trying this on the javascript code: var x = e.mapX;
I use asp.net (webforms flavour) for the server coding. Let's say that I stored a variable called "test" inside the Session object.Is there a way to grab its content inside the javascript js file (I use Jquery). Currently, I use the following workaround - in my aspx.cs file I populate a hidden field, then in Jquery I grab the contents of that field.What is the proper way to do that?I tried to expose the session through a web method and using $ajax function to get the value on the Jquery side, but I am getting security error - "permission denied" - no additional explanation offered.My workaround works fine, but to me it seems rather clunky. What are the common ways to achieve session access in Jquery?
I uploaded http://www.mymrt.net/trigASP3/cos.aspx and the file cant be found. I have an asp.net website in VS2008.In the app_code folder I have class files.It all works fine no problem on my PC so there is no issue on my PC.I uploaded the whole website to my host and I get a file not found due to the code behind using a class fileI take away the class file refernce from the code behind and it works.
I recently upgraded my development machine to Windows 7 and have been having a bit of trouble setting up my web services locally in IIS 7.5.
The following error keeps occuring:
parse error message: type 'ClassNameHere' cannot be created.
Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/ACCOUNT/AccountService.cs" %>
My compiled app_code.dll is sitting in the /bin directory at the root of my virtual directory and in IIS 5.0 and IIS 6.0 I never experienced any problem like this. To me it seems as if the code from my dlls isnt being loaded or recognized for some reason.
While working through some demos today I managed to trick VS 2008 somehow and I cannot access any server side events or variables in the code editor window. Hopefully
this screenshot will demonstrate exactly what I am missing. No matter what control I pick from my source I get the same drop down items overhead. What is quite weird is that when I drop new server side controls onto the source editor I can set the tag attributes for the events, but when I double click that event there is not an automatic created event handler with the same name created for me. Also, on the property pages there is no events image button (the one with the lightning bolt). The only property page items which have the events image button (lightning bolt) are the ajax toolkit controls. Already tried the "import all settings - VB Default" to blast away everything and no luck..
I would like to put a value in web.config file in my project and read it programatically from .aspx page.Under which section of web.config file should I save the value. This is not a connectionstring. It is path of a file. And I how can programmatically read the value in the code?I am using C#.
I'm working on a custom menu system in asp.net that populates a horizontal menu on the fly based on which menu item is selected from the website's main menu.This 2nd menu is populated from a custom XML file in the website's root directory.(See http://loganyoung.wordpress.com/2010/06/03/asp-net-horizontal-submenu-from-xml/ for details).At the time I'd written that post, it did work, but my development environment has changed and now I'm getting an error saying that the XML file can't be found.