回发导致延迟

编程入门 行业动态 更新时间:2024-10-26 23:41:17
本文介绍了回发导致延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个下拉列表,从数据库,几个文本框, 和页面上的几个按钮填充。 ddl设置为autopostback。 出于某种原因,每当发生回发时(当选择ddl 中的项目或单击按钮时)页面立即处理 并被发送回浏览器,但在浏览器显示页面的前50-75%后,它会停止约60秒之前 显示其余部分。 据我所知,这不是服务器问题,因为我设置了 trace = true,页面在不到一秒的时间内处理完毕。然而,在我的WinXP计算机上的IE6.0和Firefox 1.0.7中,同样的事情发生在我的Win2000计算机上的和IE5.5中,所以我是不确定问题在哪里 是。唯一的客户端代码是javascript,用于将焦点设置为 第一个文本框:document.getElementById(" tb_prefix")。focus(); 和服务器 - 生成_doPostBack函数。 任何想法? 谢谢

I have a drop-down list, populated from a database, a few text boxes, and a few buttons on a page. The ddl is set to autopostback. For some reason, whenever a postback happens (when an item in the ddl is selected or a button is clicked) the page is processed immediately and is sent back to the browser, but after the browser displays the first 50-75% of the page, it stops for about 60 seconds before displaying the rest. As far as I can tell it''s not a server problem, because I set trace=true and the page was processed in less than a second. However, the same thing happens in IE6.0 and Firefox 1.0.7 on my WinXP computer and in IE5.5 on my Win2000 computer, so I''m not sure where the problem is. The only client-side code is javascript to set the focus to the first textbox: document.getElementById("tb_prefix").focus(); and the server-generated _doPostBack function. Any ideas? Thanks

推荐答案

更正:它是一个列表框,而不是下拉列表 Correction: it''s a listbox, not a drop-down list

在ASP中我们通过设置Response.Buffer来解决这个问题= true所以 页面的所有控件和内容都将在页面显示之前处理。我怀疑这是一个控件,它给予Response对象一个很难的时间。例如,你如何填充ListBox?杀死ViewState 并测试页面等等。 <%= Clinton Gallagher METROmilwaukee(sm)A Regional Information Service ; NET csgallagher AT metromilwaukee URL http ://metromilwaukee/ URL http:/ /clintongallagher.metromilwaukee/ " wizard04" <无线********** @ hotmail>在消息中写道 news:11 ********************* @ z14g2000cwz.googlegro ups ... In ASP we used to solve this problem by setting Response.Buffer = true so all controls and contents of the page would be processed before the page was displayed. I suspect the is a control that is giving the Response object a hard time. How are you populating the ListBox for example? Kill ViewState and test the page and so on. <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT metromilwaukee URL metromilwaukee/ URL clintongallagher.metromilwaukee/ "wizard04" <wi**********@hotmail> wrote in message news:11*********************@z14g2000cwz.googlegro ups... 更正:它是一个列表框,而不是一个下拉列表 Correction: it''s a listbox, not a drop-down list

我在页面首次加载时填充列表框,当时从列表中删除了一个项目 (其中一个按钮),或者添加了一个项目或更新了 (另一个按钮)。我使用如下函数: Sub doDataBind() Dim ds As New System.Data.DataSet Dim sql As String Dim myDbConnection作为OleDbConnection Dim myDbCommand作为OleDbCommand Dim myDbDataAdapter作为OleDbDataAdapter sql = _ " SELECT *" &安培; _ 来自客户 &安培; _ " ORDER BY LastName,FirstName,UserName" myDbConnection =新的OleDbConnection(strConn_ReportCards) myDbCommand =新的OleDbCommand (sql,myDbConnection) myDbDataAdapter =新OleDbDataAdapter(myDbCommand) myDbDataAdapter.Fill(ds) myDbConnection.Close() lb_customers.DataSource = ds lb_customers.DataBind() End Sub ,strConn_ReportCards是我的Access 数据库的连接字符串。 我刚尝试关闭viewstate @Page指令,但是 没有帮助。 I''m populating the listbox when the page first loads, when an item is removed from the list (one of the buttons), or when an item is added or updated (another button). I use a function as follows: Sub doDataBind() Dim ds As New System.Data.DataSet Dim sql As String Dim myDbConnection As OleDbConnection Dim myDbCommand As OleDbCommand Dim myDbDataAdapter As OleDbDataAdapter sql = _ "SELECT * " & _ "FROM Customer " & _ "ORDER BY LastName, FirstName, UserName" myDbConnection = New OleDbConnection(strConn_ReportCards) myDbCommand = New OleDbCommand(sql, myDbConnection) myDbDataAdapter = New OleDbDataAdapter(myDbCommand) myDbDataAdapter.Fill(ds) myDbConnection.Close() lb_customers.DataSource = ds lb_customers.DataBind() End Sub with strConn_ReportCards being the connection string to my Access database. I just tried turning off viewstate in the @Page directive, but that didn''t help.

更多推荐

回发导致延迟

本文发布于:2023-11-25 01:13:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627713.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!