.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to make the validation Errors as Compilation Errors

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Windows Application


As part of our Custom Activities, we are adding few validation errors to the Metadata.These errors are appearing in design time under Error List; but still we are able to build the project successfully.

Our requirement is that, if there is any validation error, it should throw compilation error.

Looking for some good suggetions to implement this behaviour.



Assistant Consultant

View Complete Post

More Related Resource Links

Validation errors and getting the site disability accessibile


I'm using the official validator from the World Wide Web Consortium, http://validator.w3.org/

And I'm seeing a lot of validation errors. What can be done to make my sharepoint publishing site a little more accessibility friendly?


Why does Model Validation Errors steal my markup?



I have a partial view where I render, if the user has choosen an option, a button that permit the user to generate automatically a value for a certain field. Please give a look at this picture to understand what I mean.

This is achieved using the following markup on the partial view

<%= Html.LabelFor( model => model.IssueCode )%>
<br />
<% if ( Model.HasCodeGenerator ) { %>
    <%= Html.TextBoxFor( model => model.IssueCode, new { style = "width:120px;background-color:#eeeeee;border: solid 2px #dfdfdf", @readonly = "readonly" } )%>
    <% if (Model.ModelState == ModelStateEnum.Add) { %>
        <button id="codeGenerator" style="font-size: 0.7em;margin-right: 10px">Genera codice fascicolo</button>
    <% } %>
<% } else { %>
    <%= Html.TextBoxFor(model => model.IssueCode, new { style="width: 120px" })%>
<% } %>
<%= Html.ValidationMessageFor(model => model.IssueCode, "*")%>

As you can see I append always an Html.ValidationMessageFor() at the end of the input field and a ValidationSummary aut the end of the view.

When the user submits the form the fi

Compilation Errors after upgrading to .Net 4


So after installing VS 2010 and .net 4 some time ago, I've been trying to upgrade web projects. Running in VS 2010 is not a problem, but when I publish to IIS 7, I keep getting compilation errors. To make things as simple as possible, I created a new Asp.Net  Web Application project. I didn't change anything, just left the default project. The project runs fine from VS 2010.

Next, I publish the project to IIS using the File System publish method. This worked fine when my projects were .net 2, but using .net 4 projects, I always get errors like:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC31007: Unable to open module file 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\web4\b2ae83a4\d2ec1e47\App_global.asax.r1psnh9h.0.vb': System Error &Hc0000005& (Visual Basic internal compiler error)

Source Error:

[No relevant source lines]

Source File: C:\Windows\Mi

Detecting cell validation errors from a DataGrid

Is there a way, from the DataGrid, to work out if any of it's rows have a validation error? I know you can use the Validation.HasError property at the level of an individual cell, but it seems that information doesn't filter back up to the DataGrid so you can test a simple property on the DataGrid to see if there are any errors (i.e. if you get Validation.HasError at the DataGrid level, it's always false regardless of whether or not there are any errors).

Client Side Validation - suppressing specific property errors


Hi there,

I have implemented some Client Side Validation in MVC via <%Html.EnableClientValidation(); %> I am using Metadata Descriptions an EF and it's working fine but one thing is driving me crazy!!

I have a Price field that is a number (double) and I have some metadata errors for it for range and required but MVC is adding in this validation "The field Price must be a number." which would be fine except!! when I type 20.     (note the decimal point) this validation fails with a popup "The field Price must be a number." then when I type another number e.g. 20.0 it goes away again.

Is there some way to ignore/suppress non custom property validation errors??



Suppressing Workflow Activity Validation Errors


I would need to suppress the validation errors for the workflow activities.

Basically I'm creating a custom activity which composes couple of workflow activities. When I drag drop my custom activity in Rehosted designer it is showing all the validation errors of workflow activities which needs to be suppressed.

How to suppress validation errors ?

Client-Side validation errors but I don't know what they are?





I am using the jquery unobstrusive client-side validation for my "Create" form, and it is returning errors but I don't know what they are.


I put a ValidationMessage helper on each control on my Create, but the POST is getting canceled and I don't know why.  ValidationSummary is not filled out so I don't know how to troubleshoot the issue.

How do I go about troubleshooting it?


How can I be sure that my entire project is up-to-date and free of errors in VS2010?


Seems like a stupid question, but I will go to Build > Build Solution many many times and the build will succeed many many times, then I will put in a minor syntax error and the build will fail, BUT the build will not fail because of the minor syntax error; it will fail because of an unresolved type that I put in about twenty compiles ago. And then I will fix the minor syntax eror, and the compiler will still complain about the unresolved type. Here is my code:

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
  <form runat="server">
  Hello World!!  

Pretty simple, really. I go to Buld > Build WebApplication1 and it runs OK. Now, if I put in a minor syntax error, such as substitute "forrrrrrrm" for "form" and then try to Build Solution, it complains not about the misspelled word, but about the FreeTextBox. And then if I correct the misspelled wird, it still complains about the FreeTextBox. Which leads me to believe that Building the Solution does not check absolutely 100% everything that needs to be checked. Is there a more thorough way of compiling a program that I need to use?

Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

Toolbox: Logging Web App Errors, Learning LINQ, and More


See how to log Web application errors for better health monitoring, what to read if you're thinking about LINQ, and which blog Scott recommends reading this month.

Scott Mitchell

MSDN Magazine April 2008

Enterprise Library: Take Exception To Critical Errors With Custom Application Blocks


Enterprise Library is a collection of application functionality blocks that you can re-use in your application for common functionality you'd otherwise have to write again and again. Here Jay Hilyard explains how to use them.

Jay Hilyard

MSDN Magazine September 2006

Toolbox: Synchronize Data, Review Runtime Errors, and More


This month we bring you products that let you synchronize data, correct runtime errors, and more.

Scott Mitchell

MSDN Magazine August 2006

ASP.NET MVC3 Areas and Razor views produce errors?


The view at '~/Areas/SomeArea/Views/List/Index.cshtml' must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl.

The project structure is pretty much default. There is one area called SomeArea. It has a single controller called List. It does nothing except:

public ActionResult Index()
    return View("~/Areas/SomeArea/Views/List/Index.cshtml");

The view looks like:

@inherits System.Web.Mvc.WebViewPage<dynamic>
    View.Title = "Index";
    LayoutPage = "~/Views/Shared/_Layout.cshtml";


I have tried emptying the entire file part by part and nothing seems to help. If I create a controller and view outside the area it works just fine. If I create an aspx view it works fine as well. Is it possible the default razor view engine doesn't support areas at this time?

The areas are registered too.

public static void RegisterRoutes(RouteCollection routes)
        "Default", // Route name
        "{controller}/{action}/{id}", // URL with parameters

Think that there is actually errors in ajax toolkit for 2.0 framework...hmm


Im using VS2008, asp.net C# 2.0.


Recently i tryed to correct some stuff on my page and i had a friend to take a look at the stuff...


What i did was that i have Examples page with code examples. Then accordion panes for each code piece...And syntaxhighlighter for each code piece. The code that i presented is read from the txt files wich makes it easyer for me to put new examples on the site...

But the problem is now that two of my accordion panes are not working...and everything works in all other browsers this just happens in Internet Explorer. This is kind of weird and my friends explaination was that there is actually errors in the ajax toolkit dll.


Im using the latest version of ajax toolkit for framework 2.0 wich is 1.0.20229.

My friend said its actually amazing that the toolkit has been out there for that long and it has not been tested that well and that there i still errors in it.


You can test this by your self by doing the exact as i explain:


go here: http://www.simpa.dk/Examples.aspx?cookieCheck=true

click Csharp

and try to open the accordion that is from the bottom 2 or 1 they dont collapse...

but this works in all other browsers then Internet Explore

Reporting Services in SharePoint integration - configurtion errors in 64bit version



We have build an MOSS 2007 environment on 64 bit servers. We build the reporting services server and configured in SharePoint integration mode. Initially configuration looks fine with reporting services integration with green indicators.


After creating a web application and accessing the web site from the report servor, i have found the following errors:


Server Error in '/' Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'RSSharePointSoapProxy, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot fi

Moss 2007 Document check out and check in errors


Users are receiving errors when trying to check in documents.


"The Web server is busy. Try again later."


"This document was checked out to your local drafts folder but the local copy could not be checked in to the site. Close any application that is editing the document and try to check in again, or discard the checkout."


"There is a problem with the Web server. Try again later, or contact the server administrator."

Workstation has office 2007, upgraded from 2003. Documents are being checked out, edited, and checked in properly. Any help appreciated. Thanks.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend