首页 新闻 搜索 专区 学院

HttpModule内为什么不能用RegisterStartupScript这一系统注册脚本的方法

0
悬赏园豆:5 [已关闭问题]
<pre><span id="Code_Open_Text_103530" style="display: none"><div class="cnblogs_code"><pre><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> WbHttpModule : IHttpModule<br /> {<br /><br /><br /> </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> IHttpModule Members</span><span style="color: #000000;"><br /><br /> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Dispose()<br /> {<br /> </span><span style="color: #008000;">//</span><span style="color: #008000;">throw new NotImplementedException();</span><span style="color: #008000;"><br /></span><span style="color: #000000;"> }<br /><br /> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Init(HttpApplication context)<br /> {<br /> </span><span style="color: #008000;">//</span><span style="color: #008000;">throw new NotImplementedException();</span><span style="color: #008000;"><br /></span><span style="color: #000000;"> context.EndRequest </span><span style="color: #000000;">+=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> EventHandler(Begin_Request);<br /> }<br /><br /> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Begin_Request(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)<br /> {<br /> HttpApplication app </span><span style="color: #000000;">=</span><span style="color: #000000;"> sender </span><span style="color: #0000FF;">as</span><span style="color: #000000;"> HttpApplication;<br /> HttpContext context </span><span style="color: #000000;">=</span><span style="color: #000000;"> app.Context;<br /> HttpResponse response </span><span style="color: #000000;">=</span><span style="color: #000000;"> context.Response;<br /> </span><span style="color: #008000;">//</span><span style="color: #008000;">response.Write("&lt;script type='text/javascript'&gt;setTimeOut(alert('欢迎大家光临本站!'), 10000);&lt;/script&gt;");</span><span style="color: #008000;"><br /></span><span style="color: #000000;"> </span><spa
DishBirder的主页 DishBirder | 初学一级 | 园豆:22
提问于:2009-03-27 10:36
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册