I am fairly new to mvc and I tried mvc4 when it was still in beta. I remember that when I started a new internet project, I got a popup dialog for log in and registration by default. I don't see that when I start a new project anymore, is that gone from the internet project?
I believe the popup dialog you're referring to was just the jQuery UI Dialog that the sample project used to use:
The project was built to support both a straight request to /Login and one via the jQuery UI dialog which was slimmed down to look like it was only a popup. It did this by making the Login action return a different View based on it being requested through the frame or not as detected by a value in the query string.
You can of course have this again, you'll just need to do it manually (or dig out one of the older templates) as it's no longer in the default templates.
To help you out, here's a couple of somewhat related questions that contain the sample code (ContextDependentView is one thing I remember from this template) and probably some hints on how to recreate it:
Generating a modal jQuery partial view with MVC4 does not work
ASP.NET MVC 4 and ContextDependentView
MVC4 - ContextDependentView - What does it mean?
It was removed from the Internet project templates in the final releases of MVC 4. The popup was pretty slick but I imagine there were issues/complexities they decided to eliminate by just keeping the view/page for logon and registration. In the older versions that had the pop-up they still had the view/page for logon because of how forms based authentication works. If the user is not authenticated/authorized for a web site/page MVC does a redirect to the logon page. This will not work with a JQuery popup dialog on the same page. The popup only worked if you clicked on the Logon link for the page. I am guessing that they decided since they need the view/page logon anyway to simplify things and keep it consistent by eliminating the popup dialog.
I have implemented an MVC Single Page Application (SPA) that only uses a JQuery dialog for a popping up a dialog for logon, and eliminates the need for logon page. But it required a fair amount of customization to authentication/authorization process on the server and used basic authentication on the client.
Related
I have a asp.net mvc application deployed in production. User can save a form in draft state and then can submit the form later. This functionality is working perfectly but for two of our users in Malaysia, when they click on Submit button, nothing is happening. It seems that the button is not working (page is not posted back).
I am unable to understand what could be the possible cause. If there is a firewall issue, then site would not have been opened at all.
Can I use fiddler to check or if there are some other options?
I am learning the JQuery Mobile framewrok and is using VS 2013 for my new project. I created a MVC 4 JQuery Mobile project. From the project I got out of the box, I click on the Login link and on that login page, I click on the Login Button, it shows the expected error messages. I want my project to be ajax enabled so I set the $.mobile.ajaxEnabled = true; and debug in VS, it hits the break point I set in the Login action in the AccountController so the client-side validation didn't work and got to the post on the server-side.
Is it by design that I can't use the built-in client-side validation when ajaxEnabled is set to true? Or is there some settings that I need to set? I need my project to be jax enabled and would like to use the built-in client side validation if possible and don't have to write custom jquery validation code.
Found the answer. add the below code to the on pageshow event
$.validator.unobtrusive.parse(".ui-page-active form");
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.
In Visual Studio 2010, you can right-click an aspx page in a web forms app, or on the web forms app itself in the solution explorer, and you get "View in Browser" in your context menu.
In ASP.NET MVC projects, this item doesn't seem to be available in the context menu. The only way I know to run the app is to set the MVC app as a startup project and hit CTRL+F5. But, if there are two MVC apps in the solution, this doesn't really work. How do you accomplish this for mvc apps?
In my scenario, There are multiple users working on application on different controllers/view, How could they execute their view without changes the routes in Global.asax ?
This is a fundamental difference between MVC and Web Forms, and is crucial that you "get" this difference.
In Web Forms, everything revolves around the page. You can right click an aspx page and "view in browser" because there is a 1:1 correlation between the page and the URL. The page is at the top of the request, so to speak.
In MVC, everything revolves around the controller. The view is not part of the URL in any way, it's merely a template used by the controller to render the output. You can choose to have any action method render any view you want, it's not tied directly to the request.
Since the "view" is completely disconnected from the request, there is no option to "view in browser", because doing so makes absolutely no sense. You don't "view" views, they are templates that are rendered by the controller action method.
I am having an odd issue with MVC3 on my site. I have a simple login form using MVC3 and jQueryMobile. The login functionality is working properly. Once I press login the loading graphic shows and I can step through the code and see that the home page is loading. However, the login page still shows on the screen after I trace the code. Can you all offer any suggestions? I am using RC1 of jQueryMobile at this point.
Use the Chrome or IE9 F12 developer tools to debug. Go through my ASP.NET MVC 4 Mobile Features tutorial. You should also use Fiddler tool to see what's going on.