Hello,
I am using a route like this one:
routes.MapRoute("Invoice-New-NewCustomer",
"Invoice/New/Customer/New/{*name}",
new { controller = "Customer", action = "NewInvoice" },
new { name = @"[^\.]*" });
There is an action which handles this route:
...
My asp.net mvc site needs some kind of authorization but it is rather different than the usual concept of users and thus membership.
It will be used more for preferences then for authentication actually. Accounts without any password should be possible (and will initially be the only type) and an account can also be used by multiple user...
When I delete any file from an asp.net mvc project (project not in svn or any source control provider) it takes upto 60 seconds for the UI to become responsive again. CPU usage jumps to 80/90%.
Has anyone else experienced this and know of any fix or solution?
...
I know that within a view I can render an action from the same controller using Html.RenderPartial. However, I need to render the output from an action under a different controller. What is the best way to do this? I would prefer to do this directly within the view, rather than doing it in the controller and saving the output to a ViewDa...
i try Request.Files, HttpContext.Request.Files but got no luck
html form:
<form name="" method="post" enctype="mulitipart/form-data">
<input type="file" name="file" />
</form>
...
Is it possible with the wmd editor to add a button to let the user upload an image to the web server and place the corresponding img markdown in the textbox? If not, will another good inplace editor do it? Context: I'm using asp.net mvc, C# and I am a true beginner with javascript.
...
Ok so I've spent a couple hours trying to resolve this issue and have had no leads so far, keep getting the same 404 error. What happens is the website picks up the Default.aspx page and displays it like it should. But the Home page has a clickable image where it routes to another view page. The image code is like so:
<a href="<%= Url.A...
I Have following code:
Controller:
public ActionResult Step1()
{
return View();
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Step1(FormCollection form)
{
TempData["messageStatus"] = new Random().Next(1, 1000);
return RedirectToAction("Step1");
}
View:
<%=TempData["messageStatus"]%>
in first time in ...
I have a feeling I'm being too "webforms" with this, but I'll ask anyway. I have a form in an ASP.NET MVC project that has some input fields and two buttons on it. One button is used to 'filter' one of the list boxes. The other is used to submit the form. My view looks something like this:
<%using (Html.BeginForm())
{%>
<%=Html...
I have two routes:
routes.MapRoute(
"FetchVenue",
"venue/fetchlike/{q}",
new { controller = "venue", action = "fetchlike" }
);
routes.MapRoute(
"venue", ...
I have a database table called "Posts" which stores all the information regarding an article submission on a website. There is a column named "Views" which is a value that gets incremented each time that particular post gets viewed.
The process is this:
Get the record from the database
Increment the current by one
Save the changes t...
When doing a Ajax call to an MVC action currently I have my javascript inside the View, not inside its own JS file.
It is then very easy to do this:
var xhr = $.ajax({
url: '<%= Url.Action("DisplayItem","Home") %>/' + el1.siblings("input:hidden").val(),
data: { ajax: "Y" },
cache: false,
success: function(response) ...
I am having a problem setting the Authorize attribute Role value from a variable. The error message says it requires a const variable. When I create a const type variable it works fine but I am trying to load the value from the Web.Config file or anything else that will allow the end user to set this. I'm using integrated Windows authe...
I am using the standard outputcache tag in my MVC app which works great but I need to force it to be dumped at certain times. How do I achieve this? The page that gets cached is built from a very simple route {Controller}/{PageName} - so most pages are something like this: /Pages/About-Us
Here is the output cache tag that is at the to...
For a Yes/No radio button group the following Html is rendered. The correct value of the response.text property is returned to the controller. However, the choiceID property of the hidden input is always "1" (the hidden value from first button).
Also, the two instances of the selection values are returned to the Model List.
ie.
" no, Id...
Howdy.
I'm new to both ASP.Net MVC and jQuery and what I'm trying to do is make a form that either adds a new RockBand or updates an existing RockBand based on if the rockbandid is an empty guid or not. I figured now is a good time to get rolling with jQuery. So the first step is to make a list of bands and put an edit link next to it...
Would anybody know why my parameter is being "converted" to lowercase when it hits my ASP.NET MVC controller action?
I can only assume it is being converted as looking at data value just prior to the ajax request it is in correct casing, but then when debugging my action method within .NET during the ajax request and checking the incomi...
Recently ASP.NET developer launched its newest control, Charting control. (Microsoft Chart). Does this compatible with ASP.NET MVC, or its only compatible with ASP.NET WebForm ?
...
I must be dense. After asking several questions on StackOverflow, I am still at a loss when it comes to grasping the new routing engine provided with ASP.NET MVC. I think I've narrowed down the problem to a very simple one, which, if solved, would probably allow me to solve the rest of my routing issues. So here it is:
How would you ...
Hi!
I have an action handling a form post, but I want to make sure they are authenticated before the action. The problem is that the post data is lost because they user is redirected to the login page, and then back.
[AcceptVerbs(HttpVerbs.Post)]
[Authorize]
public ActionResult AskQuestion(string question)
{
......