Profile cover photo
Profile photo
Darren McLeod

Post has attachment
When calling SaveChanges  on an entity context object you can sometimes get a DbEntityValidationException  error but it doesn't give you a convenient message as to what the error(s) were.  Here is a code snippet to get a convenient message from the DbEntity...

Post has attachment
Page.ClientScript.RegisterStartupScript not working
Had a website with a master page and in the the page_load event I was calling  Page.ClientScript.RegisterStartupScript to run some javascript based on the current state of the application. In the default.aspx page the script worked fine but in this other pa...

Post has attachment
ASP.NET 2.0 DropDownList EnableViewState
In ASP.NET 2.0 the  DropDownList   EnableViewState  doesn't work the same as other controls like GridView . Fortunately Anson Goldade created one that does. You can learn how here:

Post has attachment
Add Charset and ContentType to ASP.NET web page
The WC3 recommends specifying the Charset and ContentType on all of your web pages. A quick and easy way to do this in a ASP.NET web site with a master page is to add this to the masterpage file: <% Response.Charset = "utf-8" %>
<% Response.ContentType =...

Post has attachment
system.diagnostic trace not creating file in
If your S ystem .D iagnostic trace is not creating a file in make sure the the user that the website/webapp is running under has write permissions to the log file folder(default is web root ie where the web.config is). You can find the user that the...

Post has attachment
Where are UnityContainerExtensions
I had wrapped a Unity container in another class and then was using it to call Resolve and only got one option in intellisense like this: But I was wanting the Resolve(Of T) option like this: Then I discovered I was missing "Imports Microsoft.Practices.Unit...

Post has attachment
How to upgrade a web service to ASP.NET 4.0 with out affecting other services
After you have installed .NET 4.0 on the server open a command window and run: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe
-norestart -s W3SVC/ID/root/ Replace ID in the line above with the Identifier
of the Web Service.  The Identifier ...

Post has attachment
How to correctly call a web service in .NET
I came across a problem with calling web services that I had never heard about before. I was creating the client with a Using statement like so: Dim xml As XDocument = TestXml Dim actual ( ) As Byte Using proxy As New My WebService .My ServiceClient actual ...

Post has attachment
Using WCF with non-microsoft clients
The default wsdl that WCF creates isn't very friendly for human's and other non-microsoft clients to read. To remedy this you can intsall WCFExtras:   To use it, in your endpoint declaration add a " behaviorConfiguration " ele...

Post has attachment
"An attempt was made to load a program with an incorrect format.” in IIS 7
Was working on an old website dev region that hadn't been used since we upgraded to IIS 7 and a 64-bit web server, and was getting this error: " An attempt was made to load a program with an
incorrect format.”   After some research I found the answer here: ...
Wait while more posts are being loaded