asp.net-mvc-2

showing context menu in contentEditable div

I have a contentEditable div with following text for example: <div contentEditable='true'> This document is classified</div> Now for example if user clicks on 'm' in word document I want to show a context menu containing few text choices. That context menu will be contained in a div element. I want to replace the word "document" with ...

How does forms auth work with ASP.Net MVC2

I am having a hard time to get Forms Auth integrated in my MVC2 site. I googled and searched and tried different things, read msdn docs, but nowhere a decent tutorial on how to do it the MVC way. I have an application, and I set up users and roles with the wizard. And I made a controller with a logon action with a LoginControl. Now what...

where to check if user is login and how to prevent not login users to enter to the admin section

i have route all admin controllers to "admin folder", but i want to check if the user is login and if not to give him login view. for the not login user i want to let him enter just the "website" controller where i need to check it? public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("elmah.axd")...

Autofac - Register plugins by type

Hi all, I'm writing a plugin system: every plugin is in his own assembly that must be loaded by autofac and is signed by an attribute with a parameter that set the type of plugin. I would be able to resolve in my asp.net mvc app the plugins by type, how can I do this? Every plugin inhrerit by an abstract class and override predefinited m...

Gridview in asp.net mvc2

I need to use ASP.Net gridview and do operations like sorting paging and selecting checkboxes in my asp.net mvc content view. I dont what to do. I've written something like this: <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate>...

ASP.NET MVC Model vs ViewModel

OK, I have been hearing discussion about "ViewModels" in regards to MS's ASP.NET MVC. Now, that is intended to be a specific kind of Model, correct? Not a specific kind of View. To my understanding, it's a kind of Model that has a specific purpose of interacting with the View? Or something like that? Some clarification would be appr...

Java script access ASP.net MVC ViewData

Hi, I am quite new in ASP.net MVC model and having a bit problem here (absolutely newbie). My problem is i cannot access the ViewData via client-side java script to render a table using the data from my server side. I having a main menu at the top consist of several link button, after the user click on it, it will change the sub menu ...

ASP.Net MVC 2 authentication (login) best practices

Hi guys, I am developing an ASP.Net MVC 2 application as a composite application in SalesForce.com. For those not familiar with SalesForce.com it is a CRM platform on the internet. What the composite application is it simply is shown inside an iframe in a separate tab. So when the user logs in to salesforce.com that user sees a bunch of ...

Need some advise on starting a New Life with MVC 2 and which Tools to use for RAD in MVC2 ?

Dear All I have finally decided to hop up on the train of MVC 2. Now i have doing alot of reading lately and following is the architecture, which i think will be good enough for most of Business Web Application. Layered Architecture:- Model (layer which communicates with Database). EF4 Repository (Layer which communicates with Model a...

How do I create Extension Methods for string type in Asp.net MVC 2 ?

Hi I'm trying to reach this goal but as far as I am, I've got nothing. I wish to add some static method to string type, which would return new changed string. I've got: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Security.Cryptography; using System.Text; namespace TestProject.Models...

How to save multiple entry for one entity in the same batch . Entity - Relation(One to Many) concept is use in my example.

Here is a common scenario I Have these Entity User UserId UserName ... UserQuestion UserQID UserID UserQuestion UserAnswer When the user first logon, he need to create 3 customs Answer / question. How can I Create these 3 questions relation and save it to database. I Want these questiona in relation with the specific user. ...

ASP.NET MVC2 global authentification

Hey there. I'm new to ASP.NET MVC 2 and i ran into a simple problem. The thing is that I want to force user to login to view my website. That means when user requests something like Home.Index or any other Controller.Action, i should check if user is logged in and if not, redirect request to Auth.LogIn. I could check for authorization...