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

ASP.NET

 
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 
I doubt having the file under App_Code would make any difference.

Here's the entire file I'm using to test. I have a different master page, a different file name, and I'm not using a code-behind, but otherwise everything should be the same:

ASP
<%@ Page Language="C#"
    MasterPageFile="~/_controls/Site.master"
    Title="Chart Test"
%>

<%@ Import Namespace="System.Web.Services" %>

<script runat="server">

public class Data
{
    public string ColumnName;
    public double Value;
    public string Date;

    public Data(string name, double price, string date)
    {
        ColumnName = name;
        Value = price;
        Date = date;
    }
}

[WebMethod]
public static List<Data> GetData(string name)
{
    var 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.IndexOf(name, StringComparison.CurrentCultureIgnoreCase) != -1);
}

</script>

<asp:content runat="server" contentPlaceHolderID="bodyContentPlaceholder">
<form runat="server">

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


    <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: 'chart.aspx/GetData',
            data: "{name:'" + $("#SearchText").val() + "'}",
            success:
                function (response) {
                    drawVisualization(response.d);
                }

        });
        
        return false;
    });

    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>

</form>
</asp:content>




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


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 
QuestionNeeds help for DirectoryEntry.Invoke ("ChangePassword","Old_Pass","New_Pass") method Pin
tiyyob2-Nov-13 0:42
tiyyob2-Nov-13 0:42 
Questionpc-phone,mobile dialer Pin
kalaiselvansurya2-Nov-13 0:14
kalaiselvansurya2-Nov-13 0:14 
AnswerRe: pc-phone,mobile dialer Pin
Mycroft Holmes2-Nov-13 1:10
professionalMycroft Holmes2-Nov-13 1:10 
QuestionDelegate Pin
Member 103756361-Nov-13 21:42
Member 103756361-Nov-13 21:42 
AnswerRe: Delegate Pin
Richard MacCutchan1-Nov-13 23:49
mveRichard MacCutchan1-Nov-13 23:49 
AnswerRe: Delegate Pin
Bernhard Hiller4-Nov-13 3:13
Bernhard Hiller4-Nov-13 3:13 
QuestionMVC4 Ajax call does not reach controller method Pin
MYSHKSL1-Nov-13 10:46
MYSHKSL1-Nov-13 10:46 
SuggestionRe: MVC4 Ajax call does not reach controller method Pin
Richard Deeming1-Nov-13 10:50
mveRichard Deeming1-Nov-13 10:50 
AnswerRe: MVC4 Ajax call does not reach controller method Pin
Pratik Bhuva1-Nov-13 22:29
professionalPratik Bhuva1-Nov-13 22:29 
QuestionHow to rebind more three RadGrid after close the RadWindow Pin
Rahul_Pandit1-Nov-13 2:08
Rahul_Pandit1-Nov-13 2:08 
SuggestionRe: How to rebind more three RadGrid after close the RadWindow Pin
Richard Deeming1-Nov-13 3:06
mveRichard Deeming1-Nov-13 3:06 

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.