asp.net-mvc-2

Stack Trace : at System.Web.HttpServerUtility.ExecuteInternal() || Error executing child request for handler in MVC 2.0

混江龙づ霸主 提交于 2021-01-27 05:54:00
问题 While Deploying my MVC 2.0 project in to server I'm getting this following error.Locally everything is fine.I want to figure out this error. We have used HttpWebRequest for this functionality. For entire site Glossary search we have created this Control library.Locally the searching is happening but in server empty page is displayed while searching.My file exception show the following error hint. can any one help me pls to figure out this exception.? Date Time : 12/28/2012 11:19:28 AM

Red border around TextBox when validation fails

萝らか妹 提交于 2021-01-22 04:49:48
问题 I am using ASP.NET MVC 2. Html.DropDownListFor and Html.TextAreaFor automatically get red borders when the validation fails. How to make the four borders of a TextBox (using Html.TextBoxFor) red when it fails validation? For example, I have a TextBox that is required and when the user submits the form without specifying a value in the textbox, I want the textbox to have red borders. 回答1: When validation fails for a model property - it'll add a class to the input in the html. Have a look at

Unauthenticated users cannot access static files in ASP.NET MVC regardless of location elements

给你一囗甜甜゛ 提交于 2020-08-27 08:13:08
问题 I know this question has been asked several times on SO, but none of those answers have worked in my situation. I have an ASP.NET MVC2 app that uses Forms authentication on my local IIS 7.5(7600.16385) on an AppPool running in integrated mode. Interestingly, this does not happen when using the development web server that comes with VS 2010. My web.config file contains no <authorization /> and no <location /> elements. When I hit the home page, I get everything in the logon view except for the

Generating Data Annotations from Generated Classes

蓝咒 提交于 2020-03-16 07:35:08
问题 I have a linq to sql object or if neccessary Entity Framework object. I want to do MVC 2 Data Annotations for them, but I am endlessly lazy. Is there a way to automatically generate the data annotations a-la [Bind(Include = "Title,Description,EventDate,Address,Country,ContactPhone,Latitude,Longitude")] [MetadataType(typeof(Dinner_Validation))] public partial class Dinner { public bool IsHostedBy(string userName) { return HostedBy.Equals(userName, StringComparison.InvariantCultureIgnoreCase);

Generating Data Annotations from Generated Classes

◇◆丶佛笑我妖孽 提交于 2020-03-16 07:34:51
问题 I have a linq to sql object or if neccessary Entity Framework object. I want to do MVC 2 Data Annotations for them, but I am endlessly lazy. Is there a way to automatically generate the data annotations a-la [Bind(Include = "Title,Description,EventDate,Address,Country,ContactPhone,Latitude,Longitude")] [MetadataType(typeof(Dinner_Validation))] public partial class Dinner { public bool IsHostedBy(string userName) { return HostedBy.Equals(userName, StringComparison.InvariantCultureIgnoreCase);

Generating Data Annotations from Generated Classes

你说的曾经没有我的故事 提交于 2020-03-16 07:34:05
问题 I have a linq to sql object or if neccessary Entity Framework object. I want to do MVC 2 Data Annotations for them, but I am endlessly lazy. Is there a way to automatically generate the data annotations a-la [Bind(Include = "Title,Description,EventDate,Address,Country,ContactPhone,Latitude,Longitude")] [MetadataType(typeof(Dinner_Validation))] public partial class Dinner { public bool IsHostedBy(string userName) { return HostedBy.Equals(userName, StringComparison.InvariantCultureIgnoreCase);

Routing and GetVirtualPath problem

柔情痞子 提交于 2020-03-05 07:56:19
问题 I'm using MVC 2 Preview2, with two areas in a single project. When I use RouteTable.Routes.GetVirtualPath(this.viewContext.RequestContext, null) from inside an area, I got the virtual path to the first area instead. Except for this, areas are working pretty well. What can I doing wrong? 回答1: in MVC 2 use GetVirtualPathForArea instead of GetVirtualPath 来源: https://stackoverflow.com/questions/1627423/routing-and-getvirtualpath-problem

How can I view a PowerPoint in an ASP.NET application?

谁都会走 提交于 2020-02-08 08:32:09
问题 Does anyone have a PowerPoint viewer which I can embed in an ASP.NET Web App? 回答1: If you are using Silverlight you can use http://pptx2silverlight.codeplex.com/ 回答2: You can't directly embed a PPT/presentation to view. Instead you can try any converter that allows you to embed the PPT slide as images or some other format that the client browser can render to the user. There are few products like GroupDocs viewer or Doconut viewer that do this. You can give it a try. 回答3: You will have to

How can I view a PowerPoint in an ASP.NET application?

社会主义新天地 提交于 2020-02-08 08:32:01
问题 Does anyone have a PowerPoint viewer which I can embed in an ASP.NET Web App? 回答1: If you are using Silverlight you can use http://pptx2silverlight.codeplex.com/ 回答2: You can't directly embed a PPT/presentation to view. Instead you can try any converter that allows you to embed the PPT slide as images or some other format that the client browser can render to the user. There are few products like GroupDocs viewer or Doconut viewer that do this. You can give it a try. 回答3: You will have to

How do I go about Authorization in MVC 2?

强颜欢笑 提交于 2020-02-08 07:38:00
问题 How do I go about Authorization in MVC 2? I want to use AD groups/roles rather than the default that is provided. That seems to be "AspNetSqlMembershipProvider". Anyway I put : [Authorize(Users = "username")] public ActionResult About() { ViewData["Welcome"] = "Welcome About"; return View(); } And then loading the page gives me: The connection name 'ApplicationServices' was not found in the applications configuration or the connection string is empty. Line 34: <providers> Line 35: <clear />