页面加载中的Context.Handler问题 [英] Context.Handler Problem in page loading

查看:73
本文介绍了页面加载中的Context.Handler问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:-

I have this code:-

jobSearch job = (jobSearch)Context.Handler;
         ViewState["Keyword"] = job.Keyword;
         ViewState["Location"] = job.Location;


这个错误:-
无法将类型为"ASP.jobs_aspx"的对象转换为类型为"jobSearch".
当我使用自定义分页链接并将querystring作为Pagename.aspx?pageindex = 2
传递时 ,我遇到了错误.请给我任何解决方案.


and this error:-
Unable to cast object of type ''ASP.jobs_aspx'' to type ''jobSearch''.
when i use custome paging links and pass querystring as Pagename.aspx?pageindex=2
, i am getting an error. please give me any solution.

推荐答案

我使用过Server.Execute,因此它首先运行良好,但是当用户单击刷新"按钮时,它将产生问题,所以我将其替换了Server.Execute并将Response.Redirect与会话对象一起使用.现在工作正常.
I have used Server.Execute so that it first works well but when user clicks refresh button then it will create problem so I have replaced Server.Execute and use Response.Redirect with session object. And now it is working fine.


这篇关于页面加载中的Context.Handler问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆