Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Odd behavior in upgrade from 1.1 framework to 2.0

Reply
Thread Tools

Odd behavior in upgrade from 1.1 framework to 2.0

 
 
Blasting Cap
Guest
Posts: n/a
 
      07-18-2007
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
 
Reply With Quote
 
 
 
 
Blasting Cap
Guest
Posts: n/a
 
      07-20-2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd behavior with odd code Michael Speer C Programming 33 02-18-2007 07:31 AM
VERY odd routing behavior when attempting VPN connections over Wifi Robert Gordon Wireless Networking 0 08-25-2005 04:04 PM
Firefox under Linux -- odd behavior Dennis J. Tuchler Firefox 0 07-28-2004 04:05 PM
Odd behavior behind the PIX Charles Haron Cisco 1 04-21-2004 04:05 AM
Odd console behavior on Cat 5005 Mike Voss Cisco 0 11-19-2003 10:49 PM



Advertisments