I'm having an issue where even after deleting the users cookies they are still logged in to my ASP.NET MVC site (IIS 6). HOWEVER, this only happens on my clients machine, my IE 8 on Win7 does NOT have this issue and the normal log out method works fine. It seems they need to close out the browser before it will release them from being ab...
When I login I enter my user name and password.
On a different create view these values also populate the email address and the password fields.
Why is this, and what can I do to stop it?
The next 2 markups are my login view and my create view
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.V...
Hello,
Let's say I have this property
[Required(ErrorMessage = "Add this property")]
public string MyProperty {get; set;}
When I use modelbinding validation like this
UpdateModel(myModel);
Then when there is an error the form is re-displayed, and the textbox representing MyProperty is highlighted (i.e. red borders and pink backgr...
If in my controller:
public ActionResult Index()
{
//no code implied
return View;
}
Then in the view that is returned:
<%if(ViewData["SomeString"].ToString() != "True") {%> show this <%}%>
I will get an error at runtime because of an object reference having no object.
However inside of a page where I do:
<%if(Request.Qu...
I'm using the following snippet of code in an MVC Action to return an image in an HTML image tag:
byte[] bytes = System.IO.File.ReadAllBytes(fileLocation);
string fileType = "application/octet-stream";
FileContentResult fcr = new FileContentResult(bytes, fileType);
fcr.FileDownloadName = fileName;
return fcr;
The image tag's src attri...
Hi all,
I am working with ASP.NET MVC and have a view page with a simple text box and button to accompany it. I want AJAX to submit the form when the user clicks the search button. The response (search results) will be returned and displayed in a content div on the same page.
I have done this successfully with JQuery, but I need the sa...
Hello hello. Here's what I have. I have an MVC application where all the data is tied together by VisitDate table in my database. The home page is a strongly typed view of type VisitDate, all it does is pull up some simple data. Now, here's where I'm having a problemo. I need a link that passes the current model in the view back to a sep...
Hi,
I'm using Rob's mvc startesite http://mvcstarter.codeplex.com/ with ASP.Net MVC 2, Ninject2, NoRM (http://github.com/atheken/NoRM) and MongoDB. It works so fast and the developpement is even faster but I'm facing a big problem, I at some points, get connection timeout. I can't figure out what I'm doing wrong.
I already asked a que...
Can i use List or something?
...
I have a Visitors controller. Inside I have Index and SignIn actions. Here are the actions:
public ActionResult Index(int month,
int day,
int year){
var visitors = visitorRepoistory.FindVisitorsByDate(month, day, year).ToList();
return View("Index", visito...
I have a int property in my class and want to validate if the user has entered a string.
How can I do that using data annotations?
When I pass a non-integer value I get a excpetion like this:
The value 'asdasd' is not valid for property.
Any Ideas?
...
I'm interested to know how people handle the following situation.
Assume we have a DataField and each DataField can have unlimited number of DataValues
We have 2 controllers to handle the manipulation of these objects
DataFieldController
DataValueContoller
Now if we ever need to add a new DataValue we need to know the ID of the Cus...
I am building an app with ASP.NET MVC2, Fluent NHibernate, StructureMap, and PostgreSQL. I am a total newbie when it comes to Fluent NHibernate. I got a setup going from a couple different sources but when I build and run my app it doesnt create the database tables for the database in my connection string. I have code in a few different ...
Hello, My controllers are getting large and out of hand.
A typical controller does the following:
It determines whether a given user has access to a given resource.
It validates the ViewModel.
It translates the ViewModel into the DTOModel for persistence.
It calls repositories to update/create new objects and associated other new obje...
When defining the ValidateAntiForgeryToken attribute. What level of complexity should be given to the salt?
For example is an alpha-numeric over X number of characters characters good? Should there be symbols as well.
[ValidateAntiForgeryToken(Salt = "How complex is good")]
public virtual ActionResult SaveDetail(UserDetails details)
{
...
Hello,
I created an application pool, and i assigned to it a test application(simple 1 view that renders hello, one action and one controller ) that i made in MVC
The thing is that when i executes as many times as i want it works, but after some hours (i dont know why), if i enter again into my server and i execute it, crashes.
The ...
Consider a project with 2 Areas.
/Areas/Blog
/Areas/Dashboard
Now say that my Blog area has an editor for the type SpecialBlog. /Areas/Blog/Views/Blog/EditorTemplates/SpecialBlog.ascx
What if a view that is part of my Dashboard Area would like to display a special blog?
The following code works from Views inside the "Blog" Area but n...
How do I change the class that is assigned to the control which is rendered by an MVC view by either the Html.TextBox or Html.ValidationMessage methods?
...
Should my ViewModel encapsulate the Services needed to populate it?
Currently I'm doing it as follows:
public PartialViewResult Companies(SearchViewModel search)
{
search.Summary = _entitySearchService.GetSearchDataSummary(search.SearchExpression);
search.PagedCompanies = _companyService.GetPagedEntities<Company>(search.SearchE...
Hey all,
I have (or so I think!) a simple problem.
I will greatly simplify my model to speed this along.
I have a model class lets call it item:
public class Item
{
[Required(ErrorMessage="Must indicate if product is to be tracked by serial number.")]
public bool TrackedBySerial { get; set; }
}
I have an "Add" view wh...