Search Results

Search found 5 results on 1 pages for 'slackercoder'.

Page 1/1 | 1 

  • MVC 2 with IIS 6 Problems

    - by SlackerCoder
    Hey guys, I'm using IIS 6 on a Windows 2003 Server and I am trying to get an MVC2 project installed on that machine. I am having nightmare-ish problems doing so! I've looked up TONS of references on what to do, and not 1 single one works. (They work for MVC1 projects, as I have a few of those running already using said solutions). Does anyone have any tips/hints/ideas on what needs to be done for MVC2 projects with IIS 6? I am definitely pulling my hair out over this. I have tried it on 2 of my dev servers, and both get the same result. The closest I can get to a served page is an error page "Object reference not set to an instance of an object", however, the page has try/catch blocks that are being ignored, so I dont think its running the code on the controller, I think it's saying that the controller is the error. (For the reference, the error in question is directed at the HomeController.cs file). What I've tried: Wildcard mapping Changing routes to {controller}.mvc Changing routes to {controller}.aspx Adding the .mvc extension to IIS Modifying routes in Global.asax There's a LOT of code in this project so far, so I will only post the first page(s) that should get served: MASTER PAGE: <div class="page"> <div id="header"> <div id="title"> <h1>Meritain RedCard Interface 2.0</h1> </div> <!-- This is the main menu. Each security role will have access to certain buttons. --> <div id="menucontainer"> <% if (Session["UserData"] != null) { %> <% if (/*User Security Checks Out*/) { %> <ul id="menu"> <li><%= Html.ActionLink("Home", "Index", "Home")%></li> <li><%= Html.ActionLink("Selection", "Index", "Select", new { area = "Selector" }, null)%></li> <li><%= Html.ActionLink("Audit", "Index", "Audit", new { area = "Auditor" }, null)%></li> <li><%= Html.ActionLink("Setup", "Index", "Setup", new { area = "Setup" }, null)%></li> <li><%= Html.ActionLink("About", "About", "Home")%></li> </ul> <% } %> <% } %> </div> </div> <div id="main"> <asp:ContentPlaceHolder ID="MainContent" runat="server" /> <div id="footer"> </div> </div> </div> Default.aspx.cs: [I added this file as a potential solution, since it works with MVC 1] protected void Page_Load(object sender, EventArgs e) { string originalPath = Request.Path; HttpContext.Current.RewritePath(Request.ApplicationPath, false); IHttpHandler httpHandler = new MvcHttpHandler(); httpHandler.ProcessRequest(HttpContext.Current); HttpContext.Current.RewritePath(originalPath, false); } HomeController.cs: public ActionResult Index() { loadApplication(); ViewData["Message"] = "Welcome to ASP.NET MVC!"; return View(); } public ActionResult About() { return View(); } private void loadApplication() { Session["UserData"] = CreateUserSecurity(HttpContext.User.Identity.Name.ToString()); } I did not list the CreateUserSecurity method, but all it does it call the DB using the Username and returns the record in the database that matches the username. EDIT: Added code and what I've tried so far (as requested).

    Read the article

  • Navigating back to "Home" from an area (MVC2)

    - by SlackerCoder
    I have a few areas in my application that are relatively independent (all navigated to from the master page). So, as of now, I am simply using the "default" MVC2 template (the one you get when you create a new MVC2 project). So the menu looks like this: HOME AREA1 AREA2 AREA3 AREA4 .... ABOUT Now, when I first load up the page, I am on the "HOME", and I can click on the ABOUT without issue. I can navigate to any of the areas as well, however, once I navigate to an area page, I cannot get back to my home or about pages (404 not found). When I navigate to them, and click on about, the address bar shows .../AreaX/Home/Home instead of Home/Home as I would expect. I expect that is has something to do with my routing, but Im not completely sure. I have added/changed nothing with the default routing (which is probably the issue!). Any thoughts?

    Read the article

  • LINQ to Entity, joining on NOT IN tables

    - by SlackerCoder
    My brain seems to be mush right now! I am using LINQ to Entity, and I need to get some data from one table that does NOT exist in another table. For example: I need the groupID, groupname and groupnumber from TABLE A where they do not exist in TABLE B. The groupID will exist in TABLE B, along with other relevant information. The tables do not have any relationship. In SQL it would be quite simply (there is a more elegant and efficient solution, but I want to paint a picture of what I need) SELECT GroupID, GroupName, GroupNumber, FROM TableA WHERE GroupID NOT IN (SELECT GroupID FROM TableB) Is there an easy/elegant way to do this? Right now I have a bunch of queries hitting the db, then comparing, etc. It's pretty messy. Thanks.

    Read the article

  • MVC2 Json request not actually hitting the controller

    - by SlackerCoder
    I have a JSON request, but it seems that it is not hitting the controller. Here's the jQuery code: $("#ddlAdminLogsSelectLog").change(function() { globalLogSelection = $("#ddlAdminLogsSelectLog").val(); alert(globalLogSelection); $.getJSON("/Administrative/AdminLogsChangeLogSelection", { NewSelection: globalLogSelection }, function(data) { if (data.Message == "Success") { globalCurrentPage = 1; } else if (data.Message == "Error") { //Do Something } }); }); The alert is there to show me if it actually fired the change event, which it does. Heres the method in the controller: public ActionResult AdminLogsChangeLogSelection(String NewSelection) { String sMessage = String.Empty; StringBuilder sbDataReturn = new StringBuilder(); try { if (NewSelection.Equals("Application Log")) { int i = 0; } else if (NewSelection.Equals("Email Log")) { int l = 0; } } catch (Exception e) { //Do Something sMessage = "Error"; } return Json(new { Message = sMessage, DataReturn = sbDataReturn.ToString() }, JsonRequestBehavior.AllowGet); } I have a bunch of Json requests in my application, and it seems to only happen in this area. This is a separate area (I have 6 "areas" in the app, 5 of which work fine with JSON requests). This controller is named "AdministrativeController", if that matters. Does anything jump out anyone as being incorrect or why the request would not pass to the server side?

    Read the article

  • Using hidden values with jQuery (and ASP.NET MVC) -- not working?

    - by SlackerCoder
    Im using a couple of JSON calls to render data, etc etc. In order to keep the proper key value, I am storing it in a tag. I have this in several places in my code, none of which cause an issue like this one is. Here is the jQuery: The call that "sets" the value: $("a[id^='planSetupAddNewPlan']").live('click', function() { var x = $(this).attr('id'); x = x.substring(19); $("#hidPlanSetupCurrentGroupKey").val(x); $.getJSON("/GroupSetup/PlanSetupAddNewList", { GroupKey: x }, function(data) { $("#planSetupAddNew").html('' + data.TableResult + ''); alert('First Inside 2 ' + x); $.blockUI({ message: $("#planSetupAddNew") }); }); }); The call that "gets" the value: $("#ddlPlanSetupAddNewProduct").live('change', function() { var a = $("#hidPlanSetupCurrentGroupKey").val(); var prod = $(this).val(); alert(a); $.getJSON("/GroupSetup/PlanSetupChangePlanList", { GroupKey: a, Product: prod }, function(data) { if (data.Message == "Success") { $("#planSetupAddNewPlan").html('' + data.TableResult + ''); } else if (data.Message == "Error") { //Do something } }); }); Here is the html in question: <div id="planSetupAddNew" style="display:none; cursor: default;"> <input type="hidden" id="hidPlanSetupCurrentGroupKey" /> <div id="planSetupAddNewData"> </div> </div> In the first section, the alert ('First Inside 2 ' + x) returns what I expect (where x = the key value), and if I add a line to display the contents of the hidden field, that works as well: ie. var key = $("#hidPlanSetupCurrentGroupKey").val(); alert(key); In the "alert(a);" call, I am getting "undefined". I have looked at the other code in the same view and it is the same and it works. I must be missing something, or have some sort of mistype that I havent caught. Just an overview of the controller events: The first call (/GroupSetup/PlanSetupAddNewList) will return an html string building a "form" for users to enter information into. The second call (/GroupSetup/PlanSetupChangePlanList) just changes a second dropdown based on the first dropdown selection (overwriting the html in the div). If you need more info, let me know! Any thoughts/tips/pointers/suggestions?!?! Thanks for all your help :)

    Read the article

1