PDA

View Full Version : Problem at Ajax Tabs Content script



kahhiung
09-29-2006, 05:42 AM
1) Script Title: Ajax Tabs Content script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3) Describe problem: I have tried this script. I found that if my page have a button, once I click on the button, the tab will be missing and the page will be redirect back to the page where the button located at. May I know is there any solution for this?

jscheuer1
09-29-2006, 05:00 PM
There are all kinds of buttons. What you describe sounds like a submit button but, it could be some other type. We would need a link to the problem page to help with this one.

kahhiung
09-30-2006, 12:46 AM
The application is still under development. The button is the ASP.NET button (system.web.UI.WebControls.Button). Once I click, it will postback to the same page and fire the onclick event.

Thanks

jscheuer1
09-30-2006, 02:56 AM
Once you post back to a page with Ajax content on it, it will return to its default state, at least as far as Ajax is concerned. If you are in fact posting to the content page (this sounds like what is happening but, I have no understanding of how ASP.NET could know to do that unless the page's address is in the button's code), that is the page that will load.

Ajax content does not mix well with server side code. Use one or the other to accomplish your aims. Server-side code has ways of including content from one page on another. If you need dynamic includes, forget it. Use dynamic content on a single page like the:

http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

Even that will need some work to go with server-side code but, at least it is doable if the client has javascript enabled.

Which brings me to another point. Have you even considered what will happen if the user doesn't have a javascript enabled browser?

kahhiung
09-30-2006, 03:13 AM
thanks for your replay. I have no experience in using Ajax. So, not sure how it's work. But, from what i know, Ajax should only work in ASP.NET 2.0? Is this issue causing the problem?

jscheuer1
09-30-2006, 06:31 AM
Ajax, is a largely misunderstood body of javascript calls that can be used client side in many modern browsers to retrieve content from other pages on a given domain and make some use of it, presentationaly or otherwise, on the current page. Ajax can be combined with older javascript techniques and, to some extent, with server-side languages (integration here is problematic for the reasons I've already outlined and more). Whenever any Ajax technique is incorporated with any other code, that other code is often mistaken by many to also be Ajax. Ajax is not dependant upon any server side language or other scripting techniques.