Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. PageIndex change gives error from 2nd to 1st page

PageIndex change gives error from 2nd to 1st page

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesignhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bubberz
    wrote on last edited by
    #1

    With only one record on my 2nd page in my datagrid, when I go from page 2 to page 1 in my Datagrid (ASP.NET v1.1), I get: Input string was not in a correct format. [FormatException: Input string was not in a correct format.] Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +193 Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +92 [InvalidCastException: Cast from string "" to type 'Integer' is not valid.] Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +206 Work_PackageVBConvert_P3E.SARESTableSubform.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) +185 System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +109 System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138 System.Web.UI.Page.ProcessRequestMain() +1292 **************************************************************** I have no idea what's going on or why this is happening. If I add another record to my datagrid, and now I have two rows on my second page, I can go to the first page successfully. The PageIndexChanged routine is simply: DataGrid1.CurrentPageIndex = e.NewPageIndex Call DG() Any ideas? Thanks!

    M 1 Reply Last reply
    0
    • B bubberz

      With only one record on my 2nd page in my datagrid, when I go from page 2 to page 1 in my Datagrid (ASP.NET v1.1), I get: Input string was not in a correct format. [FormatException: Input string was not in a correct format.] Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +193 Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +92 [InvalidCastException: Cast from string "" to type 'Integer' is not valid.] Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +206 Work_PackageVBConvert_P3E.SARESTableSubform.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) +185 System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +109 System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138 System.Web.UI.Page.ProcessRequestMain() +1292 **************************************************************** I have no idea what's going on or why this is happening. If I add another record to my datagrid, and now I have two rows on my second page, I can go to the first page successfully. The PageIndexChanged routine is simply: DataGrid1.CurrentPageIndex = e.NewPageIndex Call DG() Any ideas? Thanks!

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      AFAIF many people have the similar problem and one of the reasons is the bug in the ASP.NET 1.1, so you may want to search for the Microsoft KB. However, the error stack tells me that the control was deleting something as the DeleteCommand event gets fired ????

      B 1 Reply Last reply
      0
      • M minhpc_bk

        AFAIF many people have the similar problem and one of the reasons is the bug in the ASP.NET 1.1, so you may want to search for the Microsoft KB. However, the error stack tells me that the control was deleting something as the DeleteCommand event gets fired ????

        B Offline
        B Offline
        bubberz
        wrote on last edited by
        #3

        ...and that's what I couldn't figure out as far as the DeleteCommand getting fired. When there are two records on the 2nd page, there's no exception thrown when I click the #1 page link. If I delete one record from the 2nd page and now there's only 1 record on that page, the exception get's thrown when I click the link to go to page #1. Why does the DeleteCommand get fired when I click the page #1 link? I tested my original datagrid, and it doesn't do this...it's works fine. The only difference is the edit item template for this current datagrid where I put two dropdown lists and two text boxes in one column, so the user didn't have to scroll horizontally. The original datagrid, which changes my 4th text box/column to a ddl, and my 6th textbox/column to a ddl doesn't throw any errors. Weird......but at least it's a better UI than before, and I just display a tiny error message. Thanks!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups