Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a website. I have used Master Page and i have created left menus dynamically. When i Click on that menus(For displaying a another page). I want to refresh only contentPlaceholder.
Here i have used Update Pannel But its wont work.
Posted
Updated 17-Sep-11 2:53am
v3

Hi,

You can do it without master page. actually I did it without masterpage

using Jquery.


HTML
Default.aspx
<div class="maincontainer" align="center">
        <div class="maincontainer ">
           <table width="100%" align="center">
             <tr>
               <td>
                 <h2>Welcome to Website</h2>
               </td>
             </tr>
             <tr>
               <td>
                 <table width="100%" align="center">
                   <tr>
                      <td><a href="#home" onclick="openpage('home')">Home</a></td>
                      <td><a href="#about" onclick="openpage('about')">About Us</a></td>
                      <td><a href="#gallery" onclick="openpage('gallery')">Gallery</a></td>
                       <td><a href="#req" onclick="openpage('prayreq')">Request</a></td>
                      <td><a href="#contact" onclick="openpage('contact')">Contact Us</a></td>
                   </tr>
                 </table>
               </td>
             </tr>
             <tr>
              <td>
                 <div id="maincontent">
                   This is Home Page Content
                 </div>
                </td>
             </tr>
           </table>
        </div>
    </div>


And the above page javascript for openpage

JavaScript
function openpage(pagename){
 $("#maincontentdiv").text("Page Loading please wait.....");
   $("#maincontentdiv").load(pagename + ".aspx #maincontent", function () {
                            // make content visible with effect   

                            
                        });
}


And the page which you've to load must contain like bellow div tag

HTML
aboutus.aspx
  <div id="maincontent">
        This is About us content
    </div>


If you use the same process you'll get best experience while loading partial page
You can try in master page also.

All the Best.
 
Share this answer
 
Hi,

This may be useful for you-
http://forums.asp.net/t/1210110.aspx[^]
 
Share this answer
 

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