-
|
You can use the ASP.NET Membership provider to generate a new random strong password. In the past I have usually either rolled my own authentication system or integrated an asp.net authentication system into an existing application and therefore I did not use the ASP.NET Membership system. In the current application I am writing, I had a need to generate a random strong password for the customer. The ASP.NET Membership system already has a static method built-in for this. You can use the GeneratePassword static method from the Membership class to create a new password: String strongPassword = System.Web.Security.Membership.GeneratePassword(8, 1); From the MSDN documentation, the two parameters are: length – Int32 The number...
|
-
|
On one of the projects I am working on I needed a way to work get the JSON string generated from some sort of serialization process. If you are working Ajax or MVC controller actions, this work is done for you automatically, but I wanted the string all by itself. After some searching I ran across this article How to: Serialize and Deserialize JSON Data . The article is great, and gave me everything I needed to know, but I thought I would make it a little cleaner and wrap it all up in a class. Below is the a generic class that will serialize and deserialize JSON: using System.IO; using System.Runtime.Serialization.Json; public class JsonSerializer { public JsonSerializer() { } public string Serialize(T instance) { using (MemoryStream stream Read...
|
-
|
It all started because I couldn't find a way to automatically scroll any element into view in Silverlight (a feature that exists in WPF). I take that back, I could get the job done with a ListBox's ScrollIntoView(ListBoxItem item) method, but I hardly wanted everything on my screen to be wrapped as a ListBoxItem; it feels as dirty as it sounds. Anyways, here is the code. /* Extension Methods */ public static class FrameworkElementExtensions { private const int ScrollPadding = 10; public static void BringIntoView( this FrameworkElement frameworkElement) { var parent = VisualTreeHelper.GetParent(frameworkElement); while (parent != null ) { parent = VisualTreeHelper.GetParent(parent); var scrollViewer = parent as ScrollViewer; if (scrollViewer...
|
-
|
It seems that the default project templates that Monotouch provides doesn't include a FlipView template. This template normally provides a way of flipping a view to another view which displays different information. I created a demo project (which includes Jon Skeet's picture - aren't you lucky?) to demonstrate one way of creating this functionality. Craig over at ConceptDev posted a way of creating this functionality (see here: http://conceptdev.blogspot.com/2009/10/monotouch-flip-flop-with-uiview...( read more ) Read More...
|
-
|
Yesterday one of our project team member faced a challenge of using an anonymous data that is returned from joining 2 typed data tables with LINQ. The problem is not how to use the data, the problem was how to be able to cast and use the data in Repeater ItemDataBond method without having “ <>f__AnonymousType0 ….” cast error. below is the join query (tables used are typed) :- 1: PagedDataSource objPDS = new PagedDataSource(); 2: objPDS.AllowPaging = true ; 3: objPDS.PageSize = 10; 4: 5: objPDS.DataSource = (from p in Table1 6: join d in Table2 on p.ID equals d.ID 7: select new 8: { 9: p, 10: F1= d.f1, 11: F2= d.f2, 12: F3= d.f3, 13: F4= d.f4, 14: }).ToList(); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family...
|
-
|
Monotouch Tips Part 1 Today I'm doing a post on a common problem I see a lot of people run into whilst developing with Monotouch. Having the ability to consume web services within Monotouch is a great feature of Monotouch however - normally sending data files over web services happens using byte arrays. To send data as a byte array, you will need to do the following: Obviously, this example is UIImage specific since this is what I've used in the past and gives a better example on what's needed to...( read more ) Read More...
|
-
|
In my previous post , I talked a little bit about the parts of the Reactive Framework that are coming to the .NET 4 BCL as well as their implementation in F# as part of F# First Class Events. This time, let’s come back to the Reactive Framework itself from which the IObservable<T> and IObserver<T> originated. As you may remember, you can play with the bits of the Reactive Framework from the Silverlight 3 Toolkit . In the first post in the series , I gave a basic introduction to the basic problems we have with asynchronous and reactive programming. We covered some of the evolution of the .NET framework with asynchronous programming and where the Reactive Framework fits. This time, I’ll pick up where we left off to talk about one of...
|
-
|
This C# code given below will demonstrate how the MSDeploy API can accomplish some common scenarios that users may want to perform. The following examples are documented below in no particular order: I. Server Sync IIS6.0 to IIS6.0 with ‘whatif’,deleting allowed and no content II. Sync with tracing ( verbose is demonstrated ) III. Skip directive usage IV. Replace Rule + Skip Rule ( using skipAction ) usage V. Sync a site from iis7 to Hostable web core ( iis7 ) VI. SetAcl on a directory ( setting...( read more ) Read More...
|
-
|
A little background for the iPhone application... DoneDone is a web app that manages issue tracking for projects. It's currently our choice bug tracking solution at work . Until a few months ago, the API they expose only allowed for the ability to add a new issue to a project. I went with this a decided to try and implement an app using the newly released Monotouch which allowed you to create a an issue on the iPhone device. In case you didn't know, Monotouch is a way of coding for the iPhone using...( read more ) Read More...
|
-
|
Here’s what I wanted to do: A Silverlight project User logs in A service runs and displays data upon successful login Quite simple right? In ‘pure’ Silverlight, one could probably do this in like 15 minutes, but I wanted to do this using Prism following the MVVM (Model-View-ViewModel) pattern. I added a couple more conditions: The main control of the Silverlight application is a TabControl with Login and Data as TabItems The first screen is the login screen When the login screen is displayed, the Data tabitem should not be displayed as it would not contain any data (information gets to the Data tabitem only after successful login) and vice versa I don’t have any intentions of writing this blog to develop the whole application; I’ll detail only...
|