Step 1. Download and install MSChart.exe from :
http://www.microsoft.com/download/en/details.aspx?id=14422
Step2.Add following lines to web.config
<handlers>
...
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<assemblies>
....
<add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<controls>
....
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<httpHandlers>
...
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
Tuesday, April 24, 2012
dotnetnuke charts
Monday, April 16, 2012
dotnetnuke ajax example
1.Here we have two related drop down and when on selected , secod one will be repopulated with related values , here is javascript part of the code placed directly into ascx control.
2.Create jsonhub page for making ajax calls from different pages
3.Ad ajax calls inside of control:
<script type="text/javascript"> function PageMethod(fn, paramArray, successFn, errorFn) { //Create list of parameters in the form: //{"paramName1":"paramValue1","paramName2":"paramValue2"} var paramList = ''; if (paramArray.length > 0) { for (var i = 0; i < paramArray.length; i += 2) { if (paramList.length > 0) paramList += ','; paramList += '"' + paramArray[i] + '":"' + paramArray[i + 1] + '"'; } } paramList = '{' + paramList + '}'; //Call the page method $.ajax({ type: "POST", url: fn, contentType: "application/json; charset=utf-8", data: paramList, dataType: "json", success: successFn, error: errorFn }) ; } var TargetDD=''; function Repopulate(value, TargetDDId, url2call) { TargetDD = TargetDDId; PageMethod(url2call, ["Group", "" + value], AjaxSucceeded, AjaxFailed); //No parameters } function AjaxSucceeded(result) { //alert(result.d[0].FirstName); var elem = document.getElementById(TargetDD); $(elem).empty(); $.each(result.d, function (index, v1) { $(elem).append( $('<option></option>').val(v1.MembershipNumber).html(v1.FirstName + " " + v1.LastName) ); }); } function AjaxFailed(result) { alert("ajax failed" + result.d); } </script>
2.Create jsonhub page for making ajax calls from different pages
Imports DotNetNuke.Modules.MembershipModule Imports System.Web.Services Namespace NEvoWeb.Modules.NB_Store Public Class jsonhub Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub <WebMethod()> Public Shared Function MSearchVolunteersbyGroup(Group As Integer) As ArrayList Dim c As New MembershipModuleController Return c.MSearchVolunteersbyGroup(Group) End Function End Class End Namespace
3.Ad ajax calls inside of control:
Dim jscall As String = String.Format("Repopulate(this.value,'{0}','{1}');", ddlSalesRep.ClientID, Me.TemplateSourceDirectory + "/jsonhub.aspx/MSearchVolunteersbyGroup") ddlTeam.Attributes.Add("onchange", jscall)
Subscribe to:
Posts (Atom)