F9 Group Marketing and Technology Blog

Marketing, Technology, and current news at http://www.f9group.com/

Entries Tagged ‘api’

Integrating Twitter Into An ASP.NET Website

Twitter is a popular social networking web service for writing and sharing short messages. These tidy text messages are referred to as tweets and are limited to 140 characters. Users can leave tweets and follow other users directly from Twitter’s website or by using the Twitter API. Twitter’s API makes it possible to integrate Twitter with external applications. For example, you can use the Twitter API to display your latest tweets on your blog. A mom and pop online store could integrate Twitter such that a new tweet was added each time a customer completed an order. And ELMAH , a popular open-source error logging library, can be configured to send error notifications to Twitter. Twitter’s API is implemented over HTTP using the design principles of Representational State Transfer (REST) . In a nutshell, inter-operating with the Twitter API involves a client – your application – sending an XML-formatted message over HTTP to the server – Twitter’s website. The server responds with an XML-formatted message that contains status information and data. While you can certainly interface with this API by writing your own code to communicate with the Twitter API over HTTP along with the code that creates and parses the XML payloads exchanged between the client and server, such work is unnecessary since there are many community-created Twitter API libraries for a variety of programming frameworks. This article shows how to integrate Twitter with an ASP.NET website using the Twitterizer library, which is a free, open-source .NET library for working with the Twitter API. Specifically, this article shows how to retrieve your latest tweets and how to post a tweet using Twitterizer

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

An Extensive Examination of LINQ: Introducing LINQ to XML

XML is an increasingly popular way to encode documents, data, and electronic messages. There are a number of ways to programmatically create, modify, and search XML files. Since its inception, the .NET Framework’s System.Xml namespace has included classes for programmatically working with XML documents. For instance, the XmlReader and XmlWriter classes offer developers a means to read from or write to XML files in a fast, forward-only manner, while the XmlDocument class allows developers to work with an XML document as an in-memory tree representation. LINQ to XML is a new set of XML-related classes in the .NET Framework (found in the System.Xml.Linq namespace ), which enable developers to work with XML documents using LINQ’s features, syntax, and semantics. Compared to .NET’s existing XML APIs, LINQ to XML is a simpler, easier to use API. For a given task, LINQ to XML code is typically shorter and more readable than code that uses the XmlDocument or XmlReader / XmlWriter classes.

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Using Microsoft’s Chart Controls In An ASP.NET Application: Rendering the Chart

The Microsoft Chart Controls provide ASP.NET developers with an API and a Web control for creating and displaying charts in a web page. Behind the scenes, the Microsoft Chart Controls take the data to be plotted and dynamically generates an image. This image can be generated using one of three techniques: the Chart Web control can generate the image and save it to the web server’s file system in a specified location; the Chart control can generate the image and store it in memory, session, or elsewhere, and have that image served by a built-in HTTP Handler, ChartHttpHandler ; or the Chart control can send back the binary contents of the chart image directly to the browser. The chart image can be rendered using one of four image types: PNG , JPG , BMP , or EMF . And when rendering a JPG you can specify its compression level. Regardless of the image file type and the technique used to generate the image, the Chart Web control renders an <img> element whose src attribute references the image (or the image-producing HTTP Handler or ASP.NET page). When a browser requests a web page with a Chart control on it, it receives this <img> element as part of the page’s rendered markup and then makes a request to the URL specified in the src attribute (just like it does for any other image on a web page). The chart image file the browser requests either already exists in which case its contents are returned, or the image is dynamically-generated. Either way, the end result is that the browser is sent back the chart as an image file, which is displays. This article explores the three different techniques the Microsoft Chart Controls has at its disposal for generating chart images. We’ll look at how to use each option, enumerate the pros and cons, and discuss when to consider using one option over another. Read on to learn more! Read More >

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Using Microsoft’s Chart Controls In An ASP.NET Application: Getting Started

A picture is worth a 1,000 words… This adage rings especially true when it comes to reporting. Charts summarize and illuminate patterns in data in a way that long tables of numbers simply cannot. Web developers have long searched for ways to express numerical data in a graphical format; until recently, doing so required the use of an open source or third-party charting or reporting package or some homegrown technique using HTML, GDI+, or some other technology. In September 2008 Microsoft released a free charting suite named Microsoft Chart Controls for the .NET Framework 3.5 SP1. The Microsoft Chart Controls are an encompassing set of charts for WinForms and ASP.NET applications. Despite being a first release, the Chart Controls suite offers a wide array of chart types and charting features. The Chart Controls offer all of the standard chart types – line charts, bar charts, pie charts, and so forth – as well as more specialized ones, like pyramid and bubble charts. The Chart Controls suite offers a comprehensive set of charting features, including support for multiple series, customizable legends, trend lines, and labels. And the Chart Controls API makes it easy to sort, search, filter, group, and export the chart data. Unfortunately, this first version of the Chart Controls has limited support for customizing the chart from the Designer. There are no wizards to guide you through customizing the chart’s look and feel and specifying its data source. Instead, you have to set the properties and bind the chart data yourself. While the Microsoft Chart Controls have some rough edges, their cost (free), number of chart types, and array of supported charting features make them an excellent choice for adding charts to an ASP.NET web application

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Examining ASP.NET’s Membership, Roles, and Profile – Part 15

When a visitor registers a new account on an ASP.NET website that uses the Membership system, they are prompted (by default) for their username, password, e-mail address, and other pertinent information. Along with functionality for registering new accounts, the ASP.NET Membership system provides page developers techniques for modifying information about users. For instance, with just a couple of lines of code you can change an existing user’s e-mail address, approve a user, or unlock them (if their account was locked out). However, there are certain bits of user information that cannot be modified through the Membership API, such as the username. For most sites this is a non-issue. Once a visitor has registered an account that username is fixed; if they want a different username, well, they’ll just have to register a new account. But consider a website that has customized the account creation process so that instead of prompting the user for both a username and e-mail address, the user is only asked to enter an e-mail address and that it is used as both their username and e-mail address on file. Anytime a user switched e-mail addresses – which can happen when changing jobs, changing ISPs, or moving to the new, hip, web-based e-mail provider of the day – they need to also change their username on your site

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Periodically Updating the Screen and Web Page Title with ASP.NET AJAX

Developers using Microsoft’s ASP.NET AJAX framework can efficiently and interactively retrieve data from the web server using the ASP.NET AJAX client API, a bit of JavaScript, and Web services that support script access. Last week’s article, Building Interactive User Interfaces with Microsoft ASP.NET AJAX: Retrieving Server-Side Data Using Web Services , looked at how to create such Web services and how to call them from an ASP.NET AJAX application. With a sprinkle of JavaScript, This functionality can be implemented to provide a user interface that periodically updates, presenting pertinent information to the user without the need for the user to refresh her browser. Consider the following scenario: you are building a website that serves as a front-end for a work item database. The database contains tasks assigned to an employee; throughout the course of the day new tasks may be assigned to an employee by other workers, by automated processes, or by other means. When an employee logs onto the site he sees a hyperlink that lists the number of open work items in the upper left corner of every page, and clicking that link takes him to a page that lists the open work items in his queue. After completing a work item he closes it, which removes it from his list of open work items. In a typical web application the number of open work items in the upper left corner would only be refreshed when the user performed a postback, manually refreshed the page, or visited a new page. Wouldn’t it be nice if that count of open work items would interactively update as new work items assigned to the user entered the queue? This article looks at how to build such an interactive user interface by using the ASP.NET AJAX framework, script-enabled Web services, and a few lines of JavaScript, building upon the techniques discussed in Retrieving Server-Side Data Using Web Services . A complete, working demo is available for download at the end of this article. Read on to learn more! Read More >

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Examining ASP.NET 2.0’s Membership, Roles, and Profile – Part 13

ASP.NET’s forms-based authentication system in tandem with the Membership API and Login Web controls make it a cinch to create a user store, create user accounts, and allow visitors to log into the site. What’s more, with little effort it’s possible to define roles, associate user accounts with roles, and determine what functionality is available based on the currently logged in user’s role (see Part 2 ). Many ASP.NET sites that use Membership have an Admin role, and users in that role are granted certain functionality not available to non-Admin users. Consider an online store – Admin users might be able to manage inventory, whereas the only way normal members could interact with the inventory was by adding items to their shopping cart. I was recently working with a client who had an interesting request: he needed the ability for Admin users to be able to log into the site as another user, and perform actions as if that other person had logged in herself. Returning to the online store example, imagine that some customers periodically phone in their order, or mail or fax in an order form

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz