Click here to Skip to main content
15,917,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
-------Global.asax--------

MSIL
<%@ Application Language="C#"%>

<script runat="server">
    

    void Application_Start(object sender, EventArgs e)
    {
       Response.Write("1234");
    }


</script>


why i can not use Response.Write in Application_Start?
Posted

1 solution

This error is due to a design change in the IIS7 Integrated pipeline that makes the HTTP response unavailable in Application_Start event.

Instead of this you can try

HttpContext.Current.Response.Write("something");
 
Share this answer
 
Comments
shilf 8-Jun-10 4:05am    
when I run Application_Start method,if a HttpApplication has been built?
is HttpContext.Current equals to Context?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900