Page hangs on resize

G

Guest

If anyone can point me in the right direction it would be most appreciated.

I find that if I change the page size, either maximize or restore down, my
web app freezes. I've put breakpoints in every conceivable place. There's
nothing in the event viewer. I know there is an error somewhere, but I don't
see it. This site is extremely simple.

Each page contains an editable datagrid. The datasets bound to each grid
contain no more than 50 records. Each page contains the same code.

BindData
Editdatagrid
Updatedatagrid
InsertNewRecord

Below is a snip of one page:
===============================================
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Try
PLUser = Session("Current")

If IsPostBack = False Then
BindData()
Else
PLForm = Session("PLFORM")
End If

Catch ex As Exception

End Try

End Sub

Private Sub BindData()
Try
PLForm = PLForm.Load(FORMID)

Session("PLFORM") = PLForm

Catch ex As Exception

End Try

Try
If PLUser.SecurityLevel < 3 Then
PLForm = AddRow(PLForm)
End If
Catch ex As Exception

End Try

Try
dgPayouts.CssClass = "datagrid"
dgPayouts.HeaderStyle.CssClass = "headerstyle"
dgPayouts.ItemStyle.CssClass = "itemstyle"
dgPayouts.SelectedItemStyle.CssClass = "selecteditemstyle"
dgPayouts.EditItemStyle.CssClass = "edititemstyle"


dgPayouts.DataSource = PLForm.DataEntry
dgPayouts.DataBind()

Catch ex As Exception

End Try


End Sub

Private Sub dgPayouts_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgPayouts.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Or _
e.Item.ItemType = ListItemType.SelectedItem Or _
e.Item.ItemType = ListItemType.Item.EditItem Then

Dim btn As New WebControls.Button
Dim iCount As Int32
Dim dgi As New BoundColumn

Try
If PLUser.SecurityLevel < 3 Then
dgi = dgPayouts.Columns(1)
dgi.ReadOnly = False

dgi = dgPayouts.Columns(3)
dgi.ReadOnly = False
End If
Catch ex As Exception

End Try


Try

For iCount = 0 To e.Item.Cells(0).Controls.Count - 1

If TypeOf e.Item.Cells(0).Controls(iCount) Is
WebControls.Button Then
btn = e.Item.Cells(0).Controls(iCount)
btn.CssClass = "datagridButton"

If PLUser.SecurityLevel < 3 Then
If e.Item.ItemIndex = 0 And btn.Text = "Edit" Then
btn.Text = "New"
End If
End If

End If
Next
Catch ex As Exception

End Try

End If
End Sub

Public Sub dgPayouts_EditCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgPayouts.EditCommand
Dim dgColEdit As New BoundColumn
Dim iCount As Int32
Dim txt As TextBox

Try
dgPayouts.EditItemIndex = e.Item.ItemIndex
BindData()

Catch ex As Exception
Response.Write(ex.Message)
End Try


End Sub

Public Sub dgPayouts_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgPayouts.UpdateCommand
Dim paramData() As Object
Dim iCount As Int32
Dim txt As New TextBox
Dim ds As New DataSet
Dim bolSuccess As Boolean

ReDim paramData(e.Item.Cells.Count - 1)

Try
If PLForm Is Nothing Then
PLForm = Session("PLFORM")
ds = PLForm.DataEntry
Else
ds = PLForm.DataEntry
End If
Catch ex As Exception

End Try

Try
For iCount = 0 To e.Item.Cells.Count - 1
Select Case iCount
Case 0
paramData.SetValue(PLUser.SecurityLevel, iCount)
Case 1, 3
paramData.SetValue(e.Item.Cells(iCount).Text, iCount)
Case 2

paramData.SetValue(ds.Tables(0).Rows(iCount).Item(1), iCount)
Case Is > 3
txt = e.Item.Cells(iCount).Controls(0)
paramData.SetValue(txt.Text, iCount)
End Select
Next

Catch ex As Exception
Response.Write(ex.Message)

End Try

Try

bolSuccess = PLForm.Save(PLForm, PLUser.LogonId,
PLUser.SecurityLevel, FORMID, paramData)

If bolSuccess = True Then
BindData()
Else
lblErrMsg.Visible = True
lblErrMsg.Text = "Error saving data." '"Error saving data.
This issue has been reported"
End If
Catch ex As Exception

End Try

End Sub

Private Function AddRow(ByVal plform As PL_BusinessRules.PL_DataEntry)
As PL_BusinessRules.PL_DataEntry

Dim ds As New DataSet
Dim dt As New DataTable
Dim dr As DataRow

Try
ds = plform.DataEntry

dr = ds.Tables(0).NewRow

dr.Item("RECORD_SORT_ORDER") = "0"

ds.Tables(0).Rows.InsertAt(dr, 0)
plform.DataEntry = ds

Return plform

Catch ex As Exception

End Try


End Function

#End Region

End Class
 
G

Guest

Changing the page size does not cause a post back so it is not anything to do
with your code or your web ap. Have you tried this from several machines, it
is probably a client thing, dodgy browser/windows instalation or somesuch.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top