common authentication logic in asp.net membership
<p>I m newb in asp.net. I m working for an example with Membership class in ASP.NET. I have some pages in my project e.g. default.aspx, page1.aspx, page2.aspx. I  have put login control in default.aspx. Now I want to check authentication of user when user want to access any page. Already I achieved this thing to put below snippest in Page_Load event in every Page. But want some suggestion so that i can remove this duplicate code from every page. and implemete some logic which can be applicable on every page. Do i need to use global.asax or any class which could be inherite in all page an check authentication? </p>

<pre><code>if(!HttpContext.Current.User.Identity.IsAuthenticated)
        {
Response.redirect("default.aspx");

        }
</code></pre>
