The latest fad is to create Carousels to display images, and allow for easy navigation. I have not been able to find any .NET controls to enable you to create a Carousel on a web page.
ERROR - UNABLE TO LOAD CONTROL : ~/User controls/carousel.ascx
So I set myself the task of generating a web page control to allow for easy, managed code, configuration of a Carousel Control in .NET
The end product is a small DLL that can be dragged and dropped in to your ASP.NET application or Website
Carousel.dll (21.50 kb)
The project solution was generated using Visual Studio 2008 Pro,with a Target Framework of ".NET Framework 2.0"
Carousel.zip (191.73 kb)
How to use the Carousel
Okay, so now I've built the Carousel Control, you now want to to know how to use it?
First create a new WebSite
Add the Carousel.dll or a project reference to your website
On the web page register the control (or add it to your web.config)
- Next in the code behind you need to add to the CarouselDetail collection, which will add the images, links to the Carousel
And that is it, the more you add to the CarouselDetail collection the more items will appear on the Carousel.
Here's how to embed the file:
- Create a js file such as carousel.js
- In Visual Studio, select the file in Solution Explorer and change the Build Action property to "Embedded Resource"
- Build the project and the carousel.js file is now part of the assembly (you don't need to distibute the js file now it's part of the assembly)
Now to get the resource out using code:
So if we have a resource named Control.carousel.js we can use the following to include it in our page:
System.IO.Stream script = Assembly.GetExecutingAssembly().GetManifestResourceStream("Control.carousel.js");
System.IO.StreamReader sr = new System.IO.StreamReader(script);
Page.ClientScript.RegisterClientScriptBlock(GetType(), "carousel", sr.ReadToEnd().ToString(), true);
The above code injects the embedded file in to the page, how easy could it be?
One of the tasks Jon was given was to create an Audit module for LINQ, and came across this link which seems to provide a solution. I've not had time to go over the solution, but it appears to do a very good job at first glance.
LINQ to SQL Audit Trail
LINQ Audit Trail v2 - DoddleAudit
Do you still use Notepad that ships with Windows?
I did, until I found NotePad2, it's fast, it's easy to use, and more to the point it works.
I've been using it for the past 2 months, and I have not got any clue to the features, but what I like about it is it just works and is a very good replacement for the standard Windows Notepad.
Here are the features, cribbed from the NotePad2 Website:
Customizable syntax highlighting:
- C/C++, C#, Java, VB, Pascal, Assembler, SQL, Python, NSIS
- INI, REG, INF, BAT, DIFF
- Drag & drop text editing inside and outside Notepad2
- Basic regular expression search and replace
- Useful word, line and block editing shortcuts
- Rectangular selection (Alt+Mouse)
- Brace matching, auto indent, long line marker, zoom functions
- Support for Unicode, UTF-8, Unix and Mac text files
- Open shell links
- Mostly adjustable
- Auto indentation
- Bracket matching
- Encoding conversion between ASCII, UTF-8 and UTF-16 formats
- Multiple undo/redo; rectangular block selection
- Newline conversion, between DOS (CR/LF), Unix (LF) and Mac (CR) formats
How to Replace notepad with notepad2 in Vista?
- First you need to download notepad2 from here
- First you need to Rename Notepad2.exe to notepad.exe.
- Find c:\windows\notepad.exe and c:\windows\system32\notepad.exe and set the owner to ‘Administrators’, and grant Administrators full control.
- Using Windows Explorer, drag and drop the renamed notepad2.exe to c:\windows and c:\windows\system32.
- Optional replace the permissions on the new notepad.exe to Read & Execute and Read.
Another one to look at is Notepad++
, it has a lovely set of plugins such as XML have a look at Tim Almonds post on the XML plugin
I have a a wobble board for my Wii and I am looking for a game to play at Xmas, but which one?
After my work creating the Mad Tri web site, I submitted the theme it to the BlogEngine team a few months ago and they have included it in their Theme pack, what a lovely surprise.
The BlogEngine team are going to be working hard over Christmas, with updating the BlogEngine and release a new release. more...
I too are going to the working over the Christmas on an Enhanced Newsletter and a Resource Editor to enable changes to Internationalization from the web, power to the BlogEngine
Oh how I remember those days of page through data, using a GridView controller, or any other controller, lots of coding and so easy to make a mistake.
Just take a look at http://www.unboxedsolutions.com/sean/archive/2005/12/28/818.aspx by Sean Chase, and you will see what I mean.
Things have moved on a bit since those days, and now we have LINQ it is much easier, both directly feeding from LINQ or via methods, both provide the same result.
Here is how to enable paging directly to LINQ, by using the LinqDataSource
How easy could it be?
When it comes to generating your own method you can do this with just a little more coding and take advantange of the Linq Skip and Take methods, the sample below provides an example using a Method.
To use this fully you will need to make a few changes to the webpage, as shown below:
Now that you have everything set on the page all that is left is the code behind and the methods, I am using the partial class in the example, but it does not have to be.
To ensure that the application is Paging correctly I found running the SQL Profiler on the database made sure that only the data page was being returned and nothing else, you may want to perform your own tests too.
I have included a small application using Visual Studio 2008 and .NET 3.5, all you will need to change is the connection string settings to the NorthWind database.
GridPerformance.zip (16.46 kb)
With C# 4.0 going to include Dynamic Language programming, the reports and demos I have seen to date look very impressive.
The only main implementation and useful application was to connect to COM objects, or more to the point to Microsoft Office as this is pure COM, and always been really hard to connect and work with.
I've also seen a demo of using the Dynamic Language to build your own .NET compiler on the fly, so building and running C# code from your own application, how cool is that?
With Dynamic Language for C#, COM should be eaiser to work with.
Microsoft have release the Dynamic Language Runtime on CodePlex so we can start to play with the new features before they are release in C# 4.0