HTML to PDF

Have you ever wanted a function to convert HTML to PDF? It is really easy. A good use of this is when you have a resume on your website and you want to create a download of it as a PDF. Mind you; you will have to properly format your resume so it looks good in both cases. Not the easiest job, but totally worth while to have a resume download created on demand. Continue reading HTML to PDF

The Story of C# Meeting AngularJS

Most of you already know that I still like my WebForms. People have argued that using AngularJS with WebForms is pointless, but I say NA! It makes the user experience a little bit smoother.

In this blog I will show you how to create a table that can be sorted and paged using AngularJS. I chose not to use a webserivce as I did not feel like this warranted the extra overhead and code. I wanted to keep this absolutely simple. I would have used a webserivce had I been creating an API for others to use. This is also a project that is ultimately using WebForms, had I been doing an MVC project; webservices would have been a better choice.

Is this the best way; probably not! This is my first run with this, so I am doing it the way I know and the way I find the easiest to manipulate for my purpose.
Continue reading The Story of C# Meeting AngularJS

A Quest to Learn AngularJS

I recently got excited about AngularJS.  I took a pretty good course through CodeSchool for which you can find a link off of the AngularJS home page.  Since then I had been playing with and scouting out AngularJS ideas that I can build something with worth while.  There is no better way to learn than by doing.  Then I thought; what about the weather?  I had already built a real basic weather page using ASP.NET and C#, I wonder how hard it would be to build an AngularJS example.  I did not know how to connect AngularJS to a web service though.  Google has everything! So I looked for an example of AngularJS and OpenWeatherMap for which I had found.  It did not take long to find my solution.

My Original Weather Page: http://www.ldndeveloper.com/weather.aspx

My Angular Weather: http://www.ldndeveloper.com/angular/weather.aspx
Continue reading A Quest to Learn AngularJS

Starting a WebForm Project

    I started working in the DotNet while it was in the Beta stage. Ewe Beta! Since then I discovered there is more than one way to tackle a start of a project and I have perfected it for my purpose.

    I would suggest starting with an empty project rather than letting Microsoft build you one. By you creating an empty project you are able to control what goes in it. The “Web Forms”template that Microsoft offers has so many files and structure that you would likely not even use.
    Continue reading Starting a WebForm Project

How a Developer can Mitigate Stress of a Designer

Working with a designer and can be a challenge as a developer as we are totally different mind sets.  Working with a designer as a DotNet developer can be even more of a challenge, but there can be a simpler way.  DotNet can be absolutely daunting to a designer who is used to working with HTML or PHP, but using your designer as you build your application will make things easier for everyone.

If I have my way; I like to work with the design first and then do my coding as this provides the best results and the least stress for everyone involved.

Continue reading How a Developer can Mitigate Stress of a Designer

French and Other Language Characters – Classic ASP

Recently working with PayPal and Classic ASP I stumbled unto a problem where French characters were being encoded and displayed as unreadable text. It turns out that PayPal returns the result to you using UTF-8. In C# this would be an easy fix. Language characters can be tough in classic ASP.  I had searched for quite a while until I found the following code: Continue reading French and Other Language Characters – Classic ASP

Tricking Out Classic ASP With JSON – The Mandrill Experience

Using JSON with Classic ASP can be a tricky thing, but the developer of ASPJSON has made it very easy.  This library ( or include ) has made my life so much easier, but the instructions to get me started was somewhat raw and difficult for me to follow.

Since my original posting about  Tricking Out Classic ASP with JSON, I have had several people ask for the solution to SendGrid and Mandrill.  Both systems are very different, but the principals are similar.  I found Mandrill the easiest to implement.

The following code is the magic to it all, but this example is specific to Mandrill.

   jsonstring = ""  

   If Request.TotalBytes > 0 Then   
     Dim lngBytesCount   
     lngBytesCount = Request.TotalBytes   
     jsonstring = BytesToStr(Request.BinaryRead(lngBytesCount))   
   End If   

   Set oJSON = New aspJSON  
   'Load JSON string  
   jsonstring = replace(jsonstring, "mandrill_events=","")  
   oJSON.loadJSON(URLDecode(jsonstring))  

 ' Loop Through Records  
 for i = 0 to oJSON.data.count -1  
   str = oJSON.data(i).item("event")  
   straddress = oJSON.data(i).item("msg").item("email")  
 next  

You can download the full code sample from:  http://www.unlatched.com/sample/Mandrill%20with%20Classic%20ASP/mandrill%20aspjson%20testing.zip

I did include the ASPJSON include file so that you would get the complete solution; but you should ensure you have the latest once you have my example working.  Goto ASPJSON to get the latest library.

Auto-Link Using Regular Expressions

Auto-LinkingI was recently asked if I could automatically turn website text (ex: www.google.com ) into HTML hyperlinks.  My first thought was ah CRAP!  I also wondered why they could not use the link tool in the editor, but they asked so I delivered. With about 5 minutes on Google, I found the perfect solution that worked for me.

Mind you I was working in C# for this, but since it is a regular expression solution; it will apply to virtually any language.  The one change that I had made from the original code was to add in a piece that also auto-linked when the text included “http://www.”.  You may or may not want the extra addition that I had made.

Continue reading Auto-Link Using Regular Expressions