I am looking to return some JSON across domains and I understand that the way to do this is through JSONP rather than pure JSON. I am using ASP.net MVC so I was thinking about just extending the JSONResult type and then extendig Controller so that it also implemented a Jsonp method. Is this the best way to go about it or is there a bui...
I have an action that resets a user's password. In that same action after the password is reset I want to login the user. I wanted to just use a "RedirectToAction" and send the username and password to my SignIn action. Since I have logic in that action that handles errors and what not.
So I need to send the AntiForgeryToken value to t...
Hi,
I have googled this code to upload a file with MVC.
<form method="post" enctype="multipart/form-data" action="/Task/SaveFile">
<input type="file" id="FileBlob" name="FileBlob"/>
<input type="submit" value="Save"/>
<input type="button" value="Cancel" onclick="window.location.href='/'" />
</form>
But when interrogate the forms["Fi...
Hi,
Quoting from the NerdDinner ASP.NET MVC sample application
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated) {
%>
Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>!
[ <%= Html.ActionLink("Log Off", "LogOff", "Account") %> ]
<%
}
else {
%> ...
When a user log in into my application i want to show his name throughout the whole application. I am using the asp.net MVC framework. But what i don't want is that is have to put in every controller something like:
ViewData["User"] = Session["User"];
This because you may not repeat yourself. (I believe this is the DRY [Don't Repeat...
I am using the asp.net MVC Framework. IN my application a user has to log in. And when the combination of username and password is correct, the div (or panel?) with with the menu in it, must become visible. But how can I do this? When a name my panel pnlMenu, in my controller i cannot do something like:
pnlMenu.visible = true;
So, how...
In ASP.NET MVC controllers exist in a folder called Controllers. Their names must end Controller otherwise things just don't work (you get an HTTP 404 error).
However, Model names don't have to end Model and View names don't have to end with View.
This seems inconsistent...why (from an MVC or design standpoint) do controller names have...
In my ASP.NET MVC controller classes I have action methods.
In my views I have Html.ActionLinks that have the names of those action methods set as their actionName values.
A typo in either of these locations will break things. Are there any tools that can check my controllers and views for validity in this manner?
...
In ASP.NET MVC the convention is that a controller action method should return an ActionResult (or a type derived from ActionResult).
However, you can write a public method that returns pretty much anything and if that method is called (from a browser) the framework will package the return value up as a ContentResult and the browser rec...
I get an error when I do the following:
if(Session["value"] != null)
{
// code
}
The error i get is this:
Object reference not set to an instance of an object.
Why is this? I always check my session this way? I am using the MVC Framework, does this has something to do with it?
EDIT:
The code is in the constructor of a Controlle...
There are lots of articles and discussions about the differences between ASP.NET WebForms and ASP.NET MVC that compare the relative merits of the two frameworks.
I have a different question for anyone who has experience using WebForms that has since moved to MVC:
What is the number one thing that WebForms had, that MVC doesn't, that yo...
I know that asp.net MVC supports webservices call,
But I am asking in a wide scope that I have developed MVC application and I want to build an ERP that Integrates both asp.net 2005 application and my own MVC application.
So is it possible?
I am just an infant to think like this.
And this question comes in my mind when I saw a first v...
I know this issue has been touched on before eg here
But the solutions doesn't seem to fit my problem.
Here is my html. The number of rows are variable
<table id="workPlanTable">
<tr>
<th>
Begin
</th>
<th>
End
</th>
</tr>
<tr itemId="1">
<td><input class="begin" id="begin_1" name="beg...
I'm working with the NerdDinner sample application and arrived at the section which deals with the Virtual Earth map. The application stores some values for the longitude and latitude. Unfortunately on my system floating point numbers are stored with a comma as the decimal separator, not a dot like in the US. So if I have a latitude of 4...
Server side we can authenticate the user but I want security of data when ajax or JQuery sends the data. Like on client side someone can only see the parameters of any call in encrypted format.
So how do I do this. I have seen this scenario on this site.
EDIT
we can ignore to encrypt data when it comes form server.
But atleast at send...
I am trying to find out if anyone has any experience or ideas of using MEF (Managed Extensible Framework (Microsoft's new plugin framework) with ASP.NET MVC. I need to create a standard ASP.NET MVC, which I have. But I need to offer additional functionality i.e. Views and Controllers, etc, depending on if I add a plugin. It doesn't need ...
My ASP.NET MVC project is returning "The resource cannot be found" if I start the app without first making a change to one of the controllers.
If I go to a controller and just add a space, it works correctly. If I then go to a view, add a space, and hit Ctrl-F5 again, I get the error again. What's going on?
...
I'd like to construct an object in different steps in an asp.net mvc application, each step being a different page. The sort of thing you'd store in Session in a quick Web.Forms application.
Reading about it, Session doesn't seem to me as something very asp.net MVC'ish. However I can't really think of other alternatives to this situatio...
Does anyone know of any issues with rendering incorrect querystrings when using htmlAttributes in an Ajax.ActionLink? It seems that if I put even an empty array in for the htmlAttributes, the link gets rendered incorrectly. Here's my code.
When I do this (note the new { }):
<%= Ajax.ActionLink("Delete", "Delete", "Milestone", new Rou...
Hi guys,
So far, my https deployments have commonly involved a naive lockdown of the entire site with https and provide an http-to-https redirect on the web server.
I now plan to have a single ASP.NET MVC site (on the cloud) that will contain both http and https pages. So, the site will have 2 conceptual (not physical) zones providing ...