Exclude _PageStart.cshtmlhttp://forums.asp.net/t/1804189.aspx/1?Exclude+_PageStart+cshtmlWed, 16 May 2012 15:34:06 -040018041894983003http://forums.asp.net/p/1804189/4983003.aspx/1?Exclude+_PageStart+cshtmlExclude _PageStart.cshtml <p>Hi</p> <p>Is it possible to exclude the&nbsp;_PageStart.cshtml from one page.</p> <p>In my case i want to exclude it from the login-page (Login.cshtml)</p> 2012-05-16T07:36:07-04:004983358http://forums.asp.net/p/1804189/4983358.aspx/1?Re+Exclude+_PageStart+cshtmlRe: Exclude _PageStart.cshtml <p>I think you could test in _PageStart.cshtml if the requested page is Login.cshtml, excluding Login.cshtml from its execution.</p> <p>The method Request.FilePath returns the relative path of the current request and it's useful for knowing which is the page requested by the user.</p> <p><span face="48olkoz" size="1" style="font-family:48olkoz; font-size:xx-small"><span face="48olkoz" size="1" style="font-family:48olkoz; font-size:xx-small"></span></span></p> <p><span face="Consolas" color="#509610" size="2" style="color:#509610; font-family:Consolas; font-size:small"><span face="Consolas" color="#509610" size="2" style="color:#509610; font-family:Consolas; font-size:small"><span face="Consolas" color="#509610" size="2" style="color:#509610; font-family:Consolas; font-size:small"></span></span></span></p> 2012-05-16T10:27:09-04:004983625http://forums.asp.net/p/1804189/4983625.aspx/1?Re+Exclude+_PageStart+cshtmlRe: Exclude _PageStart.cshtml <p></p> <blockquote><span class="icon-blockquote"></span> <h4>GmGregori</h4> <p></p> <p>I think you could test in _PageStart.cshtml if the requested page is Login.cshtml, excluding Login.cshtml from its execution.</p> <p>The method Request.FilePath returns the relative path of the current request and it's useful for knowing which is the page requested by the user.</p> <p></p> </blockquote> <p></p> <p></p> <p>Like this?</p> <p>@{<br> &nbsp; &nbsp; &nbsp;if (Request.FilePath != &quot;/login.cshtml&quot;)<br> &nbsp; &nbsp; &nbsp;{<br> &nbsp; &nbsp; &nbsp;....code that will be executed in _PageStart<br> &nbsp; &nbsp; &nbsp;}<br> }</p> 2012-05-16T12:35:42-04:004983863http://forums.asp.net/p/1804189/4983863.aspx/1?Re+Exclude+_PageStart+cshtmlRe: Exclude _PageStart.cshtml <p>Yes. It should work.</p> <p>Let me know.</p> 2012-05-16T15:16:36-04:004983897http://forums.asp.net/p/1804189/4983897.aspx/1?Re+Exclude+_PageStart+cshtmlRe: Exclude _PageStart.cshtml <p><span class="hps">You were right.</span><span>&nbsp;</span><span class="hps">it worked ;)</span></p> 2012-05-16T15:34:06-04:00