DCSIMG
Tips & Tricks,DEV - Gil Fink's Blog

Gil Fink's Blog

Fink about IT

News

Microsoft MVP

My Facebook Profile My Twitter Profile My Linkedin Profile

Locations of visitors to this page

Creative Commons License

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2013 Gil Fink

Hebrew Articles

Index Pages

My OSS Projects

English Articles

Browse by Tags

All Tags » Tips & Tricks » DEV (RSS)
Quick Tip – Deleting a JavaScript Object Property
Quick Tip – Deleting a JavaScript Object Property Lately, I’m writing a JavaScript library which I’ll publish and write about in the near future. On the meanwhile, during the development I had to delete a property on a JavaScript object that I’ve created. Since JavaScript is a dynamic language that operation is available and is achieved through the delete operator. This post will describe the JavaScript delete operator and how to use it. The JavaScript Delete Operator The delete operator is used...
Back to Basics – JavaScript onerror Event
Back to Basics – JavaScript onerror Event The JavaScript window.onerror event is a very useful event that I find very strange that sometimes client-side developers don’t know. The event is fired most of the times (yep not every time) an error occurs in a JavaScript code. You can wire a handler to the event that will help you to prevent errors from bubbling to the browser or to send the errors to some logger for further investigation. The onerror Event The window.onerror is an event handler for error...
Quick Tip – Converting JSON Serialized .NET DateTime to JavaScript Date
Quick Tip – Converting JSON Serialized .NET DateTime to JavaScript Date When you are using the controller JSON method in ASP.NET MVC or scriptable WCF services you sometimes have to serialize a .NET DateTime property. The DataContractJsonSerializer will serialize it into the following format: /Date(1235398665390)/ This format indicate to the client side parsers that the data fragment that was sent is a date representation. But how can you convert it to a JavaScript Date object? There are a few methods...
VS2008 No Item Templates
VS2008 No Item Templates While trying to add a new web form item to a project at a customer, I got the following error: After pressing the OK button I got an empty Add New Item menu:   A little scary screen… So I went to the Event Viewer as suggested in the error message and looked at the event in the Application log which was:   So I closed all the VS2008 instances I had currently running and tried to regenerate the templates by running the devenv.exe /installvstemplates . That didn’t...
Add Service Reference – How to Avoid Generating Already Existing Classes
Add Service Reference – How to Avoid Generating Already Existing Classes Today I was asked how to avoid generating an already existing  client class when we use the Add Service Reference menu item in Visual Studio . The Problem In the e-mail I got the question was regarding the use of ValidationResults (from the Validation Application Block ) as a return type for a WCF Service . When they try to Add Service Reference to the service it is generating a new ValidationResults class for the use in...
OData Visualizer Extension
OData Visualizer Extension Yesterday I wrote about VS2010 extension manager . One of the great extensions that you can download and use is the OData Visualizer . The OData Visualizer helps us to get a visual graph of the OData Protocol ’s types, properties, associations, and other aspects of the EDM which you get from an OData metadata endpoint. Installing OData Visualizer Installing the OData Visualizer is very easy. Go to your Extension Manager and search for OData Visualizer in the online gallery...
VS2010 Extension Manager
VS2010 Extension Manager One of the great features in VS2010 is the extension manager . In last DevAcademy4 conference I talked about it a little in my session and showed  an extension that I use. Lets see what is it all about. Using The Extension Manager The extension manager in VS2010 is a manager that help to manage and discover extensions to VS2010 . In order to use it we only need to go to the Tools menu and choose to use the Extension Manager menu item. The following figure shows how to...
Quick Tip – Making Beep From the PC Speaker Using P/Invoke
Quick Tip – Making Beep From the PC Speaker Using P/Invoke I was asked yesterday how can we perform a beep sound from the PC speaker. This is  something that is needed in one of the  applications that I’m consulting for to indicate a successful transaction (don’t ask me way…).  Setting the Environment We first need to add the using for Runtime.InteropServices : using System.Runtime.InteropServices; Then load the unmanaged dll of kernel32.dll with the method signature for Beep which...
Back to Basics – Using MasterType Directive
Back to Basics – Using MasterType Directive This post is a result of a question that I got from one of the developers that I work with. The question was how to use master page properties from an ASP.NET page. Setting the Environment The first thing that you want to do is to expose the properties as public in the master page . For example this is code behind of a simple master page that exposes the IsPageEnabled property: public partial class Site1 : MasterPage { #region Properties   public bool...
Entity Framework Context Lifetime Best Practices
Entity Framework Context Lifetime Best Practices In this post I’m going to write about one of the major decisions that you need to take when you use ORM tools like Entity Framework . This decision is the context lifetime . The Problem Context lifetime is a very crucial decision to make when we use ORM s. Since the context is acting as an entity cache (it holds references to all the loaded entities for change tracking and lazy loading purpose), it may grow very fast in memory consumption. Also this...
Error CS0029: Cannot implicitly convert type Using WSDL Tool
Error CS0029: Cannot implicitly convert type Using WSDL Tool Today I was asked by one of developers I work with to check an error he got after he generated a proxy class with the wsdl.exe tool from a third party wsdl he got. The error was generated in runtime when he tried to use the generated class and it was something like: Unable to generate a temporary class (result=1). error CS0029: Cannot implicitly convert type 'A' to 'A[]' After searching in the internet I found that there...
Reading a Xml File in T4 Templates
Reading a Xml File in T4 Templates After I wrote the post about the use of T4 templates in EF4 , I played with them for a while (not in EF but generally with T4 templates ). In an old project that I’ve created almost 3 years ago which automated the use of lookup tables I had an enum. That enum was meant to be the connection between an Xml node names and was heavily used in the application. For each Xml node I needed to add an entry in the enum. So I thought what the hell lets see if I could have...
Working with Large Databases in Entity Framework
Working with Large Databases in Entity Framework Yesterday I was asked by a colleague a very good EF question. The question was how to split a model or how create a model for a large database . I pointed that colleague for the next three good resources which deal with such situations: Working With Large Models In Entity Framework – Part 1 Working With Large Models In Entity Framework – Part 2 How to split your EDM? I hope it will help you too if you seek for such an answer. Enjoy!
Entity Framework Free Tools List
Entity Framework Free Tools List In my last session at Microsoft I mentioned some EF free tools that you can use which can help you to be more productive. Since I got a comment about sharing my list, this is the free tool list and the places you can find them and download them: eSqlBlast – a suite of tools that target editing and executing eSQL statements. LINQPad – lets you query data sources in a modern language – LINQ . Supports not only EF and also: LINQ to Objects, LINQ to SQL, LINQ to XML and...
Building a Custom Site Map Provider
Building a Custom Site Map Provider In the last ASP.NET course I delivered I was asked how to build a custom site map provider . This post holds the answer. You can download the full example from here . Building a Custom Site Map Provider There are times that our requirements demand that our site navigation will not be based on the default site map provider . Such times are for example when we want to use a database table to hold our site navigation . In these times we can create a custom site map...
More Posts Next page »