[MonoDevelop] Grid CS0103

Juan Alfredo de Martin 666lawyer at gmail.com
Tue Dec 16 12:46:50 EST 2008


I have the following one paginates with their codigo that gives the
error CS0103 in all the lineas that refer to GVAgente:


abmagente.aspx:

<%@ Page Language="C#" MasterPageFile="~/MPMenu.master"
AutoEventWireup="true" CodeFile="abmagente.aspx.cs"
Inherits="abmagente" Title="Untitled Page" Theme="pwd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

    <asp:Panel ID="Panel1" runat="server" Height="218px" Width="358px">

        <asp:GridView ID="GVAgente" runat="server" AutoGenerateColumns="False">

        </asp:GridView>

    </asp:Panel>

</asp:Content>

abmagente.cs:

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;



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

{

    GestionAgentes ga = new GestionAgentes();

    BoundField gridColumn;

    CommandField linkColumn;





    protected void Page_Load(object sender, EventArgs e)

    {

        String nick = (String)this.Session["user"];

        nick = nick.Trim();

        if (nick != "adm")

            this.Response.Redirect("Menu.aspx");





        GVAgente.RowCommand += new
GridViewCommandEventHandler(GVAgente_RowCommand);

        if (!this.IsPostBack)

        {

        gridColumn = new BoundField();

        gridColumn.DataField = "id";

        gridColumn.HeaderText = "ID";

        GVAgente.Columns.Add(gridColumn);



        gridColumn = new BoundField();

        gridColumn.DataField = "descripcion";

        gridColumn.HeaderText = "Agente";

        GVAgente.Columns.Add(gridColumn);



        linkColumn = new CommandField();

        linkColumn.SelectText = "ABM";

        linkColumn.ShowSelectButton = true;

        GVAgente.Columns.Add(linkColumn);

        GVAgente.AllowPaging = true;

        }





        GVAgente.DataSource = ga.GetAgentes();

        GVAgente.DataBind();

    }



    protected void GVAgente_SelectedIndexChanged(object sender, EventArgs e)

    {



    }



    protected void GVAgente_RowCommand(object sender,
GridViewCommandEventArgs e)

    {

        int pos = int.Parse(e.CommandArgument.ToString());

        int id = int.Parse(GVAgente.Rows[pos].Cells[0].Text);

        this.Session["id"] = id;

        this.Response.Redirect("detailagente.aspx");

    }

}


And nevertheless, in this another that has the same methods and
procedures, it does not give? ?????


<%@ Page Language="C#" MasterPageFile="~/MPMenu.master"
AutoEventWireup="true" CodeFile="abmotorgante.aspx.cs"
Inherits="abmotorgante" Title="Untitled Page" Theme="pwd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

    <asp:Panel ID="Panel1" runat="server" Height="184px" Width="358px">

        <asp:GridView ID="GVOtorgante" runat="server"
AutoGenerateColumns="False">

        </asp:GridView>

    </asp:Panel>

</asp:Content>


using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;



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

{

    GestionOtorgantes go = new GestionOtorgantes();

    BoundField gridColumn;

    CommandField linkColumn;





    protected void Page_Load(object sender, EventArgs e)

    {

        String nick = (String)this.Session["user"];

        nick = nick.Trim();

        if (nick != "adm")

            this.Response.Redirect("Menu.aspx");





        GVOtorgante.RowCommand += new
GridViewCommandEventHandler(GVOtorgante_RowCommand);

        if (!this.IsPostBack)

        {

            gridColumn = new BoundField();

            gridColumn.DataField = "id";

            gridColumn.HeaderText = "ID";

            GVOtorgante.Columns.Add(gridColumn);



            gridColumn = new BoundField();

            gridColumn.DataField = "descripcion";

            gridColumn.HeaderText = "Otorgante";

            GVOtorgante.Columns.Add(gridColumn);


            linkColumn = new CommandField();

            linkColumn.SelectText = "ABM";

            linkColumn.ShowSelectButton = true;

            GVOtorgante.Columns.Add(linkColumn);

            GVOtorgante.AllowPaging = true;

        }





        GVOtorgante.DataSource = go.GetOtorgantes();

        GVOtorgante.DataBind();

    }



    protected void GVOtorgante_SelectedIndexChanged(object sender, EventArgs e)

    {



    }



    protected void GVOtorgante_RowCommand(object sender,
GridViewCommandEventArgs e)

    {

        int pos = int.Parse(e.CommandArgument.ToString());

        int id = int.Parse(GVOtorgante.Rows[pos].Cells[0].Text);

        this.Session["id"] = id;

        this.Response.Redirect("detailOtorgante.aspx");

    }



}



I am job with monodevelop 1.0.  This it aborts to the first program
with error?.  Is a bug of monodevelop or of mono? This this running
perfectly in Windows


More information about the Monodevelop-list mailing list