asp.net-mvc-3,error-handlingRelated issues-Collection of common programming errors


  • Davide.77
    asp.net-mvc-3 pdf fonts itextsharp font-face
    I’m not able to find a reason why my MVC 3 web site shows arabic font correctly and my pdf not.I use a bliss font in my web site;@font-face { font-family: ‘blissregular’; src: url(‘/Fonts/blissregular-webfont.eot’); src: url(‘/Fonts/blissregular-webfont.eot?#iefix’) format(’embedded-opentype’),url(‘/Fonts/blissregular-webfont.ttf’) format(‘truetype’); font-weight: normal; font-style: normal;}All working fine. After that I want to create the pdf of the output but arabic fonts does not appears.I’v

  • Jim
    asp.net asp.net-mvc asp.net-mvc-3 asynchronous
    I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file from network). What we want to do is:User clicks a button to post the form to trigger the process Application starts a new thread to start copying the file Application shows a message saying the file-copying process has begun User can close the browser while the copying processed and finished in the background.The idea is that the user doesn’t need any confirmation on the progress of the process, nor be

  • Kirk
    inversion-of-control asp.net-mvc-3
    We have recently upgraded a project to MVC 3 Tools and discovered that our inversion of control container is causing problems with the native MVC model binding validation on both client- and server-side. When we have the IoC hooked up the client validation fails to fire at all and the “IsValid” test in the controller fires erratically and passes along data when it should not. The only way we’ve been able to correct the validation framework is to disable the IoC completely. We were using Ninject

  • Cameron
    jquery asp.net-mvc-3
    I have the following JS:$(‘form’).live(‘submit’, function (event) {// Stop the form from doing a native postbackevent.preventDefault();$.ajax({type: ‘POST’,timeout: 5000,url: $(this).attr(‘action’),data: $(‘form’).serialize(),success: function (responseHtml) {$.getJSON($(this).attr(‘action’), function (data) {console.log(data);});},error: function (jqXHR, textStatus, errorThrown) {alert(‘server error’);}});});Which should log the json from the following mvc method on fail (note this is a login f

  • CD Smith
    vb.net asp.net-mvc-3 linq-to-sql .net-4.0
    I’ve read through the posts here and can’t find any eureka answers so here’s what I have. Linq to SQl not propagating a change back to the db.Here’s my code. Does anything stand out? The call to dc.GetChangeSet shows 0 changes. What am I missing? I can see the new values from “setting” being set to the cs object properties. SettingID is a primary key in my table and shows as PK in the dbml so that’s not an issue.Public Shared Function Update(ByVal setting As ClarifireSetup) As BooleanDim cs As

  • ekkis
    ajax asp.net-mvc-3 callback razor
    why do I always have so much trouble…? given that I didn’t solve the problem in my other article, I decided to just code the javascript right into the values… so I have:OnSuccess=”alert(‘ok’)”, OnFailure=”alert(‘failed’)”,so my problem is the submission works fine; a record gets inserted into the database and I get a callback… but I get the wrong callback! I get a failure even though the record got inserted. heeeeelp!

  • teahou
    asp.net-mvc-3 validation
    This has been asked and answered 100 times, and I have read them all, yet still my form submits after failing validation. I found a reference to not using jquery.validate higher than 1.9.0, so I rolled back to that (had been using 1.11) but no change.If i submit with an invalid form (nothing filled out) the error messages appear, then the form submits.I have successfully implemented validation a couple times in the past, and I can’t see what is different about this time. I need to take a break

  • Pat James
    asp.net-mvc asp.net-mvc-3 mobile 51degrees
    In my ASP.NET MVC 3 web application I am overriding the View name in a custom view engine to present a different view optimized for non-tablet mobile devices.All I want to perform this view override is an accurate value for Request.Browser.IsMobileDevice and the device’s native display width.51degrees.mobi feels very heavy and convoluted for this simple use case. Maybe that is just my frustration at trying to wade through all of the examples and documentation on the 51degrees web site to get an

  • EH_warch
    asp.net-mvc-3 sql-server-express asp.net-mvc-scaffolding
    I’m creating a new MVC 3 pilot application using Mvc3 and the MvcScaffolding NuGet, everything runs smoothly until i want to use the database i already have. The application keeps creating a database with the format:projectname.Models.projectnameContextI’m stuck in here, my connectionStrings is:<connectionStrings><add name=”ApplicationServices” connectionString=”data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true” providerNam

  • Christofer Eliasson
    c# asp.net-mvc-3 version-control entity-framework-4.3 ef-migrations
    I have an ASP.NET MVC3 project that uses Entity Framework 4.3 with the code-first approach. I use Migrations to keep the database up-to-date.The project is under source-control and I have a number of branches. What I just realized is that there will be a problem when I wan’t to merge one of my branches into the master. Since I have created migration-files in both branches, there will be overlapping migrations when I merge, which will probably cause conflicts.Is there a good way to manage Migrat

  • Lex
    c++ debugging error-handling assertions
    I am a big fan of writing assert checks in C++ code as a way to catch cases during development that cannot possibly happen but do happen because of logic bugs in my program. This is a good practice in general.However, I’ve noticed that some functions I write (which are part of a complex class) have 5+ asserts which feels like it could potentially be a bad programming practice, in terms of readability and maintainability. I think it’s still great, as each one requires me to think about pre- and p

  • John Cartwright
    api error-handling
    In general, if I am using an API whose methods have side-effects that I only want to occur once, how can I guarantee that my own application only calls them once even if an error occurs before it can register a response?For example, if I am calling a payment processing API once each month for a subscription service, how can I ensure that I don’t double-bill if I create a new transaction and the application suffers a fatal error before I get the response from that? It seems like cooperation with

  • gnat
    design-patterns exceptions error-handling erp
    I have joined writing middle-size multi-purpose database application as co-lead. It currently has about 150 tables (and growing) and overall functionality you can imagine as very small ERP.At many places in code, functionalities which would normally belong into procedures (I mean functions without return value) like DeleteAttachment or SaveRecord are put into functions with return value reporting their exit status in string. They return either “OK” on success or messages like “Deletion failed be

  • Webnet
    php codeigniter error-handling
    function truExceptionHandler($no, $str, $file, $line) {if ($str != “Only variables should be assigned by reference”) {echo ‘<br/><pre>’;echo “<b>[ERROR] “.$str.” in “.$file.” on line “.$line.”</b><br/>”;print_r(debug_backtrace(2));} }set_error_handler(‘truExceptionHandler’);My above function isn’t catching the error Fatal error: Maximum function nesting level of ‘100’ reached, aborting! in C:\Program Files (x86)\EasyPHP-5.3.6.0\www\site.com\system\core\Common.php on

  • teresko
    php error-handling fatal-error
    In my homemade PHP MVC framework, I’ve written a little error handler that wraps PHP errors in an exception, then throws it.class ErrorController extends ControllerAbstract {…public static function createErrorException($number, $message = NULL, $file = NULL, $line = NULL, array $context = array()) {throw new ErrorException($message, $number, 0, $file, $line);} }Which is then registered using set_error_handler(). This works fine, with the exception (no pun intended) of fatal errors. My custom

  • Paul M
    php error-handling
    I have a php script that connects to an api and posts our information to their systems, but when its trying to connect it throws an exception error, and I cant for the life of me work out why.Whats interesting is that if I send it to a simple php script which just grabs the IP then it works, but if I send it to the API it doesnt :(The script is a big file, which creates xml and then forwards to the server, however I was getting errors so I just created the following smaller script purely to test

  • David
    php apache .htaccess error-handling
    I current have this set in my htaccess:php_value error_reporting -1I want the log to only log fatal errors. What do I replace -1 with to do this?

  • Rinzwind
    installation 12.10 modules error-handling python-2.7
    When I try to use pip or easy_install I am getting following errors for any kind of modules I try to install. I ve looked for all the output errors but I dont understand th reason behind. Searching for orange Reading http://pypi.python.org/simple/orange/ Reading http://orange.biolab.si Reading http://orange.biolab.si/svn/orange/trunk Reading http://orange.biolab.si/ Reading https://bitbucket.org/biolab/orange/downloads Best match: Orange 2.6 Downloading http://pypi.python.org/packages/source/O/O

  • Demetri
    c++ error-handling shared-libraries dynamic-linking gmp
    How does one handle fatal errors in shared libraries?I am wondering because the GNU Multiprecision Library (GMP) provides no means to recover from errors like out-of-memory. Using longjmp() or throwing C++ exceptions would work, except that it leaves GMP in an inconsistent state as per https://gmplib.org/projects.html. Is there a way to unload GMP (or another shared library) and then reload it, to fix this problem?

  • Zimm3r
    python error-handling twisted
    I have a problem, with normal try except blocks in python you can just return if there is a fatal error, ex…try:logon() except 404_Error:retry_logon(try = 2)except AuthenticationProblem:error_label.SetText( “You password or username was wrong. Make sure that CAPS LOCK key is not on.” )return#nothing more we can do here else:#display user information or whateverSo how do this with deferreds, if I just return it goes onto execute the callbacks thinking the error is handled but how do I inform th

Web site is in building