Recently I’ve found that ASP.NET HttpApplication may execute a single request in different threads. No this post is not about Async page feature of ASP.NET 2.0. It appeared that even ordinal page request execution can be done in different threads under big load.

I had the code which initialized TreadStatic field in the Application.BeginRequest handler. Then the pages and controls code used the created instance.

 

[ThreadStatic]
public static IScriptIncludable Includer = null;
protected void Application_BeginRequest(object sender, EventArgs e)
{
Utility.Includer = new PageScriptIncluder();
}
protected void Application_EndRequest(object sender, EventArgs e)
{
Utility.Includer = null;
}

 

I realized that sometimes I got the NullReferenceException when I clicked very fast at the site navigation menu. After adding a trace in the Application_BeginRequest and EndRequest to track the current thread it appeared that HttpApplication can switch the rendering of the page to the other tread than the one which executes BeginRequest. Here is the exception call stack:

System.Web.dll!System.Web.UI.Control.LoadRecursive() + 0x33 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x274 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x84 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x51 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x16 bytes
System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 bytes
App_Web_xn8fhjxo.dll!ASP.about_default_aspx.ProcessRequest(System.Web.HttpContext context = {System.Web.HttpContext}) + 0x33 bytes	C#
System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0xb6 bytes
System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x4c bytes
System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x133 bytes
System.Web.dll!System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(System.Exception error) + 0x25 bytes
System.Web.dll!System.Web.HttpApplication.AsyncEventExecutionStep.ResumeStepsWithAssert(System.Exception error) + 0x28 bytes
System.Web.dll!System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(System.IAsyncResult ar) + 0x84 bytes
System.Web.dll!System.Web.HttpAsyncResult.Complete(bool synchronous, object result, System.Exception error, System.Web.RequestNotificationStatus status) + 0x3e bytes
System.Web.dll!System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(object state) + 0x169 bytes
mscorlib.dll!System.Threading._TimerCallback.TimerCallback_Context(object state) + 0x2f bytes

Most interesting lines are at the bottom. After the _TimerCallback.TimerCallback_Context the HttpAllication resumes execution in another thread using AsyncEventExecutionStep and ApplicationStepManager.

I had a look into the HttpApplication code using Reflector and found out that at the beginning of the request handling Application creates a chain of steps, like Begin Request, Render Request and so on. Those steps are held in ApplicationStepManager and there is no guarantee that they will be called in the same thread.

My problem was fixed by simply using lazy loading ThreadStatic singleton instead of explicit object creation in the BeginRequest handle. Initialization of ThreadStatic fields in BeginRequest doesn’t make any sense.

Submit this story to DotNetKicks

Posted in: ASP.NET  Tags:

Currently rated 1.5 by 186 people

  • Currently 1.478492/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

I’ve started to play with Linq2Sql ORM recently and the above error occurred when VS2008 tries to regenerate dbml file changes.

image

First time I didn’t find any other solution than to rebuild the dbml file from scratch. After a while I saw this error again. Google helped me to find out that it is very common problem and is connected to the usings inside the dbml codebihind.

The trick is if you have Northwind.dbml and Northind.cs file which starts with using clause:

using System;
namespace Northwind.DAL
{
    public partial class Product
    {

move the using inside namespace

namespace Northwind.DAL
{
    using System;
    public partial class Product
    {

and re-run Custom Tool from Northwind.dbml context menu in solution explorer. Unbelievable but it helps!

Submit this story to DotNetKicks

Posted in: linq2sql  Tags:

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

It took a half an hour today morning to clear the blog from comments like “I like the post, keep posting…”. I was wondering why those optimizers chose my blog to promote their sites and finally caught that my current theme creates a link at the top of a comment to the author site without rel=” nofollow”! Another reason is that I didn’t received any email notifications about new comments because of some curious filtering on the SMTP server I had in blog settings.

Now all links will have nofollow attribute so good buy spammers!

Submit this story to DotNetKicks

Posted in: blogengine.net  Tags:

Currently rated 1.5 by 10 people

  • Currently 1.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Good day everyone. I’ve adapted new one CSS template swanky from the freecsstemplates.org to use with Blogengine.net. It is bright theme in black – white – violate colors. See this post in the swanky theme. I’ve slightly changed to be in 2 columns instead of 3 because I strongly believe that it is more useful :)

The theme is tested in FF3, IE6, IE7. It is compatible with Blogengine.net v. 1.4.5 and uses its “widget zone” feature which allow you to add/remove tags, categories and other blocks from the blog pages.

You are free to download it from here. Please write a comment if you find a bug. Enjoy!

Submit this story to DotNetKicks

Posted in: blogengine.net  Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

I've already written about the Open Flash Chart and ASP.NET library to work with it. Since that time the version 2 of the flash component has been released. The flash component now uses JSON format of data, some new types of charts has been added such as horizontal bar chart and there are other “cool new features”.

The great work was done this post. The author adapted the library to use JSON format also added support of some new chart types as well as new properties. All I've done after it it just some refactoring testing, and bugfixing the library to support all the chart types.

I added two examples of lib usage in the project: the static 2 charts on page and the page with a chart inside UpdatePanel control to show how to properly embed in that case. The demo pages are here.  The source can be downloaded from codplex (VS2008 solution).

The second chart on the default.aspx page uses a custom data page and does not use ASP.NET cache. The control property SpecificDataHandler is designed to set the custom data page

<OpenFlash:OpenFlashChartControl runat="server" ID="ofcTest2" Height="350" Width="500" OnDrawChart="DrawChart" SpecificDataHandler="FlashData.aspx"/>

The FlashData.aspx is an ordinal ASP.NET page with nothing in aspx file and a code which simply builds and flushes an Graph object in the codebehind.

public partial class FlashData : System.Web.UI.Page
{
    protected override void Render(HtmlTextWriter writer)
    {
        Graph g = new Graph();
        g.Title = new Title("Bar Chart");
        var bar = new BarSketch(3);
        Random random = new Random();
        bar.Fillalpha = 0.4;
        bar.Text = "Test";
        bar.Fontsize = 10;
        int max = int.MinValue;
        for (int i = 0; i < 12; i++)
        {
            int value = random.Next(i, i * 2);
            if (value > max)
                max = value;
            var val = bar.NewValue(i.ToString(), value);
            bar.Values.Add(val);
        }
        g.AddElement(bar);
        g.OnBuildComplete();
        writer.Write(g.ToPrettyString());
    }
}

This approach is useful for web farms.

If you made a bug in the JSON you’ll have the most common Error #2032 which means that the data for the chart can not be loaded. To solve it the chart has properties DataHandlerUrl and SpecificDataHandler and you can exactly specify the HttpHandler or the specific data handler address.

Related posts: Open Flash Chart

Submit this story to DotNetKicks

Currently rated 1.6 by 16 people

  • Currently 1.625/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

I just wanted to publish the theme which I originally used to create this blog. The template was taken from www.freecsstemplates.org. I liked it because of complete simplicity, 2 column layout and a lot of air in text. See this post using the theme.

The theme is now adapted for the BlogEngine.Net 1.4.5. The new preview fitures in comments view like preview tab and bb code buttons are avialable. I've tested it using firefox and IE 6, 7 and it is even XHTML 1.0 compliant but nobody is perfect and if you have any problems send a message to me.

I've found that it is rather simple to adapt any CSS template for the BlogEngine.Net. The Al Nyveldt article and greate webcast describes how to do it in very simple way that everyone with basic CSS and ASP.NET experience can do it himself.

The original CSS template was released under the Creative Commons Attribution 2.5 license. My modification can be considered as BSD license.

SimpleTex.zip (22.88 kb)

Submit this story to DotNetKicks

Posted in:   Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Recently I’ve looked for a autocomplete or suggestion plug-in for JQuery library. I found plenty of implementation of such plug-in and now I am trying to make a comparison between them. The aspects for which I compare plug-ins are:

  1. Functionality. I want to implement auto suggestion to suggest tags from existed ones, so first I want the plug-in to suggest multiple words separated by comma and the second, I want the plug-in to use 2 sources for the suggestion values – the javascript defined arrays and a list of values from ajax call.
  2. Plug-in size. The smaller plug-in, the better. I don’t like plug-ins which require a bunch of other plug-in which can increase the size of the page too much.
  3. Speed. I think the best way for such plugins is to fetch data from server for first letter and then filter it to much further user input.

Plugins

Searching JQuery plugin repository and simply googling I found following list of plugins:

  • Autocomplete on bassistance.de. The article is here and the demo is here. This is the most developed plugin. The required functionality such as ajax and predefined list of values, caching of response is always built in it, so you can download and start to use it. And of course the main drawback is its size. The size of the unpacked script source is 18,4 Kb (12 Kb minified and 7,3Kb packed) + it strongly requires dimension plugin (2.5 Kb minified) and for old IE browsers requires bgiframe plugin (1.4 Kb minified). The bgiframe is the common fix for all such plugins so it can not be counted in the whole plugin size. But even without it the plugin is rather heavy – 14,5 Kb minified and 9.5 Kb packed.
  • jquery.suggest on www.vulgarisoip.com. The demo and the article is here. This is lightweight implementation it is only 7Kb of full source + it requires dimension and bgiframe plugins too. It doesn’t have good caching functionality, so for ajax calls it fetch data from the server as soon as new letter typed in the input box. It does not support multiple, separated entries in one textbox too.

  • autocomplete on www.dyve.net. The article and demo. 14 Kb full source script. The script is very clear, it does not require additional plugins and fist I choose it as the best solution for me but unfortunately it does not support the entering of multiple values and make good results caching.
  • jQuery plugin for Autocomplete. The project home, the demo. Script is 14 Kb weight. Does not support multiple suggestions. Supports both ajax and javascript array values data source. I’ve tried to implement further filtering results of ajax call myself, but the script execution became very slow.
  • Tag suggestion. The plugin demo and project. This plugin is a little bit different from all previous ones. It is a special solution to suggest tags and it displays the suggestion as the list of spans after the text box by default. This layout makes it difficult to use in most cases because if there is a lot of suggestion elements they will not fit in the area of the panel or page. The full source is 9,84 Kb and it does not require additional plugins. It can fetch data from array definition and ajax data source. Pretty nice solution for those, who can be sure in the number of suggestion values.

Conclusions

I chose the first one "Autocomplete on bassistance.de" autocomplete plugin from the list above. Yes it is heavy but it has all necessary functional and thanks to smart caching it does not overload server after each letter is typed. The difference with other plugins is about 4 Kb in average so it can be neglected.

Submit this story to DotNetKicks

Posted in: JQuery  Tags: , ,

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Websites often sends emails to registered users with inivitations to make certain actions. Sometimes we need to send user an URL to the registered area of site. The standart approach is to send a link to the page, users follow it, ASP.NET regirects him to login page where he must enter his credentions to continue. In some applications users receives an URL wich automatically logs user in (for example in LinkedIn). This article is about an ASP.NET module wich automatically logs users in case of special URL signature found in URL.

The approach

How to sign the URL and verify, that the signature is given to the certain user? My approach is to set 2 url params: with user name and with the signature based on machine validation key of web application. If we add the signature to the url string with the user name we can be sure this user has rights to see this page. Of couse this is not 100% secure method but, because the URL can be stolled or sniffered but in many cases such a security is acceptable. The machine key verification key is rather strong and secure for the purpose. The solution in the form of HttpModule is reusable. All we have to do is to handle AuthenticateRequest event and authenticate user in it.

The code

Full source of UrlAutoLogInModule can be downloaded here: UrlAutoLogInModule.zip (2.19 kb)

In the code a HttpModule created

    public class UrlAutoLogInModule : IHttpModule

which simple handles AuthenticateRequest event

        public void Init(HttpApplication context)

        {

            // Handle the authenticate request event

            context.AuthenticateRequest += new EventHandler(AuthenticateRequest);

        }

The module search for the get params with user name and signature

        protected void AuthenticateRequest(object sender, EventArgs e)

        {

            HttpApplication application = (HttpApplication) sender;

            string authToken = application.Request.QueryString[TokenParam];

            string userName = application.Request.QueryString[UserNameParam];

 

            if (string.IsNullOrEmpty(authToken) || string.IsNullOrEmpty(userName))

                return;

Next step is check if such a user is not locked or disabled to prevent locked users log in into website. The user retrievment will also updates the last login time in the database. At this point an assumption that the Membership is used to implement website security.

                MembershipUser muser = Membership.GetUser(userName, true);

                if (!muser.IsApproved || muser.IsLockedOut)

                {

                    return;

                }

The futher logic is very simple. We have to compute hash for the request URL and chek if it equals to the signature in the get params. If verification succeded we add an authentication cookie for the user and initialize System.Threading.Thread.CurrentPrincipal and System.Web.HttpContext.Current.User. You can add some custom logic here if you need to use other than GenericPrincipal implementation of IPrincipal interface. To prevent hackers from finding verification key it will be nice to lock user due to membership settings after several failed login attempts. To do this it is possible to call Membership.VerifyPassword with wrong password. This will update Membership tables and log failed login attempt.

                string currentHash = ComputeHash(GetFullRawUrl(application.Request));

                bool approve = currentHash.Equals(authToken);

                if (approve)

                {

                    // Add auth cookie

                    FormsAuthentication.SetAuthCookie(userName, false);

                    IPrincipal user = new GenericPrincipal(

                        new GenericIdentity(userName), null

                        );

                    System.Threading.Thread.CurrentPrincipal = user;

                    HttpContext.Current.User = user;

                }

                else

                {

                    Membership.ValidateUser(userName, "invalid password");

                }

There is several odds in ComputeHash method wich I want to describe. First it is removes the signature param from the url string because it is impossible to sign URL with signature. Second it uses Request.RawUrl instead of other request properties because I am using UrlRewriter.NET and in that property ASP.NET stores not rewrited URL from user's browser. And finally it gets verification key from machineKey config section and comutes hash of the URL string. The signature algo is same as in MachineKeySection.HasData method wich unfotunetly is declared as internal (I'm wondering why).

How it works

The module needs a registration in the web.config file httpModules section

      <httpModules>

        <add name="UrlAutoLogInModule" type="Yesnobox.Modules.UrlAutoLogInModule, YourAssembly" /> 

If you want to send user a signed URL, you have to call static method wich adds signature and user name to the URL.

emailArgs.TestUrl = Yesnobox.Modules.UrlAutoLogInModule.SignUrl(emailArgs.TestUrl, ud.UserName); 

 

When user follows this url and his signature is valid he automatically logs in and see page without redirecting to the login page. If the signature is wrong and the page can be seen only by logged in user the user will be redirected to the login page by internal ASP.NET logic.

If you care about security much it is possible to add an expiretion date for the signature by simply add expiration date to one of URL param before adding the signature hash.

I created a simple example wich uses the module.  AutoLoginExample.zip (11.12 kb)

Here there is auto login link on the page. If the user followes it he gets authorised. Note that there is no logic to login user in the page onbehind or at any place of the site. There is only a signed url on the page that is doing automatical login.

Submit this story to DotNetKicks

Posted in: ASP.NET  Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Open Flash Chart .NET Library

Open Flash Chart is the chart component I chose to use at Yesnobox.com. I liked it at first sight because it looks really awesome at the client browsers and doesn’t require generating chart images on server.  It was pity, but at the time I decided to use it in Nov 2007, there were no .NET API to use it. Thanks to many examples at the Open Flash Chart website and API written for other programming languages it seemed that it will be simple enough to write another one for .NET. So I decided to write my own library to build data strings and create handy asp.net web control to place on a page.

Online Demo

Before going in details of how it is works you can test the chart and properties at the demo page.

How to start?

To start using Open Flash Chart you have to download the project and link the dll or the source with you current application.

Download Open Flash Chart object and copy swf file to the ~/Flash/ open-flash-chart.swf on your website. (You can set another location in the FlashUrl property of OpenFlashChart web control)

In order to display chart data you have to register small HttpHandler from library under the <system.web><httpHandlers> node in web.config:

</configuration>

<system.web>

  <httpHandlers>

    <add verb="*" path="of.axd" type="OpenFlashChartLib.OpenFlashChartControlHandler, OpenFlashChartLib" />

  </httpHandlers>

</system.web>

</configuration>

Add Register directive before place the control on the page 

<ofc:OpenFlashChart runat="server" ID="ofcTest" Height="350" Width="500" OnDrawChart="ofcTest_DrawChart" />

Call BuildChart()control’s method to rebuild chart data:

protected void Page_Load(object sender, EventArgs e)

{

    ofcTest.BuildChart();

Define the DrawChart handler in the page code behind. At this event you have to create Graph object, initialize it properties and set diagram values.

protected void ofcTest_DrawChart(object sender, OpenFlashChartLib.DrawChartEventArgs e)

{

    // Create graph object and initialize its display preferences

    Graph graph = new Graph();

    e.Graph = graph;

    graph.Title.Text = "";

    graph.Title.Style.Font.Size = new FontUnit(26, UnitType.Pixel);

    graph.XLabelStyle.Color = "#9933CC";

    graph.XLabelStyle.Size = 10;

    graph.YLegend.Text = "Votes";

    graph.YLegend.Size = 12;

    graph.YLegend.Color = "0x736AFF";

    graph.XLegend.Text = "Your question";

    graph.XLegend.Size = 14;

    graph.XLegend.Color = "0x736AFF";

    graph.YTicks.Size = 2;

 

    // Create new data renderer

    DataRenderer<int> ret = new DataRenderer<int>();

    // Create a chart type wich you want to display

    // as GraphTypeRenderer

    string grColor = "E61C1C";

    int alpha = 60;

    string legentText = "Legend";

    int legentTextHeight = 12;

    ret.GraphTypeRenderer = new BarGraphType(alpha, "#" + grColor, legentText, legentTextHeight);

 

    // Initialize XLables for the data set

    graph.XLabels.Values.Add("Answer 1");

    graph.XLabels.Values.Add("Answer 2");

    graph.XLabels.Values.Add("Answer 3");

    graph.XLabels.Values.Add("Answer 4");

    graph.XLabels.Values.Add("Answer 5");

    // Add Values to display

    ret.Values.Add(3);

    ret.Values.Add(3);

    ret.Values.Add(7);

    ret.Values.Add(12);

    ret.Values.Add(1);

    // Add data rendere to the Graph.Values collection

    graph.Values.Add(ret);

 

    graph.Attributes.Add(new KeyValuePair(Tokens.BackgroundColor, "#FFFFFF"));

}

That’s it. Press F5 and see results:


The flash object is automatically embedded by SWFObject script which is linked to the page from library resources.

If the chart is not pie chart we can add other data sets to display as it is done at http://teethgrinder.co.uk/open-flash-chart/gallery-bar-2.php page. All we have to do is to create another DataRenderer object, init it in the GraphTypeRenderer and add values.

To create 2 data sets on one chart use the following code

using System;

using System.Web.UI.WebControls;

using OpenFlashChartLib;

 

namespace WebDemo

{

    public partial class _Default : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

            ofcTest.BuildChart();

        }

 

        protected void ofcTest_DrawChart(object sender, OpenFlashChartLib.DrawChartEventArgs e)

        {

            // Create graph object and initialize its display preferences

            Graph graph = new Graph();

            e.Graph = graph;

            graph.Title.Text = "";

            graph.Title.Style.Font.Size = new FontUnit(26, UnitType.Pixel);

            graph.XLabelStyle.Color = "#9933CC";

            graph.XLabelStyle.Size = 10;

            graph.YLegend.Text = "Votes";

            graph.YLegend.Size = 12;

            graph.YLegend.Color = "0x736AFF";

            graph.XLegend.Text = "Your question";

            graph.XLegend.Size = 14;

            graph.XLegend.Color = "0x736AFF";

            graph.YTicks.Size = 2;

 

            // Create new data renderer

            DataRenderer<int> ret = new DataRenderer<int>();

            // Create a chart type wich you want to display

            // as GraphTypeRenderer

            string grColor = "E61C1C";

            int alpha = 60;

            string legentText = "Legend";

            int legentTextHeight = 12;

            ret.GraphTypeRenderer = new BarGraphType(alpha, "#" + grColor, legentText, legentTextHeight);

            // Initialize XLables for the data set

            graph.XLabels.Values.Add("Answer 1");

            graph.XLabels.Values.Add("Answer 2");

            graph.XLabels.Values.Add("Answer 3");

            graph.XLabels.Values.Add("Answer 4");

            graph.XLabels.Values.Add("Answer 5");

            // Add Values to display

            ret.Values.Add(3);

            ret.Values.Add(3);

            ret.Values.Add(7);

            ret.Values.Add(12);

            ret.Values.Add(1);

            // Add rendere to Values collection

            graph.Values.Add(ret);

            graph.YMax = 12;

 

            // if this is not pie chart create another renderer

            if (!graph.PieChart())

            {

                DataRenderer<int> ret2 = new DataRenderer<int>();

                BarGraphType renderer = new GlassGraphType(alpha, "#005231", "", null);

                renderer.Color = "#005231";

                renderer.OulineColor = "#005231";

                ret2.GraphTypeRenderer = renderer;

                ret2.Values.Add(5);

                ret2.Values.Add(12);

                ret2.Values.Add(1);

                ret2.Values.Add(0);

                ret2.Values.Add(8);

                graph.Values.Add(ret2);

            }

            graph.YMax = 12;

            graph.Attributes.Add(new KeyValuePair(Tokens.BackgroundColor, "#FFFFFF"));

 

        }

    }

}

We will get the following pretty chart:


The creation of pie chart does not differ much. The only thing that changes is the is type of GraphTypeRenderer property of the DataRenderer. Use the following code to define Pie chart in the DrawChart event:

// Create new data renderer

DataRenderer<int> ret = new DataRenderer<int>();

// Create a chart type wich you want to display

// as GraphTypeRenderer

string grColor = "E61C1C";

PieGraphType pie = new PieGraphType();

pie.Colors = new List<string>(new string[] { "E61C1C", "462CDE", "3F9735" });

pie.Alpha = 60;

ret.GraphTypeRenderer = pie;

// Initialize XLables for the data set

graph.XLabels.Values.Add("Answer 1");

graph.XLabels.Values.Add("Answer 2");

graph.XLabels.Values.Add("Answer 3");

graph.XLabels.Values.Add("Answer 4");

graph.XLabels.Values.Add("Answer 5");

// Add Values to display

ret.Values.Add(3);

ret.Values.Add(3);

ret.Values.Add(7);

ret.Values.Add(12);

ret.Values.Add(1);

// Add data rendere to the Graph.Values collection

graph.Values.Add(ret);

The result:


Supported features

Now the API supports following chart types:

Chart types:

  • Bar chart
  • Glass chart
  • 3D chart
  • Fade chart
  • Sketch chart
  • Pie chart
  • Line chart (dot line, hollow line)

Ajax panel is also supported. To find out how to use the control there see demo web example.

Download

OpenFlashChartLib project and WebDemo available at CodePlex.

I am not first …

At the moment am writing this article there are two other similar api released. You can find them at Dot NET APIs page of Open Flash Chart Page. The functionality is almost the same except some features I coded here

  • Automatic SWFObject link to the page. The SWFObject is compiled to dll resources and the script include generated automatically.
  • JQuery flash registration. If you are using JQuery it is better to use JQuery flash plug in to embed flash object in the page. It can be set by EmbedScriptType property of OpenFlashChart control.
  • No need to create separate data page or handler you just handle DrawChart event. You can use generic data handler registered in web.config and chart data will be cached between postbacks. Or you can switch this feature off by setting SpecificDataHandler control’s property to any data renderer url.
Related posts: Open Flash Chart 2
Submit this story to DotNetKicks

Posted in: ASP.NET , Controls  Tags:

Currently rated 4.0 by 5 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5