Showing all posts tagged: 'HTML 5'

A 8-post collection

How to use JQuery dialog as Confirm dialog in ASP.NET

Another ASP.NET WebForms post. It seems I'm "stuck" with WebForms for now, so lets make the best out of it. Today's issue: how many times did you have to code some confirmation logic on your website to ensure that your users are (doubly/triply) sure about the action they are about to perform? A typical example is prompting the user to confirm that they are sure about deleting a record. In typical/boring javascript world, you would do something like this: HTML <asp:Button runat="server" ID="btnDelete" Text="Delete" OnClick="BtnUDelete_Click" OnClientClick="if ( ! deleteConfirmation()) return false; …[read more]


Processing Payments and with Stripe, JavaScript and C# - PCI compliant

The source code and post have been updated to use the latest Stripe.NET API => v4.2 Online payments! We've all used them and some of us may have had the "fortune" implementing them on one website or another. Stripe is the not-so-new kid on the block, since it recently expanded in many countries, that makes this development task a breeze. If you are using .NET, then Stripe.NET is an excellent library that hides away most of the complexity and provides a very nice API. You can get it as a NuGet package or you can check the source …[read more]


Upload files to the server using Javascript and MVC WebAPI

The ASP.NET WebAPI is really versatile and powerful and I like to use it as much as I can when I develop for the web. I know that MVC controller methods can also process ajax requests, but I like the separation of concerns. WebAPI for REST calls and MVC for Views and the ViewModels manipulation. Note: if you still want to use MVC instead of WebAPI for your server implementation, have a read here. Recently, I had to implement a method to upload files to the server from an MVC view. I decided to use ajax and WebAPI. Once …[read more]


Importing CSV files using jQuery and HTML5

One of the cool features of HTML5 is the new File API that allows the broswer to directly interact with files on the file system. Most modern browsers that support HTML5 can use this API to perform client-side only processing without the need for a round trip to the servers or the use of ajax etc. In effect the server becomes redundant and the user experience more fluent and responsive. You can still, if you need to, perform server-side processing, but if you only want to make the file contents available to the browser then you can use the code …[read more]


Working with Radio buttons and jQuery

Working with Radio buttons and jQuery Radio buttons are one of the essential HTML elements that you can find in almost any website that contains a form for users to enter data. In this blog today we will do the following: Add radio buttons dynamically using jQuery And, get the value and text of the selected radio button using jQuery First you need a standard boiler plate html page that has a reference to the jQuery library. For this example we will use the Google jQuery CDN to pull the library on our page. At this stage, you page should …[read more]


Add watermark to textbox and password textbox using HTML5

If you need to add a watermark on your textboxes and wish to avoid ugly Javascript implementations, HTML5 is your friend. Simply use the placeholder attribute with any input element of type text or password, as per the examples below: <input id=”txtUsername” type=”text” placeholder=”Type your username” /> <input id=”txtPassword” type=”password” placeholder”Type your password” /></pre> This works like a treat! P.S This feature is only supported by the latest HTML5 browsers (IE10, Safari, Chrome, Firefox). Older browsers still require Javascript Happy coding… …[read more]