I'm using the code from that topic's accepted answer ASP.NET MVC RememberMe
But, after log in I reopen the browser and I'm not logged in. Why ?
To make this answer-able:
Make sure the browser you're using isn't setup to delete cache/cookies/session information on close (or at least add an exemption for local testing). also, make sure you're not browsing in privacy/incognito mode as that will delete information on close as well.
For a short-term work-around, you can keep the browser window (at least one tab) open and let visual studio open a new tab with each compilation. That should keep session information between tab views (until you inevitably close the window).
Related
I edited and saved some content in controller file and trying to press F5 or Ctrl+F5 to refresh page, it didn't work. I still have the same page.
The current way to solve the problem is to shut down the server and restart it.
I also tried DevTools' disable cache function, but it didn't work either.
Are there other ways to update page after editting controller file in MVC?
Thank you for your help.
F5, crtl+F5 and “disable cache” ensure that the client cache is cleared, but your controller action is executed on server side.
To ensure that the server application is up to date, you need to rebuild your app and you need to ensure that your server uses the updated code.
If you are using IIS (Internet Information Services), you need to recycle the corresponding app pool. If everything is properly configured this should be done automatically, since IIS should monitor the deployed files. If that doesn't happen, you may check your FCNMode.
I have a SPA application using Durandal.
My program starts to have a http request periodically:
http://localhost:1551/f9750d8f8aa54265835e72d56d23144a/arterySignalR/poll?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAACM1YyjLngEiQsL54ET%2B%2FqwAAAAACAAAAAAADZgAAwAAAABAAAAAyZZfHz09psv64kIgPPwQNAAAAAASAAACgAAAAEAAAABMZImCidzdmb21ehxuGD4IoAAAAbazfW7CYR7y7HKb8JPt9ZH9b6fUDlZao60kBG662Vy%2Fb0IHwkwidthQAAAA1qSqnsCOheiNyXiINEyBPBAkqVg%3D%3D&messageId=d-79160814-B%2C0%7CC%2C4%7CD%2C0&requestUrl=http%3A%2F%2Flocalhost%3A2690%2F&browserName=Firefox&tid=5&_=1391326350868
I don't know where does it come from? As I remember I haven't added any reference to SignalR or something like.
How can I check what part of my code is generating this request? and then remove it maybe.
The technologies I'm using are:
Durandal
ASP.NET MVC 4.0
Knockout
ASP.NET WebApi
This is coming from the browser link feature in Visual Studio 2013 in the Standard toolbar. It is code that allows Visual Studio to interact with browsers running the code, and should only show up when running it in debug mode.
To disable it (until the fix to the issue is made live in an upcoming update), follow the directions in #4 of the msdn page to disable it:
Uncheck "Enable Browser Link" in the Browser Link menu item
Set appSetting "vs:EnableBrowserLink" to "false" in web.config or debug=false.
Or you can just ignore it. It wont do any harm, will only happen locally, and should be fixed soon.
Also see this question and this question.
When I try to run an MVC web application in Page Inspector mode I get the error "Object reference not set to an instance of an object" and the app just hangs.
Microsoft has noted that it's a bug but doesn't say when they'll fix it.
Anybody have a workaround?
Thanks!
I was also seeing the object reference error, did some research and found this thread on Asp.net.
In the 3rd post down the user states that they installed Visual Studio 2012 Web Express to clear up the error. I installed this and now Page Inspector is working just fine in my mixed project.
Check the address bar in Page Inspector to see what parameters are being used, possibly your page doesn't render with the given URL. Also ensure that Visual Studio has the latest updates.
As a workaround you could try adjusting the URL in Page Inspector, so that your controller will pass data to the view that you know is working correctly.
Based on http://msdn.microsoft.com/en-us/vs11trainingcourse_pageinspector_topic2.aspx?ppud=4 I believe the problem is:
The Page Inspector window will show the /Home/Index URL mapped to the source View you selected.
We changed our routing away from /Home/Index a long time ago. If I create a new Web application, which has a /Home/Index page, then Page Inspector works fine.
So, long story short, always make sure you have a /Home/Index page, even if it's an orphan, if you want to use Page Inspector. Hopefully Microsoft will fix this bug soon.
I'm sure this is a simple misunderstanding but I'm trying to change the default browser in Visual Studio 2010 from Firefox (my machine's default) to IE so that VS will stop debugging when the window closes.
Based on ScottGu's post on the subject, I'm expecting a "Browse with..." option when I right-click on an aspx page in my MVC app; but there's no such option.
Also (possibly unrelated), when trying to launch the ASP.Net Configuration, the Cassini Development Server starts, but no browser instance launches. Starting to get very frustrated!
Asp.net MVC doesn't let you do this
You can only see "Browse with..." when you right click on the Default.aspx on app's root. Otherwise it's just not there.
This menu option obviously isn't stupid and doesn't let you browse a particular view, because it's not up to the browser to request a particular view, but up to a controller that may display some (or any) view... So Visual studio doesn't give you this option on your views.
I suppose it would be best if you've changed your default browser on your development machine.
In ASP.NET MVC 1 projects, you have to right click Default.aspx to get the "Browse with..." option.
However, ASP.NET MVC 2 projects do not have a Default.aspx. The best way to change your default browser is to create a standard ASP.NET project and set the default browser using that.
I'm building an MVC 2 project and encountered this issue. I just created a Default.aspx web form in the root folder, used the Browse With... menu it exposed to set my browser for this particular project to IE, then deleted the Default.aspx. Kind of a pain, but you only (should need to) do it once.
You can add an app_offline.html file to your MVC3 app. This is useful, because if you rename it to app_offline.htm and deploy it, it will cause IIS to deny all requests to the app (and will return the content of the app_offline.htm(l) file).
If you have one of these, you can right-click it to get the browse with option. In case you want to test out with different browsers & window sizes from VS, without a plugin.
I have an Asp.Net MVC page that links out to a Asp.net web form with a report viewer control on it. The web form opens in a new window, and displays a report properly when clicking on the link on my MVC page. However when I close the my broswer window while the report is processing, and try to open it again, the page hangs and eventually gives me a page can not be displayed error.
Thoughts?
Initial thoughts from me are;
1) Not closing objects correctly on errors which might happen when browser windows are closed unexpectadly.
2) Report still running and not allowing another instance. easy to prove. when you get the error, close the window and click the report again. if you get your report then this may be a candidate.
3) Caching issues. try setting IE to refresh on every visit.
I think 1 or 2 are likely as I've seen this before on one of my applications where processing was interuppted.