tag:blogger.com,1999:blog-73365878722139186662024-03-05T05:51:15.411-08:00DotNet ChannelA blog about my day today experiences with programming in C#, Silverlight and ASP.NET and working with tools like Microsoft CRM, DotNetNuke etc.Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-7336587872213918666.post-51102735545745260752010-01-27T16:25:00.001-08:002010-01-27T17:24:19.564-08:00Silverlight 3: Auto select text in TextBoxMissing out of the box in Silverlight 3 is the ability to auto select the text in a textbox when it receives focus. Thankfully Attached Properties make it very easy to add the functionality. In this post I will create a AutoSelectText attached property, which when set to true will select all the text as when the textbox receives focus. And because of routed events, it is not required to add the Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com10tag:blogger.com,1999:blog-7336587872213918666.post-62311673943193902242009-10-16T11:17:00.001-07:002009-10-16T11:30:49.265-07:00RIA Services Change Set Conflict Resolution using ResolveChangeSetIf there are optimistic concurrency errors when a change set is submitted to a RIA Services DomainService, the error information is reported to the client in the resulting SubmitOperation via the Entity.Conflict member. Server side conflict resolution can be added by adding entity specific resolve methods in the DomainService. For example to handle optimistic concurrency errors for the Product Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-44328416373429535392009-09-24T22:36:00.001-07:002009-09-25T11:19:38.132-07:00XAML binding CodeRush templatesWhen I first started coding in Silverlight, I could never remember the syntax for databinding in XAML. Everytime I had to do databinding I found myself referring to the documentation. The lack of intellisense or compile time syntax checking was no fun either. So after a few days I created a few CodeRush templates, which I still use to speed up development. You can download them at the end of thisArjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-36140047757837715342008-09-16T14:25:00.001-07:002008-09-16T14:25:00.105-07:00Couple of XAML Editor enchancements in Visual Studio 2008 SP1The "Go To Definition" functionality in the XMAL code behind editor has been enhanced in Visual Studio 2008. Invoking it on a reference of a control in the XAML code behind page, now takes the user to the definition of the control in XMAL code. What a pleasant change from the prior behavior where invoking the command would take the user to the designer generated code behind page. So Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-33357059972977911482008-08-13T07:59:00.001-07:002008-08-13T17:31:52.986-07:00Programmatically creating DotNetNuke user passwordsWhen programmatically creating a DotNetNuke portal, the CreatePortal method API expects passwords that are already encrypted. In DotNetNuke, by default the passwords are encrypted using one way Triple DES algorithm. There is existing functionality in DotNetNuke that can be reused to encrypt plain text passwords. Listed below is some sample code that can be used. Requirements: The code listed Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com2tag:blogger.com,1999:blog-7336587872213918666.post-90039624633017965052008-07-31T08:44:00.000-07:002008-07-31T08:55:39.980-07:00Programmatically checking if the required alias is available in DotNetNukeIf you try to create a portal with a alias that in not available, DotNetNuke will complain about it and not allow you to continue ahead. It turns out that this duplication check is done by the UI and not the business layer. So if you are programmatically creating a portal, you will have check if the required alias is available, because the DotNetNuke API does not do it. Requirements: All the Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com2tag:blogger.com,1999:blog-7336587872213918666.post-50163729396023677122008-07-01T08:52:00.001-07:002008-08-14T14:26:53.879-07:00Programmatically creating DotNetNuke portals - Part 1If the need ever arises you can use C# to use the DotNetNuke API to programmatically create portals you can use the code listed below. Of course the code will need all the right permissions to do this. You will need the following information to create the portal. Portal Name Administrator first name and last name Administrator username and password Administrator email Portal Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com5tag:blogger.com,1999:blog-7336587872213918666.post-27342237457103745252008-06-23T22:24:00.001-07:002008-06-27T08:22:30.810-07:00Upgrading DotNetNuke from 4.4.1 to 4.8.4Upgrading DotNetNuke from one version to another is fairly simple other than the fact that the changes in the web.config file need to be made by hand (although this is not true any more). I recently upgraded my system from 4.4.1 to 4.8.4 and faced a couple of issues that I have listed below. Before you read any further, I would like to advice you to take a back up of your database and file Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-89135513773012857092008-06-22T08:52:00.000-07:002008-06-22T08:56:35.758-07:00CodeSmith 5.0 Beta releasedIf you use the popular code generation tool CodeSmith, you'll want to download the latest beta release. It adds support for .NET 3.5. So now you'll be able to use LINQ in your templates. There are also some code generation performance improvements. Read more about it here. (Via Rob Howard's blog) Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-29409783715299082802008-06-19T20:57:00.001-07:002008-06-19T20:57:05.162-07:00Anti-virus and search indexing programs can affect Visual Studio build performanceOn Scott Guthrie's blog, he has mentioned how sometimes anti-virus and search indexing programs can affect Visual Studio's build performance. One issue I've seen reported several times are cases where virus scanners, spy-bot detecters, and/or desktop search indexing tools end up monitoring a directory containing a project a little too closely, and continually change the timestamps of these Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com1tag:blogger.com,1999:blog-7336587872213918666.post-7877691427859718042008-06-18T20:19:00.001-07:002008-06-18T20:19:45.221-07:00Chance to win free .NET eBooksManning.com is giving away one free .NET eBook every day starting tomorrow until July 17, 2008. You can sign up for the lucky draw here. Listed below are links to some of their books on Amazon: ASP.NET AJAX in Action ASP.NET 2.0 Web Parts in Action: Building Dynamic Web Portals C# in Depth: What you need to master C# 2 and 3 LINQ in Action One lucky guy will win the entire Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-4072748931328786902008-06-03T10:10:00.001-07:002008-06-03T10:11:00.907-07:00Sys.WebForms.PageRequestManagerParserErrorExceptionRecently I inherited a ASP.NET project from a colleague, who left the company. Call it Murphy's law or whatever, but the very first time I tried to make changes I got the following exception at run time: Sys.WebForms.PageRequestManagerParserErrorException. After a little bit of Googling I found out the cause. I was using the UpdatePanel and using a Response.Write in my PageLoad. Eilon Lipton's Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-40209822707554530902007-12-03T22:10:00.001-08:002007-12-03T22:10:17.853-08:00Free ASP.NET Rich Text Editor controlCheck out this awesome free rich text editor. The source code can be found at CodePlex at: RTE (Rich Text Editor) ASP.NET Control The project page lists the following features Supported Browsers: Internet Explorer and FireFoxSupported Styles / Formats: Bold, Italic, Underline, Justify, indentations, Plain Lists, Numbered ListsSupported Commands: Copy, Paste, Cut, Add Hyperlink, Set Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-47553646698656597492007-12-03T18:05:00.001-08:002007-12-03T18:07:31.338-08:00Visual C# 2008 shortcutsI found a nice PDF file that lists the most frequently used shortcuts in Visual C# 2008. You can download it from the Visual C# 2008 Keybinding Reference Poster page. I haven't had the time to check how many shortcuts differ from those in Visual C# 2005. If you are using Visual C# 2005 check out this post: Visual C# 2005 shortcuts Technorati Tags: visual studio 2008, vs2008, c#, shortcut Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-10042884990126790502007-09-28T15:56:00.001-07:002007-09-28T16:00:28.872-07:00Partial methodsVisual Studio 2008 allows the use of partial methods. Partial methods are nothing but a compiler trick (just like partial classes). Designer generated code can provide hooks into their class methods, by using the partial keyword. Users of the class can then hook into those methods and provide their own implementation. When a partial method has no body then the partial method is not emitted to Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-1686738768413703442007-09-07T17:08:00.001-07:002007-09-07T17:09:25.070-07:00External settings file for ClientSettingsSection (applicationSettings)Very often we define application settings in application configuration sections and would like to isolate the configuration section into an external settings file. Creating external settings file using the configSource attribute for the predefined configuration sections (AppSettings, ConnectionStrings etc) is well documented. But the literature for custom configuration section is sparse. Listed Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-10761038179341904772007-09-06T12:10:00.001-07:002007-09-06T12:10:35.751-07:00Getting line numbers in exception stack trace in a Windows ServiceThe Exception.ToString() method contains call stack information when the exception was thrown. However if the PDB files from the assemblies involved are available, this information also contains file names and line numbers at each level of the stack trace. Needless to say that this information can be very beneficial to the developer. The CLR will look for the PDB files in the runtime working Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com2tag:blogger.com,1999:blog-7336587872213918666.post-8323688279698429632007-08-31T09:07:00.001-07:002007-08-31T09:07:45.368-07:00Shortcut: Launch Visual Studio Command Prompt from Visual StudioIn Visual Studio 2005:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> Go to Tools > External tools Click Add and enter the following information Title: Cm&d Command: %comspec% Arguments: /k ""C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"" x86 Initial Directory: $(ItemDir) Click Apply / OK In Visual Studio 2008: Go to Tools > Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com17tag:blogger.com,1999:blog-7336587872213918666.post-15372639406928699222007-08-29T18:03:00.001-07:002007-08-29T18:03:42.223-07:00Visual C# 2005 shortcutsI found a nice PDF file that lists the most frequently used shortcuts in Visual C# 2005. You can download it from the Visual C# 2005 Keyboard Shortcut Reference Poster page. Technorati Tags: visual studio 2005, vs2005 Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-38714922334945368162007-07-27T17:05:00.001-07:002007-07-27T17:05:50.509-07:00Visual Studio 2008 Beta 2 released.Find it using this link: Visual Studio 2008 Beta 2. Rob Caron has an easier way to download Visual Studio 2008 Beta 2. Looking for an easier way to download those huge Visual Studio 2008 Beta 2 files? Go grab the Microsoft Secure Content Downloader from Microsoft Research. Unfortunately it not install over Beta 1, Beta 1 has to be uninstalled. But it does have a go-live license, Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-31908662104775031322007-07-26T09:18:00.001-07:002008-12-10T00:53:36.351-08:00Nested GridViews and HidingOften we use nested GridView controls, so that individual rows in the master GridView can display a nested GridView in one of its columns. This is especially useful to show master/details relationships. However sometimes we might want to show the nested GridView only for the selected row. This post discusses one way to do it.PrerequisitesUnderstanding of the GridView control.Understanding of Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com6tag:blogger.com,1999:blog-7336587872213918666.post-20895164437959377842007-07-17T18:22:00.001-07:002007-08-31T10:49:53.709-07:00Multi-targeting FAQWhat is multi-targeting? Starting with Visual Studio 2008 developers will be able to target multiple versions of the .NET Framework using the same version of Visual studio. Developers will be able to start taking advantage of the new features Visual Studio provides without having to always upgrade their existing projects and deployed applications to use a new version of the .Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-60440655483948995132007-07-16T09:37:00.001-07:002007-07-16T09:37:42.554-07:00Visual Studio 2008 to be released in 2007Are per the blog posts found here and here, Visual Studio 2008 will ship before the end of this year. Also it will be launched along with Windows Server 2008 and Microsoft SQL Server 2008 at an event here in Los Angeles on 27 February 2008. As per Scott Guthrie We typically release products several weeks/months before we "launch" them. You'll be able to buy the final release of VS 2008 and Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0tag:blogger.com,1999:blog-7336587872213918666.post-62114954137700153702007-07-11T08:44:00.001-07:002007-07-11T08:44:48.957-07:00Web service time out in Visual Studio 2005 debug modeWe use a web service to standardize US addresses (convert Av to Ave., LA to Los Angeles etc). The web service has been around since a long time and is used by a lot of applications written in .NET 1.1. But today when using it in Visual Studio 2005 I noticed something. It threw a WebException.Timeout exception every time I invoked it while I was debugging. It worked fine when Arjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com3tag:blogger.com,1999:blog-7336587872213918666.post-20500615567411669372007-07-03T15:39:00.001-07:002007-07-03T15:39:22.036-07:00Expresso - The best regular expression toolOne of the projects I am working on involves screen scraping information off various web sites. Shortly after I started, I quickly learnt that any attempts towards serious screen scraping will required the use of regular expressions to detect patterns in the HTML source. And so began my (short lived) search for a tool to help me build and test regular expressions - thanksArjun Jhttp://www.blogger.com/profile/01209031051858122966noreply@blogger.com0