Click here to Skip to main content
15,889,354 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Can I connect to MS SQL using HTML & JavaScript? Pin
Peter Leow10-Nov-13 16:39
professionalPeter Leow10-Nov-13 16:39 
QuestionOracle 10g connectivity issue with .net 2.0 website hosted on win 2008 server Pin
abhi17_66-Nov-13 4:20
abhi17_66-Nov-13 4:20 
QuestionImplement Custom Membership Provider in n-tier architecture Pin
Member 103823785-Nov-13 11:56
Member 103823785-Nov-13 11:56 
QuestionPage_init with variable Pin
vkEE4-Nov-13 2:30
vkEE4-Nov-13 2:30 
AnswerRe: Page_init with variable Pin
Gopi Kishan Mariyala11-Nov-13 3:52
Gopi Kishan Mariyala11-Nov-13 3:52 
QuestionThe name '###' does not exist in the current context - error Pin
miss7864-Nov-13 0:47
miss7864-Nov-13 0:47 
AnswerRe: The name '###' does not exist in the current context - error Pin
Richard Deeming4-Nov-13 1:38
mveRichard Deeming4-Nov-13 1:38 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss7864-Nov-13 3:38
miss7864-Nov-13 3:38 
Thank you so much for your response. I really appreciate your help.

I manage to solve the compile error but my application now output blank webpage on the client-side. I can not seem to figure out why, but would I have to invoke callback method on the asp.button?

I am trying to build an application which can filter test data and display visual charts using google charts API.

default.aspx
ASP.NET
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    

     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="//www.google.com/jsapi"></script>
    <script type="text/javascript">
        google.load('visualization', '1', { packages: ['corechart'] });
    </script>
    <script type="text/javascript">
        /*$(document).ready(function ()*/
        $('#Button1').click(function () {
            $.ajax({
                type: 'POST',
                dataType: 'json',
                contentType: 'application/json',
                url: 'Default.aspx/GetData',
               data: "{name:'" + $("#SearchText").val() + "'}",
                success:
                    function (response) {
                        drawVisualization(response.d);
                    }

            });
        })

        function drawVisualization(dataValues) {
            var data = new google.visualization.DataTable();
            data.addColumn('string', 'Column Date');
            data.addColumn('number', 'Column Value');

            for (var i = 0; i < dataValues.length; i++) {
                data.addRow([dataValues[i].Date, dataValues[i].Value]);
            }

            new google.visualization.LineChart(document.getElementById('visualization')).
                draw(data, { title: "" });
        }
 
         
    </script>

</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Visual Search Testing with 'iFrame
    </h2>
    

    <asp:Label ID="Label1" runat="server" Text="Name/Ids"></asp:Label>
   <asp:TextBox ID="SearchText" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Search" onclick="Button1_Click" />
    
    <div id="visualization" style="width: 600px; height: 400px;"></div>
    
    
</asp:Content>


default.cs
C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Data.SqlClient;
using System.Text;
using System.Collections.Generic;
using System.Web.Services;


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


//public partial class _Default : Data
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    [WebMethod]
    public static List<Data> GetData(string name)
    {
        List<Data> dataList = new List<Data>();

        dataList.Add(new Data("CLAVS 2007-1 M2A", 77, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 0, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 78, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 82, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 425, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 79, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 80, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 57, "Oct"));
        dataList.Add(new Data("CLAVS 2007-1 M2A", 77, "Oct"));
        dataList.Add(new Data("ACCDO 11A B", 2, "Sept"));
        dataList.Add(new Data("ACCDO 11A B", 2, "Sept"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 96.89, "Sept"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 95, "Sept"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 95, "Sept"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 96, "Oct"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 97, "Sept"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 95, "Oct"));
        dataList.Add(new Data("AELIS 2013-IRAR C", 85, "Sept"));

        return dataList.FindAll(r => r.ColumnName.Contains(name));




        //return dataList;
    }



    protected void Button1_Click(object sender, EventArgs e)
    {
        

    }
}


Any help would be very much appreciated.
Thanks
GeneralRe: The name '###' does not exist in the current context - error Pin
Richard Deeming4-Nov-13 4:38
mveRichard Deeming4-Nov-13 4:38 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss7865-Nov-13 0:54
miss7865-Nov-13 0:54 
GeneralRe: The name '###' does not exist in the current context - error Pin
Richard Deeming5-Nov-13 1:17
mveRichard Deeming5-Nov-13 1:17 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss7865-Nov-13 1:56
miss7865-Nov-13 1:56 
GeneralRe: The name '###' does not exist in the current context - error Pin
Richard Deeming5-Nov-13 2:04
mveRichard Deeming5-Nov-13 2:04 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss7865-Nov-13 2:56
miss7865-Nov-13 2:56 
GeneralRe: The name '###' does not exist in the current context - error Pin
Richard Deeming5-Nov-13 3:13
mveRichard Deeming5-Nov-13 3:13 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss7865-Nov-13 3:47
miss7865-Nov-13 3:47 
GeneralRe: The name '###' does not exist in the current context - error Pin
Richard Deeming5-Nov-13 4:14
mveRichard Deeming5-Nov-13 4:14 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss7865-Nov-13 4:28
miss7865-Nov-13 4:28 
GeneralRe: The name '###' does not exist in the current context - error Pin
Richard Deeming5-Nov-13 4:34
mveRichard Deeming5-Nov-13 4:34 
GeneralRe: The name '###' does not exist in the current context - error Pin
miss78611-Nov-13 3:28
miss78611-Nov-13 3:28 
QuestionASP Buttons event not firing Pin
Blikkies3-Nov-13 19:18
professionalBlikkies3-Nov-13 19:18 
AnswerRe: ASP Buttons event not firing Pin
Joshua Omundson4-Nov-13 4:16
Joshua Omundson4-Nov-13 4:16 
GeneralRe: ASP Buttons event not firing Pin
Blikkies4-Nov-13 5:06
professionalBlikkies4-Nov-13 5:06 
GeneralRe: ASP Buttons event not firing Pin
Joshua Omundson5-Nov-13 12:28
Joshua Omundson5-Nov-13 12:28 
GeneralRe: ASP Buttons event not firing Pin
Blikkies5-Nov-13 21:00
professionalBlikkies5-Nov-13 21:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.