locked
Index was outside the bounds of the array ASP.NET RRS feed

  • Question

  •  

    Index was outside the bounds of the array.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       Continental.IngresarAntena.Mapa_Click(Object sender, ImageClickEventArgs e) +371
       System.Web.UI.ImageClickEventHandler.Invoke(Object sender, ImageClickEventArgs e) +0
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
       System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    


    it gives me this error when i click a imagebutton in my asp form.... but i dont have any code... ANY HELP please?

    protected

     

    void Mapa_Click(object sender, ImageClickEventArgs e)

    {

     

    //string[] dir = Mapa.ImageUrl.ToString().Split('/');

     

    //Response.Write(dir[0]);

     

    //System.Drawing.Image imagen = System.Drawing.Image.FromFile(Server.MapPath(dir[0] + "/" + dir[1] + "/" + dir[2] + "/" + dir[3]));

     

    //Graphics graph = Graphics.FromImage(imagen);

     

    //Pen p = new Pen(Brushes.Green);

     

    //if(File.Exists(Server.MapPath("images") + "\\image.jpg"))

     

    //{

     

    // File.Delete(Server.MapPath("images") + "\\image.jpg");

     

    //}

     

    //string SaveLocation = Server.MapPath("images") + "\\ONLINE.ico";

     

    //Icon icono = new Icon(SaveLocation, 260, 260);

     

    //graph.DrawIcon(icono, e.X, e.Y);

     

    //SaveLocation = Server.MapPath("images") + "\\image.jpg";

     

    //imagen.Save(SaveLocation, System.Drawing.Imaging.ImageFormat.Jpeg);

     

    ////imagen.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);

     

    //imagen.Dispose();

     

    //string hola = Server.MapPath("images");

     

    //Mapa.ImageUrl = "images/image.jpg";

    TextBox11.Text = e.X.ToString() +

    "," + e.Y.ToString();

    }


    • Moved by YiChun Chen Friday, August 21, 2009 7:44 AM It's off topic here. (From:.NET Framework Setup)
    Wednesday, August 19, 2009 9:50 PM

Answers

  • Hi
    All i can do to help u is
    This is .Net Framework Setup Forum

    Post ur thread here
    http://forums.asp.net/

    Thanks
    anliS
    Regards anliS www.businessinsightsconsulting.com Please remember to mark the correct replies as answers
    • Marked as answer by YiChun Chen Friday, August 21, 2009 7:44 AM
    Thursday, August 20, 2009 5:36 AM