M
Micke Palm
Hello!
I've done a little test. I try to fill up a listbox (dropdown) with 35000
posts. Check the code below and it's works fine ,but when I want do the same
thing with apsnet ,but in aspnet way it hangs.
The ASP code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<p><select size="5" name="D1" multiple>
<%
for tt = 0 to 35000
sData = "123456789123456789 Number = " & CStr(tt) %>
<option><% =sData %></option>
<%
iBytes = iBytes + Len(sData)
next
%>
</select>
<% response.Write "Bytes: " & iBytes %>
</p>
</form>
</body>
</html>
The ASPNET code...You must have webcontrols like ListBox1 and Label1
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
Dim iBytes As Integer
Dim sData As String
If Not IsPostBack Then
Dim tt As Integer
For tt = 0 To 14000
sData = "123456789123456789 Number = " & CStr(tt)
'sData = tt
ListBox1.Items.Add(New ListItem(sData, CStr(tt)))
iBytes += Len(sData)
Next tt
Label1.Text = "Count of characters: " & iBytes
End If
End Sub
Do anyone have any ideas why ASPNET is so much slower and hangs after a
while. 10000 works fine but not 14000 and it depends on how much data I've
for each row. So I guess it checking how much data it is in the listbox.
A strange thing is that ASP is much faster than ASPNET in this case??
/regards, micke
I've done a little test. I try to fill up a listbox (dropdown) with 35000
posts. Check the code below and it's works fine ,but when I want do the same
thing with apsnet ,but in aspnet way it hangs.
The ASP code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<p><select size="5" name="D1" multiple>
<%
for tt = 0 to 35000
sData = "123456789123456789 Number = " & CStr(tt) %>
<option><% =sData %></option>
<%
iBytes = iBytes + Len(sData)
next
%>
</select>
<% response.Write "Bytes: " & iBytes %>
</p>
</form>
</body>
</html>
The ASPNET code...You must have webcontrols like ListBox1 and Label1
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
Dim iBytes As Integer
Dim sData As String
If Not IsPostBack Then
Dim tt As Integer
For tt = 0 To 14000
sData = "123456789123456789 Number = " & CStr(tt)
'sData = tt
ListBox1.Items.Add(New ListItem(sData, CStr(tt)))
iBytes += Len(sData)
Next tt
Label1.Text = "Count of characters: " & iBytes
End If
End Sub
Do anyone have any ideas why ASPNET is so much slower and hangs after a
while. 10000 works fine but not 14000 and it depends on how much data I've
for each row. So I guess it checking how much data it is in the listbox.
A strange thing is that ASP is much faster than ASPNET in this case??
/regards, micke