473,698 Members | 2,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to switch content page?

Ben
Hi,

i'm trying to build a simple site navigation (using c#)... i
implemented a master page that shows a sidebar user control on the
left side, and a content page on the right.

i click the link on the sidebar which calls Redirect.

problem is that the whole page refreshes... i just want the right side
to update to a new content.

can anyone point me in the right direction to accomplish this?

btw, i'm trying to use ajax when possible to make the job easier...
but if i put the sidebar in an UpdatePanel (in hopes of avoiding a
refresh) it gives this error:

"Sys.WebForms.P ageRequestManag erParserErrorEx ception: The message
received from the server could not be parsed. Common causes for this
error are when the response is modified by calls to Response.Write( )"
Thanks for any info you can give!
Mar 9 '08 #1
8 2174
On Mar 9, 11:26*am, Ben <benm5...@gmail .comwrote:
Hi,

i'm trying to build a simple site navigation (using c#)... i
implemented a master page that shows a sidebar user control on the
left side, and a content page on the right.

i click the link on the sidebar which calls Redirect.

problem is that the whole page refreshes... i just want the right side
to update to a new content.

can anyone point me in the right direction to accomplish this?

btw, i'm trying to use ajax when possible to make the job easier...
but if i put the sidebar in an UpdatePanel (in hopes of avoiding a
refresh) it gives this error:

"Sys.WebForms.P ageRequestManag erParserErrorEx ception: The message
received from the server could not be parsed. Common causes for this
error are when the response is modified by calls to Response.Write( )"

Thanks for any info you can give!
http://alpascual.com/blog/al/archive...n-in-AJAX.aspx
Mar 9 '08 #2
"Ben" <be******@gmail .comwrote in message
news:e5******** *************** ***********@e31 g2000hse.google groups.com...
Thanks Mark -- That's why I looked into master pages, since i read
that framesets are a thing of the past...

but isn't there some solution to just re-load the right side (the
content) and leave the left (the menu sidebar) intact?
Not with MasterPages...
It doesn't look professional when the whole page refreshes every time
someone clicks a new menu item....
That's the way the web works...
or is the only way to accomplish this using framesets?!?
One of the main features of MasterPages is the server-side interoperabilit y
between the content pages and MasterPages - you can't really do this with
framesets or iframes, so you're left with client-side JavaScript.

Obviously, you could create an asp:Literal control and fill it dynamically
with HTML, but that would mean that you would lose all of the server-side
ASP.NET functionality.

I would strongly advise you to stick with MasterPages - once you've got the
hang of them, you'll wonder how you ever managed without them...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Mar 9 '08 #3
Ben
On Mar 9, 9:22*am, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
"Ben" <benm5...@gmail .comwrote in message

news:e5******** *************** ***********@e31 g2000hse.google groups.com...
Thanks Mark -- That's why I looked into master pages, since i read
that framesets are a thing of the past...
but isn't there some solution to just re-load the right side (the
content) and leave the left (the menu sidebar) intact?

Not with MasterPages...
It doesn't look professional when the whole page refreshes every time
someone clicks a new menu item....

That's the way the web works...
or is the only way to accomplish this using framesets?!?

One of the main features of MasterPages is the server-side interoperabilit y
between the content pages and MasterPages - you can't really do this with
framesets or iframes, so you're left with client-side JavaScript.

Obviously, you could create an asp:Literal control and fill it dynamically
with HTML, but that would mean that you would lose all of the server-side
ASP.NET functionality.

I would strongly advise you to stick with MasterPages - once you've got the
hang of them, you'll wonder how you ever managed without them...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
yea, i want to avoid dynamically filling the HTML on the client
side... i was really hoping for the exact same functionality framesets
provided (being able to reload a particular frame), i just thought
there's an alternative that would behave in a similar way.

u know that MSDN page for the subscriber downloads... it's got a
navigation tree on the left, and it doesn't refresh when you click
things, just the content pane refreshes... that's what i wanted...
maybe they're using framesets...

btw, if there's any recommended book u can suggest that covers these
topics (i'm using VS 2008 now), let me know, i'd really appreciate
it... i think i need to get some basics down.

thanks!!
Mar 9 '08 #4
"Ben" <be******@gmail .comwrote in message
news:de******** *************** ***********@2g2 000hsn.googlegr oups.com...
You know that MSDN page for the subscriber downloads... it's got a
navigation tree on the left, and it doesn't refresh when you click
things, just the content pane refreshes... that's what I wanted...
maybe they're using framesets...
The "content" pages are static HTML stored in a database...

BTW, if there's any recommended book you can suggest that covers these
topics (I'm using VS 2008 now), let me know, I'd really appreciate
it... I think I need to get some basics down.

http://www.kencox.ca/
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Mar 9 '08 #5
It might be easier for you to consider building your side menus into your
content pages instead of the master page. Then you could definitely do
partial page updates using nested update panels.

Regan

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:OF******** ******@TK2MSFTN GP06.phx.gbl...
"Ben" <be******@gmail .comwrote in message
news:de******** *************** ***********@2g2 000hsn.googlegr oups.com...
>You know that MSDN page for the subscriber downloads... it's got a
navigation tree on the left, and it doesn't refresh when you click
things, just the content pane refreshes... that's what I wanted...
maybe they're using framesets...

The "content" pages are static HTML stored in a database...

BTW, if there's any recommended book you can suggest that covers these
topics (I'm using VS 2008 now), let me know, I'd really appreciate
it... I think I need to get some basics down.

http://www.kencox.ca/
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Mar 9 '08 #6
"Regan" <re**********@h otmail.comwrote in message
news:OA******** ******@TK2MSFTN GP03.phx.gbl...
>>You know that MSDN page for the subscriber downloads... it's got a
navigation tree on the left, and it doesn't refresh when you click
things, just the content pane refreshes... that's what I wanted...
maybe they're using framesets...

The "content" pages are static HTML stored in a database...

BTW, if there's any recommended book you can suggest that covers these
topics (I'm using VS 2008 now), let me know, I'd really appreciate
it... I think I need to get some basics down.

http://www.kencox.ca/

It might be easier for you to consider building your side menus into your
content pages instead of the master page. Then you could definitely do
partial page updates using nested update panels.
Apart from the fact that that would totally defeat the purpose of
MasterPages...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Mar 9 '08 #7
Ben
On Mar 9, 12:19*pm, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
"Regan" <regan.tho...@h otmail.comwrote in message

news:OA******** ******@TK2MSFTN GP03.phx.gbl...


>You know that MSDN page for the subscriber downloads... it's got a
navigation tree on the left, and it doesn't refresh when you click
things, just the content pane refreshes... that's what I wanted...
maybe they're using framesets...
The "content" pages are static HTML stored in a database...
BTW, if there's any recommended book you can suggest that covers these
topics (I'm using VS 2008 now), let me know, I'd really appreciate
it... I think I need to get some basics down.
>http://www.kencox.ca/
It might be easier for you to consider building your side menus into your
content pages instead of the master page. Then you could definitely do
partial page updates using nested update panels.

Apart from the fact that that would totally defeat the purpose of
MasterPages...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net- Hide quoted text -

- Show quoted text -
This is closer to what i need though... i'd rather not use a master
page in this section if it forces a full refresh.

I''m testing it now... so built a table with 2 columns in a webform,
one side has my menu and the other an UpdatePanel.
On menu item click I load a new Web User Control into the UpdatePanel
using this code:

UpdatePanel.Con tentTemplateCon tainer.Controls .Clear();
UserControl uc =
(UserControl)Lo adControl(sPath ToWebUI);
UpdatePanel.Con tentTemplateCon tainer.Controls .Add(uc);

It has a strange behavior -- when the contol loads, I click on a
button and it doesn't post back... i click again and only then it
works... is there anyway to fix this?
Mar 9 '08 #8
I tried recreating your columns and update panel just to test it. I added a
"parent" update panel that holds everything except the Script Manager. And
then I dropped a variation of your code into my button onClick, which
created a Textbox control in the right column's Update Panel.

As expected, the partial post back worked fine. (with the "parent" Update
Panel). I would suggest, breaking through your user control; the two-click
bug might be in there.

I'm not sure what the code for your control looks like.

"Ben" <be******@gmail .comwrote in message
news:90******** *************** ***********@y77 g2000hsy.google groups.com...
On Mar 9, 12:19 pm, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
>"Regan" <regan.tho...@h otmail.comwrote in message

news:OA******* *******@TK2MSFT NGP03.phx.gbl.. .


>>You know that MSDN page for the subscriber downloads... it's got a
navigation tree on the left, and it doesn't refresh when you click
things, just the content pane refreshes... that's what I wanted...
maybe they're using framesets...
>The "content" pages are static HTML stored in a database...
>BTW, if there's any recommended book you can suggest that covers these
topics (I'm using VS 2008 now), let me know, I'd really appreciate
it... I think I need to get some basics down.
>>http://www.kencox.ca/
It might be easier for you to consider building your side menus into
your
content pages instead of the master page. Then you could definitely do
partial page updates using nested update panels.

Apart from the fact that that would totally defeat the purpose of
MasterPages. ..

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net- Hide quoted text -

- Show quoted text -

This is closer to what i need though... i'd rather not use a master
page in this section if it forces a full refresh.

I''m testing it now... so built a table with 2 columns in a webform,
one side has my menu and the other an UpdatePanel.
On menu item click I load a new Web User Control into the UpdatePanel
using this code:

UpdatePanel.Con tentTemplateCon tainer.Controls .Clear();
UserControl uc =
(UserControl)Lo adControl(sPath ToWebUI);
UpdatePanel.Con tentTemplateCon tainer.Controls .Add(uc);

It has a strange behavior -- when the contol loads, I click on a
button and it doesn't post back... i click again and only then it
works... is there anyway to fix this?
Mar 9 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3315
by: Steve Loft | last post by:
I'm trying to use a switch construct to compare the result of a form with a list of known values and display a different page according to the submitted string. The problem is that some of the answers I need to check for are strings of the character zero of varying length: E.g. <?php switch (trim(strtolower($_POST))):
4
2393
by: Angelos | last post by:
Ok... I have to make this administation area where I have multiple Contents to add edit delete publish . The problem is that I don't know what is the best way of making the forms. At the moment I create a new PHP file for add_page.php, add_student.php, add_news.php, edit_page.php list_page.php and so on. This way doesn't seem very good to me and I am wondering if I want to put them in one file or in some more generic files, how am I...
16
2231
by: Braxton Beyer | last post by:
I have just added a message to my website, wellheard.com, notifying WinIE users that their browsers will not render the site correctly as the site uses PNGs with alpha transparency. I then give them a link explaining why they should not use IE and the benefits of upgrading to another browser. My question is has anyone ever done this and what was their experience. I would like feedback and comments. Why isn't their a browser switch...
3
2810
by: Lee Chapman | last post by:
Hi, I want my ASP.NET web application to use a custom HtmlTextWriter. i.e. I want the object that the Framework passes to System.Web.UI.Control.Render() to be my own object, MyHtmlTextWriter, which inherits from System.Web.UI.HtmlTextWriter. I have tried to do this by changing my application's web.config file: I've added the following to the /configuration/system.web section.
19
3797
by: rdavis7408 | last post by:
Hello, I have four textboxes that the user enters the price per gallon paid at the pump, the mileage per gallon and I would like to then calculate the cost per gallon and use a switch statement to pull a value based on the price per gallon. For example if the price of fuel is 2.44 per gallon and the enter that they get 5.9 miles per gallon the cost of that mile is $.41. Then based on the cost per gallon of 2.44 we might pay them another...
15
4345
by: Zhang Weiwu | last post by:
http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml webpage to IE as application/xml I used that trick and now every one of my xhtml webpage have following first 4 starting lines: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="curseIE.xsl"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
2
2880
osward
by: osward | last post by:
Hello there, I am using phpnuke 8.0 to build my website, knowing little on php programing. I am assembling a module for my member which is basically cut and paste existing code section of various module that I found it useful. Here is the 1st problem I encounter: I had a function to edit a event row form the database which is fine with me, than I pass on the code to a function that save(update) the data to the database.
0
844
by: jrayasam | last post by:
Hi, I have a simple client server application which communicates through sockets. There is a content switch in between client and server that routes the request to a proper server machine. This content switch pings the server machines every 5 millisec to check the heartbeat. My server app is raising an System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host....
2
3171
by: Annalyzer | last post by:
My form looks like this: <form action="handle_event.php" method="POST" enctype="multipart/form-data"> <table id="event_edit" border="0"> <tr> <td> <label for="title">TITLE: </label> </td> <td class="input"> <input id="title" name="title" type="text" size="80" value="<?php if (!empty($title)) {echo $title;} ?>" />
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8876
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.