Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9129527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:46:10+00:00 2026-06-17T07:46:10+00:00

HtML section in _Layout.cshtml <div id=header> <div class=logo><a href=#><img src=@Url.Content(~/!(IMAGEPATH)!/logo.png) alt= /></a></div> <div class=fb_like><img

  • 0

HtML section in _Layout.cshtml

<div id="header">
      <div class="logo"><a href="#"><img src="@Url.Content("~/!(IMAGEPATH)!/logo.png")" alt="" /></a></div>
      <div class="fb_like"><img src="@Url.Content("~/!(IMAGEPATH)!/fb_like_btn.png")" alt="" /></div>
      <div class="google_plus"><img src="@Url.Content("~/!(IMAGEPATH)!/google_plus.png")" alt="" /></div>
      <div class="header_rt">
        <ul>
          <li>Call us: 1500 258 789</li>
          <li><a href="#">Live chat</a></li>
          <li><a href="#">My Account</a></li>
          <li><a href="#">Sign in</a></li>
        </ul>
        <div class="search">
          <input type="text" value="Type your keyword..." class="srh_txt" />
          <input name="Submit" type="submit" value="Submit" class="srh_btn" />
        </div>
      </div>
    </div>
  <div id="main">
      @RenderBody()
 </div>

Html section in Index.cshtml

@{
   ViewBag.Title = "Home Page";
}
<div class="clr"></div>
<div id="banner">
<div id="slider"><img src="@Url.Content("~/!(IMAGEPATH)!/banner.jpg")" alt="" /></div>
<div class="banner_rt">
  <div class="adv1"><img src="@Url.Content("~/!(IMAGEPATH)!/adv1.jpg")" alt="" /></div>
  <div class="adv2"><img src="@Url.Content("~/!(IMAGEPATH)!/adv2.jpg")" alt="" /></div>
</div>

Using bellow code I able to Replace !(IMAGEPATH)! only in _Layout.cshtml

   void Application_PostReleaseRequestState(object sender,EventArgs e)
   {
      if(string.CompareOrdinal(Response.ContentType,"text/html") == 0)
      {
         Response.Filter = new ResponseFilter(Response.Filter);
      }
   }

But above described code not affecting child pages like Index.cshtml. Please tell me any event in ASP.NET MVC3 like old protected override void OnPreInit(EventArgs e) of Classic ASP.NET !!!!

I want to know which event effecting all the child pages before rendering in MVC3 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:46:11+00:00Added an answer on June 17, 2026 at 7:46 am

    Within Base Controller, write the bellow code

    protected override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var response = filterContext.HttpContext.Response;
            if (string.CompareOrdinal(response.ContentType, "text/html") == 0)
            {
                response.Filter = new ResponseFilter(response.Filter);
            }
            base.OnResultExecuting(filterContext);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML: <section id=sidebar class=grid_3> <section id=content class=grid_9> I used jQuery
I have section for scripts in my _Layout.cshtml: <html> <body> ... @RenderSection(FooterScript, required: false)
I have a top-level _Layout.cshtml that looks something like this: <html> <head> @RenderSection(Header, required:
I have a layout page thusly <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <script src=@Url.Content(~/Scripts/jquery-1.7.1.min.js) type=text/javascript></script>
I have a base layout, BaseLayout.cshtml: <html> <body> @RenderBody() <div id=footer> @if (!IsSectionDefined(Footer)) {
This is my _Layout.cshtml <html> <head> @RenderSection(Script, false) </head> ... </html> This is a
I'm using the .load() function to load a section of html that has some
The following is an section of my CSS file plus some HTML. Can anyone
I have a base.html which has a login section at the top of every
I have 11 checkboxes in my HTML form and already have a section in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.