mvc

Views with Multiple Admin-ish Roles

I have an app where there are multiple "Admin-ish" roles. Imagine you have a super-admin that can edit anything, and also a site-admin that can edit any information about his site. So both admin/sites and siteadmin/sites are basically the exact same view. What's the right way to set this up (views/controllers)? I'm trying to keep thing...

How to Use Modal Pop-Ups with ASP.Net MVC and AJAX?

Hi Can anyone point me in the direction of how to use jQuery modal popups with AS.Net MVC and AJAX. Has anyone managed to do this well? I've tried JQModal and JQuery UI but haven't managed to find any good samples or tutorials yet. Any help appreciated. Thanks ...

How to send a Model in jquery $.ajax () post request (asp.net MVC)

In doing an autorefresh by putting the following code,i assumed that when i do a post the model will automatically sent to the controller , $.ajax({ url: '<%=Url.Action("ModelPage")%>', type: "POST", //data: ?????? success: function(result) { ...

java inserting date into database

hi, can someone please tell me the elegant way of inserting a java date instance into database? presently, i am using IBATIS with Spring MVC . i have defined a java.util.date property in the command bean and property editor in the controller for Date conversion, however i am unable to insert java.util.date property in DB . should i c...

when will the thread in asp.net be terminated ?

I have a asp.net program, and I need to send a lot of emails. when i call http://localhost:70/sendemails system will send the emails one by one in seperated threads(just like async). I don't know if this is the best method. but what i want to know is: I schedule to send 10000 emails, and after i call the link, and then close the browser(...

ASP.NET MVC check role for user other then current

I have scenario: There is an employee which is in role TeamDirector. There is another one which is normal employee. Team Director is sick so he use our app to set that normal employee has all rights of TeamDirector. This information is stored in DB. In our app I use Authorize att to check access to particular controller methods. I wrote...

Pass IEnumerable List to javascript

I was wondering if I could pass a IEnumerable Collection into a Javascript method on the page load. So something like this... <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyAppMVC.Models.ViewModels.News.NewsIndexViewData>" %> <div id="container"> <%= String.Format("<script type='text/javascript'>testMethod({0...

ASP.NET MVC - pull and populate masterpage contents from database?

Hello all, how can I pull masterpage content from the database and pass that into the masterpage so that my Views inherits from it? This is an example: Clients to the website will have a unique code, lets call it "TargetCode", for example, ABC123, ABC456, etc... This unique code will be entered in the querystring, for example: mysite.co...

User.Identity.Name returning empty string.

Hello guys, User.Identity.Name returning empty string in Firefox. In IE it's working fine. I have an ajax call to controller and used the Identity to fetched data from DB. Problem is it will always return an empty string in Firefox. I already assigned cookie name in my webconfig under . Your reply is greatly appreciated Very Best, ...

MVC JQuery: Retreving values from HTML controls

Hi there, i have some controls on my view like so: " ><%=Html.TextBox("Name")%> " ><%=Html.DropDownList("Intensities")%> How can i retreive the values of these controls with JQuery? Something like: var name = $("#name" + id).val(); alert(name); ...

MVC pattern in JAVA

What are the advantages and disadvantages in MVC patterns when it's using in Java? ...

Redirect POST data

Hello, Short version: how can we send post data while redirecting to an "external" website? I'm using asp.net MVC and I want to redirect the user to oldwebsite.com/oldlogin.asp when a username is not found, to try to log in the old system. Long version: Scenario: We have a site oldwebsite.com with a login form on the index.html. Th...

asp.net mvc routes over https ssl

I have a website that uses Routes to do some URL rewriting. Note, I am not using MVC..just the Routes that make MVC famous :P Anyways the site works completely well...and all is well I enabled SSL on the entire site and accessing the site in https, I can get static files..I can access the aspx files directly...but the Routes no longer ...

Problem with asp.net mvc and google maps

I'm just getting into asp.net mvc and jquery so this might be a "stupid" question. I'm developing an mvc application which contains a Google Map. I've used this blog post as an inspiration http://mikehadlow.blogspot.com/2008/10/using-google-maps-with-mvc-framework.html and it's working as expected. The problem occurs when I want to...

Dynamic jQuery asp.net mvc messy code, how to refactor more cleanly

I'm building a very interactive site with lots of ajax type functions. I'm starting to end up with a fair amount of message Jquery code, all nestled in together with my bee sting tags. For example <% foreach (var group in Model.GroupBy(item => item.goalId)) { %> //$('#AddNew2<%= Html.Encode(group.Key) %>').html('<input type="text" nam...

ASP.NET MVC Finding out the caller to a method when !ModelState.IsValid

I have action method on my "CartController" an AddtoCart that returns an ActionResult. The problem I'm having is that I post from antoher controller to the AddtoCart the Id of the product i want to add, then move on. I have no problem with the validation; however, it's when I want to redirect to the View that called the Action when th...

How do I get parameter from URL or hidden field

In a Struts Action, I want to get a parameter from the URL or from a hidden field, when the parameter in the URL is not set. To retrieve the parameter from the URL is as follows: String userId = request.getParameter("userId"); But the problem is now, the HTML is based on forms (legacy code). And I observerd that the parameter userId m...

Master-Detail View ASP.NET MVC

Hello Everybody, I'm new to MVC and I'm involved in a project that is developed with ASP.NET MVC 1.0. I'm also weak in JavaScript :-( I'm trying to demonstrate how Master-Details view work on 'Orders' & 'Order Details' tables from Northwind database. (Hence: the tables has a relation, i.e., an order can have multiple order details) I ...

Upgrading / Patching .Net Mvc

What is the best way to upgrade / patch a .Net MVC application. Ideally from a single file as most installations of the application will be very basic computer users. So asking them to stop IIS, copy files, run sql scripts etc is not possible. Two possible approaches would be Executable which locates the site on the machine and copi...

Can I have more than one "Details" ActionResult in a controller?

I have a Controller called TicketsController.vb, with an action result of: ' ' GET: /Tickets/Details/5 Public Function Details(ByVal id As Integer) As ActionResult ViewData("OpenTixCount") = ticketRepository.countOpenTickets.Count() ViewData("UrgentTixCount") = ticketRepository.countUrgentTickets.Count() ViewData("HighTixCou...