After hosting files, problems accessing folders/global.asax.cs file session variables / external classes PLEASE HELP
I've developed an online booking system through visual studio, but now that i am uploading the files to the web, i'm encountering the following problems.I'm trying to access an "Access" Database which i have uploaded in a folder called "Databases" which is a directory above my domain name folder.However, when i try to do so , accessing it with the following line of code.OleDbConnection dbconn= new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" HttpContext.Current.Server.MapPath ("../Databases/DatabaseName_DB.mdb"));i get the following error..........Cannot use a l...access session variables in .asmx file
Is it possible to access the session variables in .asmx file from any web form? please help me regarding this. Its urgent in my application
Thanks in advance
If you're asking whether the .asmx file in a webservice can access the session variables of another web application that is consuming the service, the answer is no, they are separate sessions. Anything your service needs from the consumer application should be passed explicitly.
If you're wondering whether you can use sessions just within the webservice...how .NET components access Session variables?
hi, i am trying to create a .NET component. its task is to access the Session variable of the page calling it, and return the value as strings. basically i just don't want to pass in the username and all other customed infomation as parameters when i am constructing the component. is it possible to do it?
// this code is not working because it complains Page is null.
public class BranchUIClass
private string m_user;
public BranchUIClass ()
m_user ...Unable to access Session variables in Ajax Methods.
I am using AJAX dll. I declared a Session variable(like Session["EmpCode"]="1234" ) in page load() .Now i want to access the session["EmpCode"] from an Ajax method.
But it is giving error "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>"
...Access Session Variable in VB.Net Component
Can I access the asp.net session variable (e.g. session("loginId")) in the vb.net componet in case of 3-tier scenario, where I am using one function from the component and I need to access this loginid there.
onlinedev:Can I access the asp.net session variable (e.g. session("loginId")) in the vb.net componet in case of 3-tier scenario, where I am using one function from the component and I need to access this loginid there.
Yes you can.
You need to reference the System.Web assembly in the class library, then you go System....Controlling Folder/File access with session variables
ASP.NET 2.0 --
Is there a way to control access to a folder based on a session variable?
For example, Cold Fusion offers a file called application.cfm. This file is read first each time a request is made for any file within a folder that it resides in. If this application.cfm file resides in "/', then it will be read for every file requested in "/" as well, including subfolders.
This way you could have more than 1 application.cfm files. So you could place one in the "/admin" folder let's say, and inside the application.cfm file, code would check a session variable, and redirect out ...Want to access session variable using ajax
Hi all I want to access the current session variable using ajax functionality.Can any one tell me how to go about?
you can use the Page methods from ajax extensions ,
The following example shows how to call static page methods from the client script to write and read session-state values.
live demo :
Demo code :
http://asp.net/ajax/documentation/live/ViewSample.aspx?sref=Sys.Net.PageMethod%23PageMethod....Posting filepath in file upload control in .NET to the next page and uploading the file from second page
In our application (using C# .NET) there is a form with file upload options. After filling up the form details, the summary of the details need to be shown in the next page before committing the information into the database. Right now, Server.Control is used to transfer the contents to the next page and the form details are retrieved using Request.Form["control id"]. But this is not working for File upload control alone.File upload can not be done in the first page itself, as the foreign key in File upload table gets updated only in second page after confirmation. Therefore, is th...Alter variables in .swf file (C# .NET Flash)
Hello everyone!Im building a simple webform that enables users to load a flashbanner (.swf) and change the contents (eg. text, url, img) in .net. Preferrebly in c#.Conclusion:1. Load a flashbanner (.swf).2. Get the variables (names and values) from the file.3. Alter their values.4. Save it to a new file (or the same, doesnt matter).Why i want to do this is because if I have a banner that i want to send to 10 different places, i dont want to have to make 10 different flashfiles just for changing a bit of text.Is this possible in .net? I've been looking at programs like Aspose Flash and ot...Accessing Session Object in Code file vb.net
Hi,How do I access Session Object in code file (class1.vb) not code behind file. This will help me alot in coding my application but it says "Session" object not declared. I cannot access response or request objects too. Any help will be appreciated...plzzzzzThank youcarol
You will need to access the current HttpContext, and reference the Session object from there. You can do that by using:
System.Web.HttpContext.Current.Session...How to access Session variable in global.asax.vb file?
I am having problems accessing a session variable called 'AutoLogin' in Authenticate_Request methid in Global.asax.vb file, which I set when user logs in by clicking on 'Login' button. Can someone tell me how to access session variables in global.asax.vb file? I have tried Session("AutoLogin") and HttpContext.Current.Session("AutoLogin"), but both cause exceptions. sun21170
The Session variable is not yet attached to a request during Authenticate_Request, so you will not be able to use this Property.bill...How to Debug Response.Redirect losing session variable, when upload file
HELP! I have a page where users can enter text and optionally upload an image. To upload the image, the page contains an image file upload usercontrol I created. The control displays the image after loading and stores the image information to the database and creates an image ID. Then the user can submit the entire page which just saves the user's text and the image ID to the database.
In addition, I create a user account for the user and store their new id in a session variable ("LoginID").
When saved, the page does a response.redirect to the next data input page. Excluding the first pag...Problem using Session variables with Ajax.NET 2.0
I keep receiving the following popup error (below) whenever I attempt to define a session variable inside a Ajax controlled Button.Click method. Any ideas..? Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.Details: Error parsing near ‘ ...Using Session Variables inside a VB.Net Class File
I am developing an asp.net web site, using VB.Net as the core language, and have create a class file to store some global methods I use on a number of pages.
When I try to implement a session variable inside a class in this manner:
Public Class SessionVars
Public Sub initializeVars()
If Session("UserID") Is Nothing Then
Session("UserID") = "SomeDefaultSetting"
I get an error "Session not declared". Suggesting that the class file sees this is a variable....