asp.net-mvc

Logout from MVC

Hi, I have a MVC application and I have to logout. To logout from the application I have created a link on te master page [ <a id="A2" name="lnkLogout" href="http://localhost:1234/Home/LogOut" >Logout</a> ] and created the LoutOut action in the controller page public ActionResult LogOut() { Session.Clear(); ...

different ActionInvoker based on actions assigned in global.asax

how would i go about finding out what action was defined for this function protected override void ProcessRequest(HttpContextBase httpContext) { IController Controller = new CatalogController(); (Controller as Controller).ActionInvoker = new MyActionInvoker(); Controller.Execute(RequestContext); } a...

ASP.NET MVC routing based on data store values

How would you tackle this problem: I have data in my data store. Each item has information about: URL = an arbitrary number of first route segments that will be used with requests some item type = display will be related to this type (read on) title = used for example in navigation around my application etc. Since each item can ha...

What's the ideal method for redirecting to a new url from inside of a View?

So inside my ASP.NET MVC View I have a conditional statement to redirect users to a different page. What is the best way to do this? What is the Controller.RedirectToAction() equivalent for a View? ...

Blocking access to site by banned IP addresses

I have a list of IP addresses of bots/hackers that are constantly attacking one of my sites. I want to block these visitors by IP and am trying to work out a "best" approach for this. My site uses C# ASP.NET MVC. I have a List<int> of IP's. Where is the best place to put the check code? I'm thinking of using the Page_Load event of a ma...

How to create ValueProvider for MVC

I want to create a Valueprovider in ASP.Net.MVC 2 Beta. My Value source would be a JSON ...

Hide iFrames Using the Controller

Hi, I have tried finding the answer to this and come across several things which have not yielded the desired result. So I wrote a HTML Helper that loads in an (fancybox) iFrame: <%= Html.ActionFrame("Projects", "Edit") %> The resulting page has a save button which currently saves the data and redirects to the Index page within the iFr...

how to get controller result in javascript

Hey All, context: onSuccess javascript method after an ajax post How do I obtain my id in javascript that is sent from my controller's ActionResult? On the controller I've tried 2 flavors Content Result and JSON Result and both of those show up as [object] in my alert(). Thanks, rodchar ...

How do I to check if a entity is in a many-to-many relationship.

I have a 'user' table, a 'phone number' table and a 'user to phone number map' table. The phone number table stores only unique phone numbers. This way I can take a look at a phone number and see who is using it easily. It is also easy to check if a phone number exists when the user is edited. The question is how I should be checkin...

How to clean data from web forms in asp.net mvc?

I have an asp.net mvc app and users are cutting and pasting data into textarea fields. We are getting some characters in there that my IBM U2 database does not like. How can I strip all of these out of the textarea before sending them to my database. The problems yesterday were with the en dash and em dash. Today I'm having a probl...

Have a webservice and website in the same web root?

Hi I have an asp.net mvc site and a asp.net web service. I am wondering if it is possible to have them in the same root(wwwroot) folder? Like could I have wwwroot -> all mvc files wwwroot -> webservice folder -> webservice files Would this work? I don't want them all mixed together and I am sure having 2 web configs in the same roo...

Two jQuery 'identical' autocomplete textboxes but only one works

I have two jQuery autocomplete textboxes on a mvc web page. One that returns a list of questions and another that returns a list of tags. The questions textbox works perfectly but the tags text box only sends a null string to its controller. The jQuery javascript is an exact match apart from the Url.Action, the non working one is displ...

GoDaddy.com shared hosting with NHibernate and MVC 1.0

I'm getting the following error after a migration to shared hosting on godaddy.com [SecurityException: Request failed.] System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed...

Developers or software experts who use or who developed asp.net mvc

As I am new to asp.net mvc I would like to get the list of developers or software experts who use or developed asp.net mvc ... It would be very useful for budding developers like me to know about their articles and ideas towards devlopement... I know a few Scott Guthrie Stephen Walther I want some more authors and their blogs becau...

jQuery UI dialog and ASP.NET Ajax Library hover conflict

I get an error when using a jQuery UI dialog with the ASP.NET Ajax Library beta 0911 in an MVC app. To reproduce it create a new MVC app and change the head to the following: <head runat="server"> <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title> <link href="../../Content/Site.css" rel="stylesheet" type="text/cs...

ASP MVC DropDownList error "Converting to Type"

Hey, I have a table with 2 fields of type int which are "StatusID" and "TypeID". TypeID works correctly but StatusID returns an error. Here's what my controller looks like: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Project project) { var db = new DB(); if (ModelState.IsValid) { try { ...

How do I Generate Divs in ASP.NET MVC?

So I'm just getting started on a simple blog like application written in ASP.NET MVC. Basically I have my CSS made and I'm using jquery for some effects but I'd like to do something like a for each loop to display all the data in my posts array seperated into their own little sections. The CSS already has the style for the divs so its ju...

What is the steps to add Open Search Feature to an existing ASP.NET MVC Website?

I notices when i go to some sites (include Stackoverflow) by Firefox a little blue circle shows I can add the site to my Search providers . so wanted to know how can add this feature to my MVC project . I Heared an XML file should be added ... ...

asp.net mvc serving txt gets truncated

Hello, I'm trying to serve a txt file made from the database using an action. The action is the following: public ActionResult ATxt() { var articulos = _articulosService.ObteTotsArticles(); return File(CatalegATxt.ATxt(articulos), "text/plain"); } and the CatalegATxt class is: using System; using System.Collections.Generic; u...

ASP.NET MVC User authentication - why it should be so sophisticated?

Hello guys, I'm trying to use ASP.NET MVC to my new project and have been expected that the user authentication should be rather simple there. My goal is to have a separate user database table in my main database. I thought that the SqlTableProfileProvider should be the solution. So I added the corresponding table into my database and ...