Odd behavior in upgrade from 1.1 framework to 2.0

Discussion in 'ASP .Net' started by Blasting Cap, Jul 18, 2007.

  1. Blasting Cap

    Blasting Cap Guest

    I had a page that was working in Framework 1.1, that functions
    differently/incorrectly in framework 2.0.

    What happens is that in the old system I had some drill-down
    functionality that would display 4 lines that had the first cell as a
    hyperlink, and when you selected that item, it would collapse the 4
    items to 1 item, and then display the items underneath that one item,
    sub categories of Item 1.

    I've compared the code between the two, and it is identical.

    Here's what happens:

    if they select an item and keep drilling down, it performs as described
    above, until you get to the final drill-down where there are no more
    selections.

    The same code in Framework 2.0 functions wrong. The code - and it
    happens only on 1 datagrid -

    it makes a pass thru the data and returns the correct data, but for some
    inexplicable reason, it then does this same code AGAIN.

    Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)
    Handles DataGrid5.SelectedIndexChanged
    MyPage.Text = ""
    Item = ""
    cmbPO.Visible = False
    txtPO.Visible = False
    btnSubmit.Visible = False
    Button1.Visible = False
    lblPO.Visible = False
    DGPOClass.Visible = False
    SoldTo = ""
    ShipTo = ""
    DC = ""
    txtDGCustomer.Text = ""
    DGCustomer.SelectedIndex = -1
    DGPOList.Visible = False
    DGPOClass.SelectedIndex = -1

    If txtDG5.Text = "" Then
    txtDG5.Text =
    CStr(DataGrid5.DataKeys(DataGrid5.SelectedIndex)).Replace("'", "''")
    Customer()
    DGPOList.Visible = True
    DGPOClass.Visible = True
    DGCustomer.Visible = True
    Else
    DGPOList.Visible = False
    DGPOClass.Visible = False
    DGBOL.Visible = False
    txtDG5.Text = ""
    txtDG6.Text = ""
    DGCustomer.Visible = False
    End If
    orderval = 0
    shipval = 0
    SKU()
    End Sub


    What happens in the SKU() subroutine is that it re-reads the data and
    then re-binds the last sku to datagrid5.

    It's supposed to return data like this:

    First datagrid
    Item1
    Item2
    Item3
    Item4

    you select Item2 from above, the screen then has:
    Item2
    Item2.1
    Item2.2
    Item2.3

    you select item2.1 from above and you get:
    Item2
    Item2.1
    Item2.1.1
    Item2.1.2

    You select Item2.1.2 and you get
    Item2
    Item2.1
    Item2.1.2
    Customerdata (no more drill thru)


    What it's doing though is everything except the last step. However,
    stepping thru the code, I find that it's returning the right data, it's
    just this "extra" call to datagrid5_select that I can't figure out where
    it's coming from. As I said, the code for the datagrid & the sub itself
    are identical.

    Any ideas?

    BC
    Blasting Cap, Jul 18, 2007
    #1
    1. Advertising

  2. Blasting Cap

    Blasting Cap Guest

    I found the problem.

    Originally, the sub on this (and another one in the code) was:

    Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)


    When the code was converted to Visual Studio 2005 & .net framework 2.0,
    that same line of code became:

    Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)
    Handles DataGrid5.SelectedIndexChanged

    which was causing the datagrid5_select to execute twice.

    Just an FYI in case someone else hits a similar issue in upgrading to VS
    2005.

    BC



    Blasting Cap wrote:
    > I had a page that was working in Framework 1.1, that functions
    > differently/incorrectly in framework 2.0.
    >
    > What happens is that in the old system I had some drill-down
    > functionality that would display 4 lines that had the first cell as a
    > hyperlink, and when you selected that item, it would collapse the 4
    > items to 1 item, and then display the items underneath that one item,
    > sub categories of Item 1.
    >
    > I've compared the code between the two, and it is identical.
    >
    > Here's what happens:
    >
    > if they select an item and keep drilling down, it performs as described
    > above, until you get to the final drill-down where there are no more
    > selections.
    >
    > The same code in Framework 2.0 functions wrong. The code - and it
    > happens only on 1 datagrid -
    >
    > it makes a pass thru the data and returns the correct data, but for some
    > inexplicable reason, it then does this same code AGAIN.
    >
    > Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)
    > Handles DataGrid5.SelectedIndexChanged
    > MyPage.Text = ""
    > Item = ""
    > cmbPO.Visible = False
    > txtPO.Visible = False
    > btnSubmit.Visible = False
    > Button1.Visible = False
    > lblPO.Visible = False
    > DGPOClass.Visible = False
    > SoldTo = ""
    > ShipTo = ""
    > DC = ""
    > txtDGCustomer.Text = ""
    > DGCustomer.SelectedIndex = -1
    > DGPOList.Visible = False
    > DGPOClass.SelectedIndex = -1
    >
    > If txtDG5.Text = "" Then
    > txtDG5.Text =
    > CStr(DataGrid5.DataKeys(DataGrid5.SelectedIndex)).Replace("'", "''")
    > Customer()
    > DGPOList.Visible = True
    > DGPOClass.Visible = True
    > DGCustomer.Visible = True
    > Else
    > DGPOList.Visible = False
    > DGPOClass.Visible = False
    > DGBOL.Visible = False
    > txtDG5.Text = ""
    > txtDG6.Text = ""
    > DGCustomer.Visible = False
    > End If
    > orderval = 0
    > shipval = 0
    > SKU()
    > End Sub
    >
    >
    > What happens in the SKU() subroutine is that it re-reads the data and
    > then re-binds the last sku to datagrid5.
    >
    > It's supposed to return data like this:
    >
    > First datagrid
    > Item1
    > Item2
    > Item3
    > Item4
    >
    > you select Item2 from above, the screen then has:
    > Item2
    > Item2.1
    > Item2.2
    > Item2.3
    >
    > you select item2.1 from above and you get:
    > Item2
    > Item2.1
    > Item2.1.1
    > Item2.1.2
    >
    > You select Item2.1.2 and you get
    > Item2
    > Item2.1
    > Item2.1.2
    > Customerdata (no more drill thru)
    >
    >
    > What it's doing though is everything except the last step. However,
    > stepping thru the code, I find that it's returning the right data, it's
    > just this "extra" call to datagrid5_select that I can't figure out where
    > it's coming from. As I said, the code for the datagrid & the sub itself
    > are identical.
    >
    > Any ideas?
    >
    > BC
    Blasting Cap, Jul 20, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    349
    S. Justin Gengo
    Jul 24, 2003
  2. Joseph Geretz
    Replies:
    6
    Views:
    370
    Joseph Geretz
    Aug 24, 2003
  3. Michael Speer

    Odd behavior with odd code

    Michael Speer, Feb 16, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,062
    Richard Heathfield
    Feb 18, 2007
  4. Elliott  Roberts

    VERY odd classic ASP problem on 2005 upgrade

    Elliott Roberts, Mar 27, 2007, in forum: ASP General
    Replies:
    3
    Views:
    168
    Bob Barrows [MVP]
    Mar 28, 2007
  5. Replies:
    5
    Views:
    280
    Dr.Ruud
    Jul 5, 2006
Loading...

Share This Page