asp.net-session

Invalid Arguments error in Global.asax in mvc

泄露秘密 提交于 2020-01-17 03:36:13
问题 I`m trying to follow the tutorial Securing Asp.net but when i try to put this line GlobalConfiguration.Configuration.Filters.Add(new System.Web.Http.AuthorizeAttribute()); it gives me a following error The best overloaded method match for 'System.Web.Http.Filters.HttpFilterCollection.Add(System.Web.Http.Filters.IFilters)' has some invalid agruments below is my Global.asax code using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using

Classic ASP to ASP.Net one-off session data copy

Deadly 提交于 2020-01-13 16:28:46
问题 We have an extensive classic ASP site, and we're looking to upgrade to ASP .Net (most probably the latest version). Obviously upgrading all the pages at once would be a leviathan task, so we're only looking to write new pages (and page rewrites) in ASP .Net at first. There are two obstacles to doing so: I have no idea how to access classic ASP session data in ASP .Net. This would only have to be set up once, as it is never modified by any page other than the login page. I'd prefer to have to

ASP.NET MVC 3 - Dealing with Session variables

百般思念 提交于 2020-01-02 03:16:09
问题 I have an app which uses Form's Authentication and when the user log's in, I retrieve the user's actual name and assign that to a session variable, like so: [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { if (Membership.ValidateUser(model.UserName, model.Password)) { Session["Name"] = client.GetName(model.UserName); FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); return RedirectToAction("Index", "Home"); } } } This is

Windows Azure Cache Preview

…衆ロ難τιáo~ 提交于 2019-12-22 08:08:06
问题 I'm having some trouble using Windows Azure Cache Preview. I've add the Nuget Package here: http://nuget.org/packages/Microsoft.WindowsAzure.Caching and have configured my role for storing the ASP.NET sessions state as per the info on windowsazure.com Problem is, I get No connection could be made because the target machine actively refused it 127.255.0.0:20004 when debugging. The dev IP used by Azure is 12.7.0.0.1:81 I'm not sure why, even the sample Windows Azure Caching (Preview) Session

Set / update expiration on aspxauth and asp.net_sessionid cookies

若如初见. 提交于 2019-12-21 22:17:25
问题 I am wondering if there is a way you can setup your .NET application to set and update the expiration time of the aspxauth and asp.net_sessionid cookies in the browser? From what I see, the cookies' expiration dates are something like 1/1/0001 telling the browser to keep them until the browser closes (I've observed this using Chrome). I'd like to set an explicit time, but, I will need to update that time on every request. I am attempting to do this with some code like : var timeoutMins =

How maintain session beetween two Url in asp. Net

风流意气都作罢 提交于 2019-12-13 17:22:21
问题 I have two URl's . If I open first url it will allow us authentication. Second URL will open web content as XML data. I need to read that data... But when I excute first URL its working fine Authentication is SUCCESS, But immediately I try to open second URL its saying Authentication failed . How to maintain session from first URL to second URL... My Code : string url1 = "http://172.xx.xx.xx:xxxx/cms?login&username=santhu&password=welcom0e"; string url = "http://172.xx.xx.xx:xxxx//cms?status

DataServiceRequestException with TableStorageSessionStateProvider

耗尽温柔 提交于 2019-12-13 05:47:19
问题 I'm trying to use the TableStorageSessionStateProvider from the Azure training kit. I can use the example without problems but when I use it in my web app, I get this exception: System.Data.Services.Client.DataServiceRequestException occurred Message=An error occurred while processing this request. Source=Microsoft.WindowsAzure.StorageClient StackTrace: at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result() at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait() at

Does ASP .NET Session reset after login?

怎甘沉沦 提交于 2019-12-11 05:40:00
问题 EDIT This problem seems to have strangely disappeared. There must've been something funky with my environment. I'm voting to close this question. When a user logs in, I inflate the session with a bunch of data from the Login page code-behind. Then I redirect the user to a different page in the application. I also have some session recovery logic which re-inflates the session based on the auth ticket when the user's session expires. What seems to be happening is that I inflate the user's

Storing values in asp.net session using jquery

非 Y 不嫁゛ 提交于 2019-12-10 23:54:12
问题 How to store values in the session using jquery. I am using the following code var Link = '<%=Session["Link"]%>'; to get data from session. How to do the reverse process. Problem: I need this in my master page. so i cant use .ajax{}. Geetha 回答1: You will probably need to set up an HTTP handler or something similar that will accept requests and store things in the Session. Visual studio has this somewhere in the "Add" menus in the solution view. (If you're using ASP.NET MVC, you just set up

Windows Azure Cache Preview

爷,独闯天下 提交于 2019-12-05 12:37:55
I'm having some trouble using Windows Azure Cache Preview. I've add the Nuget Package here: http://nuget.org/packages/Microsoft.WindowsAzure.Caching and have configured my role for storing the ASP.NET sessions state as per the info on windowsazure.com Problem is, I get No connection could be made because the target machine actively refused it 127.255.0.0:20004 when debugging. The dev IP used by Azure is 12.7.0.0.1:81 I'm not sure why, even the sample Windows Azure Caching (Preview) Session State and Output Caching Sample does the exact same thing. Update: error from log: w3wp.exe Error: 0 :