I have two custom ActionFilters on an action.
In first of the actionfilters, I have an redirect performed if a condition is not met (classic authorization). And in another I have an redirect performed if another condition is not met (say role checking).
But I do not want to continue to the second actionFilter if the first one is not ...
I've got a very simple Action on my Controller that's attempting to return my XmlSiteMap as a JsonResult:
public ActionResult Index()
{
var nodes = SiteMap.Provider.RootNode;
return new JsonResult()
{ Data = nodes, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
However, when I call the Action, an InvalidOpera...
I need to detect if a request cookie - value is different from a response cookie - value.
Its not as easy as:
if(cookiesArePresent)
{
bool isDifferent = HttpContext.Current.Response.Cookies[".ASPXANONYMOUS"].value == HttpContext.Current.Response.Cookies[".ASPXANONYMOUS"].value;
}
But I read that changing the Response.Cookies ch...
Hi,
I' still newby to this so I'll try to explain what I'm doing. Basically what I want is to load a dropdownlist depending on the value of a previous one, and I want it to load the data and appear when the other one is changed. This is the code I've written in my controller:
public ActionResult GetClassesSearch(bool ajax, string phy...
Hello folks,
does anyone have any good links/tutorials about how to create a simple ASP.NET MVC website, and have it run against a Local IIS7 Web Server, instead of the default Visual Studio Development Server (aka Cassini).
Yes, i tried google, but i fail at getting some good keywords, etc.
Cheers :)
...
I'm developing MVC application where I currently have 3 projects in solution.
Core (it is supposed to be for Repositories, Business Classes, Models, HttpModules, HttpFilters, Settings, etc.)
Data access (Data provider, for instance SqlDataProvider for working with SQL Server datastore - implements Repository interfaces, XmlDataProvider...
Hi all.
After complete of asynchronous call to WCF service I want set success message into session and show user the notification .
I tried use two ways for complete this operation.
1) Event Based Model.
client.GetDataCompleted += new EventHandler<GetDataCompletedEventArgs>(GetDataCompleted);
client.GetDataAsync(id, client);
private ...
Greeting,
I'm beginer of ajax technology and now i need to create two dropdown in
MVC project for example:
First dropdown has the list of classroom [601,602,603] when i choose one then next
dropdown will has the list of student belong to each class room.
Now, I already create the repository class that has method GetStudentByClassroo...
I'm currently using NVelocity to render some email templates.
I'm curious how I can do this with the standard ASP.NET MVC view engine i.e. render a view as a string.
Basically I want to pass get the string result of a model binded view and pass this to iTextSharp to generate a PDF.
Thanks.
Ben
...
In "traditional" ASP.NET (Web Forms), the UpdatePanel control lets you do a partial refresh of a part of a page. You don't need to write much code to hook this up.
What's the equivalent in ASP.NET MVC? I'm guessing I'd need to use a partial view for the bit that I want to update, then on the client side retrieve that HTML and pump it in...
Hi, I'd like to create a dropdownlist from following structure
List<KeyValuePair<long, string>> sponsori =
new List<KeyValuePair<long, string>>();
Now I want the selectlist to have the pair's long as data value, the string as text value and the selected item, if I have only access to the long of the selected item.
THanks in adva...
I have almost the same problem as this unanswered question. The only difference is I'm using VS2008, but I'm in an MVC project calling this javascript function:
function CompanyChange(compCtrl) {
alert(compCtrl.value);
debugger;
var test;
for (var i = 0; i < document.all.length; i++) {
test = document.all[i];
}
}
I hit the alert...
What is the most standard or best way to persist data between requests?
Should I use cookies or session variables? I'm interested in keeping data like sort order, sort column, and page number (for paginiation).
I'm coming from a webforms background so normally this type of thing was automatically handled for me in the viewstate of th...
I need a regex to run against strings like the one below that will convert absolute paths to relative paths under certain conditions.
<p>This website is <strong>really great</strong> and people love it <img alt="" src="http://localhost:1379/Content/js/fckeditor/editor/images/smiley/msn/teeth_smile.gif" /></p>
Rules:
If the url conta...
Hi All,
I will restrict this to the three tables I am trying to work with Problem, Communications, and ProbComms. The scenario is that a Student may have many Problems concurrently which may affect their studies. Lecturers may have future communications with a student after an initial problem is logged, however as a Student may have mul...
I know there is some syntax with ? to optionally render attribute.
But I can't find it now that I need it ...
Something like:
< input checked=<%? model.IsActivated % > ...
Thanks.
EDIT: Since it seems that nobody knows... perhaps it was some different view engine.
Thanks for answers any way :)
...
Hello,
Currently my website is based around MVC and the Entity Framework running against a SQL Server 2005 database. So far, it has all been running very smoothly, and I really enjoy MVC and its slimmer more concise code (and no huge viewstates or soul destroying postbacks ;))
Recently I was working on upgrading the site to use a simpl...
Calling Html.RenderPartial("~/Views/Payments/MyControl.ascx"); from a view works if MyControl.ascx is a control that directly inherits System.Web.Mvc.ViewUserControl.
However, if the control inherits a new class that derives from System.Web.Mvc.ViewUserControl, the call to Html.RenderPartial("~/Views/Payments/MyDerivedControl.ascx"); f...
I'm using the jQuery jstree plugin (http://jstree.com) in a ASP.NET MVC 2 project on .NET 4 RC, and running on IIS 7.5. It comes with some stylesheets with inline images with data urls, like this:
.tree-checkbox ul {
background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==);
}
Now,...
Using ASP.Net MVC 2, is there any way to use the RedirectToAction() method of the Controller class inside a class that is based on the AuthorizeAttribute class?
public class CustomAttribute : AuthorizeAttribute {
protected override bool AuthorizeCore(HttpContextBase context) {
// Custom authentication goes here
retur...