My MVC app is returning SqlExceptions when trying to access any table in my database.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'dbo.Projects'.
My app us linq for the data layer.
If I use an old dll it works fine, (so doesn't seem to be a problem with the DB) just this latest app dll that I've uploaded...
I'm interested in knowing what are the best practices for using role based security in MVC: how to secure your actions and make them accessible by specific roles only?
...
What C-sharp type can I serialize to get JSON object with format "name":[[1,2,3],[1,2,3],[1,2,3]]
If serialize array like this
public int[,] data = {{23,21,10},{45,43,50},{23,21,90}};
it gives format of
"data":[23,21,10,45,43,50,23,21,90]
Or more generally, is there some list where i can find what type is serialized in which format?
...
I'm using ASP.NET MVC.
I'm also using the MySQL connector and providers to connect to a MySQL database, which is using the ASP.NET Membership schema.
I also have a second table called 'user' which contains all the additional user data, company_id etc.
As I am going to need the (complete) User object for every page, what is the best wa...
Hello
I have a problem with posting a multiselect, I get error:
"There is no ViewData item with the key 'NotificationUsergroups' of type 'IEnumerable'."
In the controller I have:
MultiSelectList NotificationUsergroups = new MultiSelectList(Usergroups, "UsergroupID", "UsergroupName", selectedNotificationUsergroupIDs);
...
Hello,
I have a for to update a list of entities it is possible to do something like these
<%using (Html.BeginForm())
{
%>
<% foreach (var entity in Model)
{
%>
<p>
<%= Html.TextBox("Entity.Name", entity.Name) %>
</p>
<% } %>
<input type="submit" value="Update" />
<% } %>
and then in the action receive a list of entitie...
Hi,
I have a View for creating a customer that contains numerous textboxes. After the user tabs out of each textbox I want to use JQuery to call a Controller method that will check in the DataBase and look for any possible matches, the controller will then send content and I will use jQuery to dynamically show the possible matches (Sim...
Hi All,
I looking into the concept of queueing for web apps (i.e. putting some types of job in a queue for completion by a seperate worker, rather than being completed in the web request cycle).
I would like to know if there are any good solutions existing for this which can be utilised in an ASP.NET MVC environemnt.
Has anyone had an...
Hi, I am new to LINQ, so I am pretty confused here. I have a database and try to run following code.
IQueryable<decimal> location_ids = (from m in _db.Admins
where m.UserId.Equals("c5d3dc0e-81e6-4d6b-a9c3-faa802e10b7d")
select m.LocationId);
if (!location_ids.Contai...
How much is the actual memory / performance gain in an ASP.NET MVC controller when using these two different ways of declaring the Model for a view?
User user = userService.GetByID(id);
return View(user);
or
return View(userService.GetById(id));
I'm supposing that the last one is a bit more performant as we do not initialize an obj...
I'm trying to get an XML file generated using a namespace as such:
<namespace:Example1>
<namespace:Part1>Value1</namespace:Part1>
</namespace:Example1>
I've tried using
[XmlAttribute(Namespace = "namespace")]
public string Namespace { get; set; }
but I'm clearly missing something. The structure I've used is
[XmlRoot("...
In almost every page in my ASP.NET MVC site I am using information about the user. This is usually pulling in information about the company they work for in the Model to pass through to the view, or in the View to establish which parts of the page the user can view with their permissions.
Instead of getting the User in every Model, is t...
Hello
I'm trying to "convert" this into a strongly typed model instead of ViewData. But how should that look?
I got this in my controller:
public ActionResult UserEdit(int? userID)
{
User u;
if (userID == null)
{
u = new User();
}
else
{
u = _us.GetUsers...
I have an MVC website I've been developing and I now wish to move up to my shared hosting service. However, I've run into a bit of a problem: my provider only allows for 1 root level application.
When I created and application as a sub of my root application, my MVC app wouldn't work. I'd either get a "resource not found" or, after adju...
I am trying to submit a form via jquery's ajax method in my .net mvc application. I've set the dataType to json and the contentType to "application/json; charset=utf-8". In my controller action, I'm returning a JsonResult.
For some reason, the JSON response doesn't get handled correctly and instead I get a dialog box to save a file ...
I am using the jQuery plugin to add support for SwfUpload by steven sanderson which allows files to be uploaded with ajax.
The problem is that Request.IsAuthenticated is always false with an ajax post. This means that User.Identity.Name = "" which doesn't allow me to load up values I need to save the file.
Is this by design and what i...
I wrote a storedprocedure like "PersonDetails" to get Records from multiple tables and filter records. I want call the procedure from controler.
Only with ADO.NET entity framework and should not use Linq language.
...
For every page requested, I need to check a cookie or create it if it's not there.
If the cookie is there, I need to load up some info from the DB based on the contents of that cookie.
To do this I have created a base controller called AppController that my other controllers inherit from.
then I have something like this (so that the Cu...
Hello,
I am trying to list all the controllers and their actions with specific attributes to create a dynamic google sitemap. So that I can "mark" certain actions with an attribute so they show up in the sitemap.
Here I found out how to get all the controllers. But I am not sure how to get all their Actions with a particular attribute. ...
I am trying to build an uploader with ASP.NET MVC, but I'm having a bit of a problem.
The uploader occurs in a private pane that is loaded by jQuery - that is to say, it is it's own view, but it is not accessible via a View Path. Or it is not intended to be - either way, I need the page not to change once the upload is complete.
Is th...