Thursday 26 July 2012

How to solve google appengine error - Another transaction by user already in progress for app


         The following error occurs in google app engine

         Another transaction by user already in progress for app


        In this post i'm  going to explain how to solve the app engine error

step1: 

        open command  prompt  


step2: 

        navigate  to   C:\Program Files\Google\google_appengine


step3:

       enter   the  following  command

      appcfg.py rollback  C:\Users\subash\Desktop\vs


     note(appcfg.py  python file inside  C:\Program Files\Google\google_appengine

     C:\Users\subash\Desktop\vs  --  your project directory)

Monday 16 July 2012

Dynamic Google Chart Updation

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      

      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {

        var x=Math.ceil(100*Math.random());
        var y=Math.ceil(100*Math.random());
        var z=Math.ceil(100*Math.random());
        var a=Math.ceil(100*Math.random());

        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales'],
          ['2004',  x],
          ['2005',  y],
          ['2006',  z],
          ['2007',  a]
        ]);

        var options = {
          title: 'Company Performance'
        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
      function interval()
      {
          setInterval(function (){draw()},3000);
      }
      
      function draw()
      {
        
        drawChart();
      }
    </script>
  </head>
  <body onload="interval()">
    <div id="chart_div" style="width: 400px; height: 200px;"></div>
  </body>
</html>

Passing Variables To Javascript From ASP.net Code Behind


The Code Behind Page is as Follows


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



namespace script
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string name = "bose";

 Page.ClientScript.RegisterClientScriptBlock(typeof(Page),
                    "snipet1","<script type='text/javascript'> 
                     var y='"+name+"'</script>"); 
       }
    }
}


The ASPX page code is as follows
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="script._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function al()
        {

            alert(y);

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button OnClientClick="al()" ID="Button1"
                runat="server" Text="Button" />
    </div>
    </form>
</body>
</html>