Hi folks,
i have the following data as a string in my Action method:
string json = "[[1,2],[3,4],[5,6]]";
Simple.
When I call the Json view, it encapsulates the result in two double quotes. This stops the client side javascript from loading this result into a javascript object.
eg.
return Json(json);
result => "[[1,2],[3,4],[5,6]...
I'm learning ASP.NET MVC (and MVC in general) and all the help online I find only demonstrates using a single table, not relations between multiple tables. I'm running a query that I expect should also return associated entities, but it's not and can't figure out what I'm missing. I appreciate your help!
I have the following data:
Ti...
I'm new in asp.net mvc.
I'm using Linq to Sql and trying to do everything loosely coupled.
I've two tables:
News
NewsFiles
What I'm trying to do is save a news and upload its files at the same time.
How can I create a news in conjunction with his files saving it to NewsFiles table?
The Linq to Sql model is Ok, it includes the obj...
Hi,
I have a subscription based website (with a monthly fee) and I would like to prevent users from sharing accounts in order to avoid paying the monthly fee.
Is there a way this can be done?
Cheers,
Mike
...
I need help figuring out why my authentication ticket is expiring after about an hour on my hosted website. But if I run the site locally the authentication ticket stays alive for the correct amount of time.
This is my localhost web.config:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="20160" slidingExpir...
Hi,
I know basic idea of thunderdome principle (one object enters, one object leaves) but I didn't see any real world example of it in asp.net mvc.
Is it good example of thunderdome principle
public ActionResult Index(Employee employee)
{
//some actions here
return View(employeeViewModel);
}
...
I have a WWW filter on all my actions
public class WwwFilter : ActionFilterAttribute, IActionFilter {
#region IActionFilter Members
void IActionFilter.OnActionExecuted(ActionExecutedContext filterContext) {
}
void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext) {
var request = filterCon...
I'm currently learning "traditional" ASP.NET, but then there is a lot of buzz around ASP.NET MVC. Should I get into MVC now, or get a good understanding of the trad webforms first?
...
EDIT: Page language is VB
UPDATE
I'm going completely crazy. Here are some screenshots, I hope somebody sees what's going on (TestClass is a simple class with ID and Name property):
View (list, model = IEnumerable)
View (index, no model)
Controller
Resulting page at runtime (list: error)
Resulting page at runtime (index: works)
So...
To update an Entity of database (table) we directly inherit Model Entity to view page like
<%@ Page Title="Edit" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCProject.Models.Preson>" %>
And Then Post method of Edit is called from controller, and at last, Entity updates By savechanges me...
Hi,
i'm trying to create a strongly-typed view using Visual Studio 2008. I can right-click a controller action and choose: Add view... In the next dialog window there is an option 'Create a strongly-typed view'. If I check this option I can select a list of classes that are in my current project.
However I cannot select the class I ne...
hi,
the more i dig into MVC the more i love it and think how was I working with Web Forms :)
but somethings are really confusing like in in Web forms if i wanted to encapsulate a controls, let us say a Combo Box, then i would create a user control and add this Combo Box to it and declare Properties, then i can drop it on any page and...
What pros(positive sides) of using Spark view engine for ASP.NET MVC project. Why it better then default view engine?
...
There are quite a lot of questions on SO regarding View Engines in ASP.Net MVC, and about using "custom" ones instead of the "default" one. For me as a hobby programmer, the term "View Engine" is new, and I have not been able to understand what it means. So, my questions are:
What is a View Engine?
What does the View Engine do, and whi...
I am trying to parse an RSS feed using Linq to XML like so:
XNamespace slashNamespace = "http://purl.org/rss/1.0/modules/slash/";
XDocument rssFeed = XDocument.Load(@"http://blog.daimokuchart.com/index.php/feed/");
var posts = from item in rssFeed.Descendants("item")
select new RSSData {
...
I've replaced an old PHP web site with a new ASP.NET MVC web site. The old page addresses no longer work. I want each to 301 (Moved Permanently) redirect to specific new addresses.
But, IIS 7 seems to intercept many such requests before they get to my application. I want to handle the error logging and redirections in the Applicatio...
I am writing an ASP.Net MVC application that uses NTLM authentication, so users don't need to register with the site. If I have disables anonymous access, can I use User.Identity.Name as the ownership key in the database. What I'd like to do is to be able to issue a search such as
from station in db.stations where station.user == usern...
If I disable anonymous browsing of an MVC site and only allow NTLM authenticate users access, I presume any page simply decorated with the
[Authorize]
attribute will pass, so if I want to only allow user limited access to parts of the site, I'll need to do add them to an AD group and use that to apply the filter?
...
We are going to port a legacy windows app to a large web application for a vertical market. Looking at MVC. Each implementation may have 50 to 5000 users. Looking at putting navigation in Master Page. The application will contain 200 to 300 menu items, resulting in over 500 views. We want to display a trimmed navigation menu for each use...
If I have an ASP.Net MVC applicaiton where users can only access via an NTLM authenticate account, do I need to use ASP.Net Membership services and issue cookies?
Or do I have completely the wrong end of this particular stick?
...