[RESOLVED] System.StackOverflowException was unhandled
I'm getting a "System.StackOverflowException was unhandled" exception here:
Code:
Private Sub showDetailsView_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles showDetailsView.DataBound
showDetailsView.DataBind()
End Sub
when the showDetailsView (a DetailsView component) is made visible by the detailsButton_Click event sub... Why is this happening, and how can I fix this issue?
Re: System.StackOverflowException was unhandled
The DataBind method raises the DataBound event. You're handling the DataBound event, and in it, you're calling DataBind. Repeat until stack overflow. Not sure why you're rebinding in the binding event.
The DataBind method is probably being called elsewhere on the page or automatically when you make it visible.
Re: System.StackOverflowException was unhandled
Hey,
jwesleycooper can you show the rest of your code? Or was Mendhak's suggestion enough? Have you been able to stop this exception happening?
Here is some more information:
http://msdn.microsoft.com/en-us/libr...24(VS.80).aspx
Gary
Re: System.StackOverflowException was unhandled
It seems that I just made a rather silly mistake :o What I should have done was place the showDetailsView.DataBind() line in my detailsButton_Click sub, to ensure that it is actually displaying the data pertinent to the latest user seletion. Guess that's what happens to my thought processes when I stay up three hours later than usual! :lol:
Re: [RESOLVED] System.StackOverflowException was unhandled
Ha ha, we have all been there!!
Glad you got it sorted!!
Gary