473,405 Members | 2,160 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,405 software developers and data experts.

Navigation using XMLHTTPRequest

Hi,

I have a website which has navigation links on the left. What I would
like to achieve is that a user clicks a link, the navigation bar stays
where it is and only the content gets loaded into a div; and all that
without using a frameset or an iframe. (It's a client's requirement..
you know how they are!)

Other sites do that as well: They create an XMLHTTPRequest object via JS
and write the resulting HTML (minus headers and footers) into a div. I
tried to do that and it works quite well - except for the "small"
drawback that the content ASP.NET page can not be used, i.e. clicks
trigger a postback as they should, but ASP.NET realizes that the
viewstate is wrong and throws an exception.

I'm not sure how other languages such as PHP do it, I suspect they
simply have several form tags on one page. Since you can't have two
ASP.NET forms and therefore two viewstates on a single page however, I'm
out of ideas how to solve that.

Anybody a pointer for me? :)

Thanks,

Roland
Oct 27 '07 #1
2 1275
If you use a framework to do this such as Microsoft ASP.NET AJAX or
Anthem.Net, you can have your cake and eat it too.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Roland Dick" wrote:
Hi,

I have a website which has navigation links on the left. What I would
like to achieve is that a user clicks a link, the navigation bar stays
where it is and only the content gets loaded into a div; and all that
without using a frameset or an iframe. (It's a client's requirement..
you know how they are!)

Other sites do that as well: They create an XMLHTTPRequest object via JS
and write the resulting HTML (minus headers and footers) into a div. I
tried to do that and it works quite well - except for the "small"
drawback that the content ASP.NET page can not be used, i.e. clicks
trigger a postback as they should, but ASP.NET realizes that the
viewstate is wrong and throws an exception.

I'm not sure how other languages such as PHP do it, I suspect they
simply have several form tags on one page. Since you can't have two
ASP.NET forms and therefore two viewstates on a single page however, I'm
out of ideas how to solve that.

Anybody a pointer for me? :)

Thanks,

Roland
Oct 27 '07 #2
Hi Peter,

thanks for your reply.

Peter Bromberg [C# MVP] wrote:
If you use a framework to do this such as Microsoft ASP.NET AJAX or
Anthem.Net, you can have your cake and eat it too.
I am not sure whether ASP.NET AJAX would help me in this situation.
After all, the navigation links are really links and therefore cause
another page to be loaded. If the link is inside say an updatepanel, it
causes the updatepanel including the menu to refresh. If the link is
outside the updatepanel, it causes the whole "new" page to be reloaded.

I am successfully using AJAX for the contentpages. It's just the
navigation that I'm struggling with, and I haven't seen a demo out so
far that has a feature of what I would like to achieve; even the toolkit
site http://asp.net/ajax/ajaxcontroltoolkit/samples/ reloads every time
you click on the navigation links on the left.

Am I missing something there?

Thanks,

Roland
Oct 27 '07 #3

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

Similar topics

10
by: Matt Kruse | last post by:
I'm aware of the circular reference memory leak problem with IE/closures. I'm not sure exactly how to resolve it in this situation. Also, Firefox appears to grow its memory size with the same code....
12
by: knocte | last post by:
Hello. I have always thought that the eval() function was very flexible and useful. If I use it, I can define functions at runtime!! However, I have found a case where eval() does not work...
0
by: Veli-Pekka Tätilä | last post by:
Hi, My first post here. I've found some serious accessibility flaws in the Python 2.4 docs and wish they could be rectified over time. I'm very new to Python and initially contacted docs at python...
3
by: karthick | last post by:
Hi, I have a DataSet returning minimum 60 to 100 rows. I am querying the Database and populating the DataSet with the data, no matter how big or small the data is. What I want do is, I should be...
2
by: Ramya A | last post by:
Hi All: I have a .NET webservice accepting an XML request document as a parameter How do I call this webservice with ServerXMLHTTP object from my VB6.0 client? I have enabled the HttpPost...
7
by: pamelafluente | last post by:
The precious input given by Laurent, Martin, Benjamin about XMLHttpRequest in Javascript, has made me think that perhaps I could improve what I am currently doing by using Ajax. Let's make it...
1
by: Tarik Monem | last post by:
OK, I'm pretty sure this cannot work because I'm trying to use JavaScript (client-side) to write to an xml file (which is server-side) using XMLHttpRequest. Can I use PHP do what I'm trying to do?...
5
by: SAM | last post by:
Mtek a écrit : no, that is the code given to the server we need the code received by the browser (snip) you'll certainly need Ajax or to send the form and get-it back
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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.