asp.net-mvc

asp.net MVC 3 no default page

Has anyone tried to deploy an asp.net mvc 3 website that uses the razor templates? The project does not create a default page and not sure if this changes in some way? ...

Why does Visual Studio 1-Click Publish rewrite file permissions?

I have an ASP.NET MVC 2 site running under IIS7. The app has its own .NET 4.0 App Pool running under a specific user account, and that account has "Full Control" permissions on the root folder and all sub-folders of the site in question, because we do funky things with file I/O, and it is required. After setting up 1-Click Publish succ...

How do I get the site root to return the correct page w/ ASP.NET MVC + WebForms + ISS 6 Wildcard mapping?

Currently, I'm converting a web application from web forms to ASP.NET MVC. The project has been converted and IIS 6 is setup w/ wildcard mapping. I also have made one MVC view/controller that works just fine. There is one problem though. When accessing the the site root, the routing engine kicks in and redirects the user to the default c...

ASP.NET MVC - How to Create a RESTful Controller Scheme?

Hi Guys, If this is a duplicate, please let me know - because i had a quick look and couldn't find anything that really answers my question. I'm experimenting with ASP.NET MVC 2. Now coming from a Web Forms background, i only really dealt with HTTP GET and HTTP POST. I'm trying to see how i could apply GET/PUT/POST/DELETE to the respe...

What are security issues in asp.net mvc?!

What are security issues in asp.net mvc?! and does MVC solved XSS and the others?! ...

ASP.NET MVC2 partial view form via jQuery show() - best way to display validation errors (P-R-G pattern)

So, the partial view is a form, that is revealed via a jQuery show(). The form is submitted, and suppose a unique index is violated, for example, using the Post-Redirect-Get pattern I pass the errors via TempData back to the original view, which contains the partial view that is of course hidden again. Therefore the form's errors/hints...

ASP.Net MVC TempData - how to keep state

We are using ASP.Net MVC TempData to store form data between page refreshes. We have a button on the page that allows the user to perform a certain action. If the user clicks this button one time, it works fine. If they click the button twice, which is allowed, we lose the TempData data. We need to make sure the TempData data is pres...

how can i use solr search in mvc.net 2.0

i am working on mvc.net2.0,sql server2005 and i want to implement solr search on it so please tell me that how can i implement it ...

ASP.NET MVC debugging

I have trouble debugging ASP.NET MVC (1 & 2) in VS2008. Most often stepinto and stepover is just like hitting run. This also happens even if there is a breakpoint in the code on the next line. I've experienced this problem all along using MVC and others working in my team experience it as well. Does anyone else have this problem? Is th...

Hide content in master page from view page

I have a master page which is shared between about 20 views. In just one view, I need to make one small adjustment to the master page (I need to hide a textbox). How can I include css or javascript in my view to acheive this? Or is there some clever trick like including a conditional <% if (View.Name = "blah") { ... } %> that I can sti...

Compile views with enabling MvcBuildViews into MVC 2 Portable Area

I have a big .net mvc 2 project where we are using MvcContrib Portable Area. There is a main web site which load many modules (PA modules). The main application contains Site.Mater into its ~\Views\Shared folder. each module also has own Site.Master which inherit from that main one. At the moment we are using something like: <%@ Maste...

How do I set up a WCF service and MVC site to share the same SSL certificate?

Hello, I have two projects, one is a WCF service, the other is an ASP.NET MVC site. The service is to be exposed to multiple consumers, including my MVC site. Both the site and the service require access over SSL. I only have one SSL certificate I can use. Any ideas how I can set these two projects up in IIS? Thanks in advance. ...

How to get Json Data from IPinfodb.com with MVC WebService/Method

Hi I want to get User's Location based on IP. When user enters website I used to do it with XMLHTTPREquest in classic asp how to do it with .net MVC. I am new to .net ...

In MVC, When the view initially loads, I do not get the error. Only after post back , it is giving "There is no ViewData item with the key ..."

In MVC, When the view initially loads, I do not get the error. Only after post back , it is giving "There is no ViewData item with the key ..." ...

How do attributes work in MVC2

I'm trying to work out exactly what role the attributes play when used on model properties. For example, If I have a Customer model with a display name attribute set on one of the properties, then I can access the display name attribute value within a display template for whatever reason. public class Customer { [DisplayName("...

Data from UI to Controller in ASP.NET MVC

Hi, Could you you tell me the best way to get data from UI to send them to the controller. What do you think a bout the code below ? Is there an another solution without all this javascript/jquery/ajax code ? Thanks, function CustomerAddSave() { $('#btSave').bind('click', function (event) { $.ajax({ type: "POST...

Trouble with HandleError

I have the following Action Method: [HandleFtmsError] public ActionResult PerformanceChart(ChartViewModel chart) { var x = 1; var y = 0; var z = x/y; return Json(""); } where HaneleFtmsError is defined as: public class HandleFtmsErrorAttribute : System.Web.Mvc.HandleErrorAttribute { ...

ASP.NET MVC Model contents disappears randomly.

Update following initial comments The model has an object in it called 'Account', of which there is an int propety (Account.AccountID) ViewB has a form which collects some additional information - but also has a textbox which is populated with Model.Account.AccountID. When I submit ViewB however, Model.Account becomes null. Its pro...

Refresh several partial view ...

Hello, Is there a way to refresh several partial view from the controller ? (return View()) Thanks, Update1: Example, the content pârt of my screen is divided in 2 parts, on the left a customer list on the right the details customer, the details of the customers selected in the list of the left. If I create an new customer, when I sav...

Is it a good pratice to make an extension method that never use the extended object?

In our ASP.NET MVC project, we have an HtmlHelper extension method to generate a static google map. public static MvcHtmlString StaticMap(this HtmlHelper helper, string address, string alt, int width, int height, int zoom) { var src = new Uri("http://maps.google.com/maps/api/staticmap?markers=size:mid|color:red|{0}&amp;zoom={1}&amp;...