进入网页时会报错,刷新后又恢复正常?

进入网页时会报错,刷新一下就好了,估计是当网页打开的时候某个文件没加载进来,请问这种情况有没有什么解法?
![图片说明](https://img-ask.csdn.net/upload/201810/16/1539676733_800700.png)图片说明

4个回答

报的是未能实例化的错误,因为当打开这个页面时,js文件还没加载完成,所以未能执行到angler.module导致的这个错误,所以定义手动加载ng-app,问题解决

可以用懒加载的方式 不要一次性加载全部内容 根据网页加载情况异步加载所需要的内容

需要调整js文件的加载顺序,自己写的要放到最后下面,其他的要看看js文件如果有依赖的话,保证被依赖的放在他的前面;

一般都是依赖问题,js的加载顺序是由上至下逐次加载,比如一个js需要依赖jq,但jq刚好没有加载进来就会报错,如果你强制刷新应该还会报错!检查一般来说一下依赖就可以

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
发布到服务器后出现以下问题,刷新地址栏后又恢复正常了。。。
发布到服务器后出现以下问题,刷新地址栏后又恢复正常了。。。rnServer Error in '/' Application.rnrn拒绝访问。rnrnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.ComponentModel.Win32Exception: 拒绝访问。rnrnSource Error: rnrnAn unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.rnrnStack Trace: rnrnrn[Win32Exception (0x80004005): 拒绝访问。]rnrn[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]rn System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6675958rn System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +688rn System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6702504rn System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219rn System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6704598rn System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6705099rn System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) +610rn System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1049rn System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +74rn System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) +6707667rn System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) +78rn System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2192rn System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116rn System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1012rn System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6712291rn System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +152rn System.Data.SqlClient.SqlConnection.Open() +229rn VKMoviesMVC.Models.DAL.GredaDal.SelectGradeAll() +161rn VKMoviesMVC.Controllers.Ks5uVKController.Index(Int32 subId, Nullable`1 page) +125rn lambda_method(Closure , ControllerBase , Object[] ) +156rn System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +274rn System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39rn System.Web.Mvc.Async.<>c__DisplayClass39.b__33() +120rn System.Web.Mvc.Async.<>c__DisplayClass4f.b__49() +452rn System.Web.Mvc.Async.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) +15rn System.Web.Mvc.Async.<>c__DisplayClass2a.b__20() +33rn System.Web.Mvc.Async.<>c__DisplayClass25.b__22(IAsyncResult asyncResult) +240rn System.Web.Mvc.<>c__DisplayClass1d.b__18(IAsyncResult asyncResult) +28rn System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +15rn System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53rn System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +15rn System.Web.Mvc.<>c__DisplayClass8.b__3(IAsyncResult asyncResult) +42rn System.Web.Mvc.Async.<>c__DisplayClass4.b__3(IAsyncResult ar) +15rn System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606rn System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288rnrnVersion Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
关于网页刷新的问题,高手请进入。
本人做了一个JSP的网页,有一个页面是用全局的Session变量来动态显示网页的。rn如果Session变量的值发生了变化,则网页的内容也应该发生相应的改变,但现在出现如下的问题:rn1.用地址http://laixiangbin:8080/aaa/aaa.jsp访问(其中laixiangbin为服务器的机器名),则该网页可以刷新。rnrn2.而用ip方式http://laixiangbin:8080/aaa/aaa.jsp访问则网页没有根据session的变量发生相应的变化,始终显示session变量第一次的值。rnrn请高手给予指点,谢谢。
网页中图片未下载,刷新后又正常
最近我的电脑经常出现点击某一网页链接,提示服务器无响应,刷新后又正常;有时又出现网页中某些图片未下载,刷新后又正常.别人浏览我机上的网页也会出现这种情况,请问我的机器怎么了?
为什么delete时会报错
源代码如下:rnrnvoid main()rnrn int i,j;rn double **p;rn p=new double*[1000];rnrn for (int m=0;m<5000;m++)rn rn p[m]=new double[5000];rn rn clock_t beg, end; rn double time;rn beg=clock();rn for (i=0; i<1000; i++) rn rn for (j=0; j<5000; j++) rn rn p[i][j]=0.5;rn rn rn rn for (i=0; i<1000; i++) rn for (j=0; j<5000; j++) rn p[i][j]=p[i][j]*p[i][j]+2.0*p[i][j]+10.0;rn rn rn rn end=clock();rn time=(double)(end-beg)/CLOCKS_PER_SEC;rn printf("Compute time is %f seconds\n",time);rn for (int n=0;n<5000;n++)rn rn delete[] p[n];rn rn delete[] p;rnrnrn报错:file:dbgdel.cpprn line:47 rn Expression:_BLOCK_TYPE_IS_VALID(pHesd->nBlockUse)
GridView的设置失效,刷新后恢复正常?
在page_load事件中,对gridview的显示方式进行设置如下:rn rn protected void Page_Load(object sender, EventArgs e)rn rn for (int i = 0; i < GridView1.Rows.Count; i++)// 给每一行都添加事件 rn rn GridView1.Rows[i].Cells[0].Attributes.Add("style", "cursor:hand"); // 设置鼠标移动到第一列时,鼠标以手形显示rn GridView1.Rows[i].Cells[0].Attributes.Add("onclick", "window.open('Display.aspx?KSBH=" + GridView1.Rows[i].Cells[1].Text + " ')"); // 点击事件,打开新页,并传递参数rn GridView1.Rows[i].Attributes.Add("onmouseover", "CurrentColor=this.style.backgroundColor;this.style.backgroundColor='#aaaaaa'"); // 鼠标经过,改变背景色rn GridView1.Rows[i].Attributes.Add("onmouseout", "this.style.backgroundColor=CurrentColor"); // 鼠标离开,恢复背景色rn rn rnrngridview有编辑功能,在编辑之后,上面的设置就失效了,刷新页面后恢复正常。rn为何?如何解决呢?
刷新报错
页面上设置一个button,后台代码调用数据库,但不切换到另一个页面。点击该按纽后,再点击IE的刷新按纽就会出错,跳出一个对话框,提示:rn“不发送信息,则无法刷新网页。请单击“重试”再次发送,或单击“取消”返回正查看的页”rnwhy?
没分了,我的网页刷新时有时会跳出
网页发生错误,以后您在状态蓝警告点两下就可以显示rnrn行:1rn字元:33rn错误:必须要有')'rn程试码:0rnurl" http//loclhost/.........../from.aspxrnrn这是什么意思呀rn怎么排处错误呢?rn真心谢谢各位rn
每次进入fragment刷新
//每次进入fragment刷新 //    @Override //    public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) { //        //   进入当前Fragment //        if (enter &amp;amp;&amp;amp; !isGetData) { //       ...
网页刷新
怎样使网页每次都刷新,rn也就是网页立即失效
网页的刷新
我得网页1含asp程序,点击链接打开一个小窗口就是window.open(url这种形式打开一个窗口,进行修改里面的一项信息,修改以后还是利用这个小窗口返回成功或是失败的信息,然后就想关闭这个小窗口同时刷新最开始的网页1,应该如何解决呀
【求助】HTTP400 错误,刷新后又变正常
大家好。rnrn【问题】rnjsp页面,公司内部测试没有问题,外部访问时,出现了http400错误,页面没有显示,此时刷新一下,页面又可以正常显示了。rnrn网上搜了一下,据说是url指定重复,我检查了没有重复的url;rn还有人说是缓存问题,我又在jsp中添加了如下代码,rn response.setHeader("Pragma","No-cache"); rn response.setHeader("Cache-Control","no-cache"); rn response.setDateHeader("Expires", 0);rnrn可是问题依然出现。rnrn请教各位,这究竟是什么问题呢?如何解决呢?rnrn谢谢。rn
在WIN2000下tcpclient.SendData时会报错,为什么?
在WIN2000下执行tcpclient.SendData时报“实时错误 40006,所需事物或请求的错误协议或连接状态”,而在WIN98下运行正常,为什么?请各位高手帮帮我!
WIN200刷新就停顿而后又复活!!!!
我的电脑WIN2000,我系统管理员改了一下"管理工具"中的"服务"后,我在桌面上刷新一下,电脑就死机过一下子又复活,,,
部分图片不显示,刷新后又显示
rn 页面 [url=http://www.sx881.com/kuaican.aspx][/url]rnrn 打开时所有图均显示,但点击 "乐佳基" 时发现部分图片不显示,刷新后显示. 不知何故(暂排除网速原因)rnrn 显示打开上面的网址,第一次显示的也就是"乐佳基"的东西,点击 "乐佳基" 显示的也还是一样的数据.kuaican.aspxrnrn 中默认的也就是 kuaican.aspx?id=334rnrn 注:本人IE浏览器(IE8)一切正常.rnrn 另外不知何故,当我的IE8使用"兼容性视图"时,那个有斜线背景的div上下都有约20px左右的距离.rn 不使用时一切正常.
为什么退出表单时会报错?
在退出表单时,我一次选择使用过的工作区并用use关闭所有的表,最后用sele 1选择一个不用的工作区,并使用了close all和release thisformrn但退出时仍会报错说cannot access the selected tablern哪位大虾可否指点一二?深表感谢
javaeye恢复正常了
今天在这里记上一笔,做个纪念,javaeye在关闭了两天后终于在今天ok了,javaeye关闭的这两天经常不自觉的输入网址,看来这已经是我生活的一部分。希望javaeye越做越好...
数据库恢复正常
vb调用下面的存储过程插入图片 rnCREATE OR REPLACE PROCEDURE "PIC_INSERT" (PID VARCHAR2,FILENAME VARCHAR2) IS rnF_LOB BFILE; rnB_LOB BLOB; rnBEGIN rnINSERT INTO PIC_LOB(PIC_ID, PIC) rnVALUES (PID,EMPTY_BLOB ()) RETURN PIC INTO B_LOB; rnF_LOB:= BFILENAME ('INPUTPIC', FILENAME); rnDBMS_LOB.FILEOPEN (F_LOB, DBMS_LOB.FILE_READONLY); rnDBMS_LOB.LOADFROMFILE (B_LOB,F_LOB,DBMS_LOB.GETLENGTH (F_LOB),1,1); rnDBMS_LOB.FILECLOSE (F_LOB); rnCOMMIT; rnEND; rnrn后来数据库达到800多万张图片,警告日志文件出现如下错误: rnFri Nov 21 00:16:13 2008 rnErrors in file d:\oracle\admin\mydata\bdump\mydataCJQ0.TRC: rnORA-00604: error occurred at recursive SQL level 1 rnORA-01003: no statement parsed rn可能是空间不够了,删除一些图片后,日志文件不在出错,但插入速度明显降低 rn请教各位这是怎么回事,是什么原因让插入速度降下来的,不应该是数据多的原因吧, rn因为之前插入速度是很快的 rnrn----------------------------------------------------rnrn今天数据库又恢复了正常rn各位解释解释怎么回事啊?
SmartUpload(网页上传时会用到)
这里拥有SmartUpload的jar包和源代码,易用的上传插件。
OV5648摄像头进入预览界面时会闪
调试摄像头发现进入预览的时候会闪一下,在暗的地方看比较明显,看起来就像是先亮了背光,再亮了显示屏一样,请教这个跟摄像头的什么参数有关?rn rn
SwipeRefreshLayout 进入页面主动刷新
//找到控件 mSwipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container); 设置监听  mSwipeLayout.setOnRefreshListener(this);                  mSwipeLayout.post(new Runnable() {
RecyclerView Glide加载图片刷新时会闪一下
@Override     protected void convert(BaseViewHolder helper, GameListResp.Data data) {           LinearLayout ic_linearLayout = (LinearLayout)helper.getView(R.id.ic_linearLayout);         ViewGroup.La...
持续刷新报错问题
写了一个网页,因为刷的数据比较多,打开不报任务错误,但持续按F5后,就会报sqldatereader未关闭,应该怎么解决,
刷新jsp页面报错
java.lang.IllegalArgumentException: Bad date header: 'Wed, 02 Jul 2014 16:18:26 GMT'rn at weblogic.servlet.internal.ServletRequestImpl.getDateHeader(ServletRequestImpl.java:983)rn at javax.servlet.http.HttpServletRequestWrapper.getDateHeader(HttpServletRequestWrapper.java:83)rn at javax.servlet.http.HttpServletRequestWrapper.getDateHeader(HttpServletRequestWrapper.java:83)rn at org.springframework.web.context.request.ServletWebRequest.checkNotModified(ServletWebRequest.java:155)rn at org.springframework.web.servlet.resource.ResourceHttpRequestHandler.handleRequest(ResourceHttpRequestHandler.java:134)rn Truncated. see log file for complete stacktrace
vs2010 水晶报表刷新报错
做的一个水晶报表,点击报表控件上的刷新按钮报错:“[color=#FF0000]本地报表处理期间出错。处理报表时出错。[/color]”rn请教各位高手。rn
zedgraph跨线程刷新报错
我在从线程中刷新主界面中的zedgraph时候,报错,请教大神们该如何修改。上代码rn[code=csharp]rnmain()rnrn。。。。。。。。。。。。。。rn //利用线程操作,避免界面不能操作rn threadNew = new Thread(new ThreadStart(ReadSP_writeExcel));rn threadNew.Start(); rn rnrnrnrn线程程序:rnpublic void ReadSP_writeExcel()rnrnPointPairList Data_T11 = new PointPairList();rn。。。。。。中间数据计算rn Data_T11.Add(rowCount1, T11);rn //RealTime_Update_Curve("电池1", "T1", Data_T11);rn //更新曲线rn GraphPane myPane = zgc.GraphPane;rn string Y_Lable = "TPF";rn rn myPane.XAxis.Title.Text = "点数";rn rn myPane.XAxis.Type = AxisType.Linear;rn myPane.XAxis.CrossAuto = true;rn rn myPane.XAxis.Scale.IsVisible = true;rn myPane.XAxis.Scale.MajorStepAuto = true;rn myPane.XAxis.Scale.MinorStepAuto = true;rn myPane.YAxis.MajorGrid.IsVisible = true;//水平辅助线rn myPane.XAxis.MajorGrid.IsVisible = true;//垂直辅助线rnrn myPane.CurveList.Clear();rn myPane.YAxis.Title.Text = Y_Lable;rn LineItem curve = myPane.AddCurve("TPF", Data_T11, Color.Red, SymbolType.Circle);rn zgc.AxisChange();rn Refresh();//////////////////////这里提示错误????????????????rnrnrn //线程等待更新rn System.Windows.Forms.Application.DoEvents();rn System.Threading.Thread.Sleep(10);rnrn rn[/code]rn=================rn请教大神们,这里该如何处理才能在线程中刷新zedgraph,最好能给个例子,或者在小弟的程序上简单给修改一下,先谢谢
CS如何定时会刷新呢?JEditPane
如下程序代码,是将一个本地HTML文件的源文件进行修改,然后再JEditPane中显示出来。。rn现在问题是:会在一段时间,比如十分钟之后就会来一个HTML文件,然后要对它进行原文件的修改(底色,字体颜色等)。想定时刷新,然后将其显示出来rn请教各位大侠~~谢谢rnrnString myHTML = readFile("你的网页.html");rnmyHTML.replace("#000000", "#ff0000").replace("#C8C8C8", "#000000");rnwriteFile("你的网页.html", myHTML);rnrnJava codern public static void writeFile (String file_name, String content)rn rn tryrn rn FileOutputStream fout = new FileOutputStream(file_name);rn byte [] bytes = content.getBytes();rn fout.write(bytes);rn fout.close();rn rn catch(Exception e)rn rn e.printStackTrace();rn rn rn rn public static String readFile(String file_name)rn rn tryrn rn FileInputStream fin = new FileInputStream(file_name);rn int length = fin.available();rn byte [] buffer = new byte[length];rn fin.read(buffer);rn fin.close();rn return new String(buffer);rn rn catch(Exception e)rn rn e.printStackTrace();rn rn return null;rn rn
.net连续刷新报错~!~
错误rnDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. rnrnException Details: System.Data.OleDb.OleDbException: 未指定的错误rnrnSource Error: rnrnrnLine 71: OleDbConnection myconnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath(@"~/App_Data/kh1454578s.mdb"));rnLine 72: OleDbCommand addCommand = new OleDbCommand(strCount, myconnection);rnLine 73: addCommand.Connection.Open();rnLine 74: OleDbDataReader dr;rnLine 75: dr = addCommand.ExecuteReader(CommandBehavior.CloseConnection);rn rnrnSource File: d:\2008\yunshengtang.com.cn\Product.aspx.cs Line: 73 rnrnStack Trace: rnrnrn[OleDbException (0x80004005): 未指定的错误]rn System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1054881rn System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +53rn System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27rn System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47rn System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105rn System.Data.OleDb.OleDbConnection.Open() +37rn Product.CalculateRecord() in d:\2008\yunshengtang.com.cn\Product.aspx.cs:73rn Product.Page_Load(Object sender, EventArgs e) in d:\2008\yunshengtang.com.cn\Product.aspx.cs:38rn System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15rn System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34rn System.Web.UI.Control.OnLoad(EventArgs e) +99rn System.Web.UI.Control.LoadRecursive() +47rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061rnrn rnrnrn我代码rnrnusing System;rnusing System.Data;rnusing System.Configuration;rnusing System.Collections;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnusing System.Data.OleDb;rnrnpublic partial class Product : System.Web.UI.Pagernrn int CurrentPage;rn int PageSize;rn int PageCount;rn int RecordCount;rn protected void Page_Load(object sender, EventArgs e)rn rn if (!IsPostBack)rn rnrn PageSize = 6;rn string sql;rn if (Request.QueryString["type"] == null)rn rn sql = "select * FROM [product]";rn rn elsern rn sql = "select * FROM [product] where type='" + Request.QueryString["type"] + "'";rnrn rn if (!Page.IsPostBack)rn rn //计算总共有多少记录 rn RecordCount = CalculateRecord();rn //计算总共有多少页rn //取整 rn PageCount = RecordCount / PageSize;rn if (RecordCount % PageSize > 0)rn PageCount = PageCount + 1;rn lblPageCount.Text = PageCount.ToString();rn lblRecordCount.Text = RecordCount.ToString();rn ViewState["PageCount"] = PageCount;rn CurrentPage = 0;rn ViewState["PageIndex"] = 0;rn //绑定 rn ListBind();rn rn rnrnrnrnrn rn public string strCount;rn public int CalculateRecord()rn rn int intCount;rn int bianlang1 = System.Convert.ToInt32(Request.QueryString["id"]);rn if (Request.QueryString["type"] == null)rn rn strCount = "select count(*) as co from [product]";rn rn elsern rn strCount = "select count(*) as co from [product] where type='" + Request.QueryString["type"] + "'";rn rn OleDbConnection myconnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath(@"~/App_Data/kh1454578s.mdb"));rn OleDbCommand addCommand = new OleDbCommand(strCount, myconnection);rn addCommand.Connection.Open();rn OleDbDataReader dr;rn dr = addCommand.ExecuteReader(CommandBehavior.CloseConnection);rn if (dr.Read())rn rn intCount = Int32.Parse(dr["co"].ToString());rn rn elsern rn intCount = 0;rn rn dr.Close();rn return intCount;rn addCommand.Connection.Close();rn myconnection.Close();rn rn public string strSel;rn ICollection CreateSource()rn rn int bianlang1 = System.Convert.ToInt32(Request.QueryString["id"]);rn int StartIndex;rn //设定导入的起终地址 rn StartIndex = CurrentPage * PageSize;rn if (Request.QueryString["type"] == null)rn rn strSel = "select * from [product]";rn rn elsern rn strSel = "select * from [product] where type='" + Request.QueryString["type"] + "'";rnrn rn OleDbConnection myconnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath(@"~/App_Data/kh1454578s.mdb"));rn myconnection.Open();rn DataSet ds = new DataSet();rn OleDbDataAdapter MyAdapter = new OleDbDataAdapter(strSel, myconnection);rn MyAdapter.Fill(ds, StartIndex, PageSize, "products");rn return ds.Tables["products"].DefaultView;rn myconnection.Close();rn rnrn public void ListBind()rn rn DtProList.DataSource = CreateSource();rn DtProList.DataBind();rn DtProList.RepeatColumns = 3;rn lbnNextPage.Enabled = true;rn lbnPrevPage.Enabled = true;rn if (PageCount == 0)rn rn lblCurrentPage.Text = "0";rn lbnNextPage.Enabled = false;rn lbnPrevPage.Enabled = false;rn rn elsern rn if (CurrentPage == (PageCount - 1)) lbnNextPage.Enabled = false;rn if (CurrentPage == 0) lbnPrevPage.Enabled = false;rn lblCurrentPage.Text = (CurrentPage + 1).ToString();rn rn rn public void Page_OnClick(Object sender, CommandEventArgs e)rn rn CurrentPage = (int)ViewState["PageIndex"];rn PageCount = (int)ViewState["PageCount"];rn string cmd = e.CommandName;rn //判断cmd,以判定翻页方向 rn switch (cmd)rn rn case "next":rn if (CurrentPage < (PageCount - 1)) CurrentPage++;rn break;rn case "prev":rn if (CurrentPage > 0) CurrentPage--;rn break;rn case "first":rn CurrentPage = 0;rn break;rn case "last":rn CurrentPage = PageCount - 1;rn break;rn rnrnrn ViewState["PageIndex"] = CurrentPage;rn ListBind();rn rn
为何刷新时会执行按扭单击事件?
我执行按扭单击事件后,刷新页面时又会执行一次按扭单击事件,这种情况如何避免?
网页进入重定向循环
[img=https://img-bbs.csdn.net/upload/201404/24/1398332889_997027.png][/img]
什么条件下网页自动刷新时会提示"不重新发送信息,则无法刷新网页"
-
偶尔出现Could not execute query的错误,重新刷新后恢复正常
B/S系统,偶尔出现Could not execute query的错误,重新刷新后恢复正常rnrn各位兄弟姐妹有没有解决办法?
SQL突然服务器不能进入,20分钟后恢复正常
请问一下,SQL突然服务器不能进入,20分钟后恢复正常,简单的SQL语句在服务器端都不能执行,,我在LOG Explorer 查看那个时间段并没有什么异常的语句在执行,请问这个一般是什么问题,需要怎样查找到问题,谢谢!!
网页刷新软件webmon
网页刷新软件webmon网页刷新软件webmon
5种网页刷新方法
5种网页刷新方法 5种网页刷新方法
刷新网页工具 易语言
刷新网页工具 易语言刷新网页工具 易语言
多线程刷新网页
[img=http://hi.csdn.net/attachment/201103/17/4996438_1300332778r8YC.jpg][/img]rn想实现图片上的多线程的效果...单线程已经做出来了 但要多线程就不知道从哪下手了 rn比如开5个线程 是不是得动态生成5个timer控件和变量来计数???????rn各位大侠赐教啦...
WebBrowser控件 网页刷新问题
我做了一个mfc程序,其中视图是继承自 CFormView,在 CFormView上呢放置了一个WebBrowser控件,用来显示一个html文件,我希望可以对控件里面显示的页面实现刷新,该怎么办?因为现在网页里有一个按钮,点击后弹出一个对话框,当我关闭这个对话框之后,页面上还会显示对话框的痕迹,好半天才消失,我觉得应该是刷新的问题,希望大家帮忙
OCX嵌入网页刷新
很奇怪,我OCX嵌入网页后,刷新网页的时候在IE浏览器上能重新创建显示成功,但是在360、世界之窗等浏览器上就无法显示了。rnrn我使用了一个线程用来处理一些显示代码,我尝试了下,如果不用线程,直接在OnTimer()中处理显示代码是没有错误的,但是关键是我现在必须要使用线程来处理rnrn不知道是不是因为消息被堵住了,请教下,网页刷新时发送了什么消息给OCX,调试时发现是有执行OnDestroy()函数的??rn
怎样刷新网页
我用列表框来选择跳到那一张网页,但是跳过去以后显示不出内容,只有刷新以后才能看见,请问我怎样在跳到那张网页的同时刷新那张网页
ASP网页里,刷新
ASP网页里。我现在我点回复后,他没有反应,要我自己刷新才行。 rnrn利用 rnResponse.Redirect("");也是不行rnrn问题补充:///////////////////////////////// rnrn<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%> rn rnrnif(!is_admlogin()) Response.Write("管理登录 | ") rnelse rnResponse.Write("管理员:"+Session("username")+" | "); rnResponse.Write("退出管理 | "); rn rn////////////////////////////////////////// rn<% rnfunction exitAdin() rnSession("username")=null; rnResponse.Redirect("index.asp"); rn//Response.Write("放回"); rn rnrn%> rn rn<% exitAdin(); %> rnrn
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表

相似问题

1
网站打开后刷新出现js乱码,可曾见过。
1
eclipse导入或者刷新项目就报错,但是不影响第二次刷新以及运行。
4
eclipse导入或者刷新项目就报错,但是不影响运行。
3
普通网站页面刷新时,websocket总会被重置吗?能够保持连接吗?
2
移动app列表数据分页,上拉加载更多和下拉刷新时的后台逻辑该如何实现?
5
求助:RecyclerView添加分割线后,每次下拉刷新 Item与分割线间都会增加间距。
3
Spring MVC页面刷新问题
3
用JS动态添加iframe到页面,这个iframe网页内容加载不出来
5
微信小程序--页面删除数据后实现自动刷新页面
4
springboot 添加附件图片到static下,结果报404,需去给项目刷新。
10
网页刷新时出错,马上又正常显示的问题
8
如图layer 弹框刷新和关闭问题
8
为什么chrome浏览器浏览部分网页时在检查模式下点击刷新会进入手机版
5
SpringBoot2.0 Config客户端自动刷新时没有/bus/refresh端点
5
频繁刷新页面websocket报错
3
用ssm写的项目部署到服务器后报错,刷新一下就好了,隔一段时间又报错,再刷新又好了
2
vue.js项目部署在tomcat上,怎么才能让刷新不报404
0
为什么我的element ui popover组件需要刷新才正常显示内容啊,element ui 的版本是2.3.2版本的
0
H5页面运用iscroll后点击报错,click和a标签失效什么原因?
0
poi刷新公式报错class org.apache.poi.ss.formula.eval.MissingArgEval