473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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.PageRequestManagerParserErrorExcepti on: 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 2160
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.PageRequestManagerParserErrorExcepti on: 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**********************************@e31g2000 hse.googlegroups.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 interoperability
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...@markNOSPAMrae.netwrote:
"Ben" <benm5...@gmail.comwrote in message

news:e5**********************************@e31g2000 hse.googlegroups.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 interoperability
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**********************************@2g2000hs n.googlegroups.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**@markNOSPAMrae.netwrote in message
news:OF**************@TK2MSFTNGP06.phx.gbl...
"Ben" <be******@gmail.comwrote in message
news:de**********************************@2g2000hs n.googlegroups.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**********@hotmail.comwrote in message
news:OA**************@TK2MSFTNGP03.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...@markNOSPAMrae.netwrote:
"Regan" <regan.tho...@hotmail.comwrote in message

news:OA**************@TK2MSFTNGP03.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.ContentTemplateContainer.Controls.Clea r();
UserControl uc =
(UserControl)LoadControl(sPathToWebUI);
UpdatePanel.ContentTemplateContainer.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**********************************@y77g2000 hsy.googlegroups.com...
On Mar 9, 12:19 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
>"Regan" <regan.tho...@hotmail.comwrote in message

news:OA**************@TK2MSFTNGP03.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.ContentTemplateContainer.Controls.Clea r();
UserControl uc =
(UserControl)LoadControl(sPathToWebUI);
UpdatePanel.ContentTemplateContainer.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
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...
4
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...
16
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...
3
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,...
19
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...
15
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...
2
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...
0
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...
2
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> ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.