ibrahimjan Posted March 16, 2012 Share Posted March 16, 2012 Hi All,I was not to sure where to post this ASP or JS, anyways it has both elements in there so hopefully some one can help, I am using a ASPAJAX library for AJAX functionality, what I need the following code to do is refresh but still to use the "test1" variable, at the moment when it refreshes it does not load the request.query from the URL?? Any ideas how I can still use the same QueryString?? when it refreshes The library can be downloaded from the following link ASPajax with full SDK <!--#include virtual="/aspajax/aspajax.asp"--> <% ASPAjax.Open() ' Set up ASPajaxtest1 =request.QueryString("test1") ' Create an UpdatePanel to load the content into. dim myPanel Set myPanel = ASPAjax.CreateUpdatePanel myPanel.Id = "MainContent" myPanel.ChildrenAreTriggers = true myPanel.FetchWholeDocument = true ' Retrieve the whole target URL to the UpdatePanel myPanel.RefreshInterval = 5 ' UpdatePanel self refreshes every 5 seconds myPanel.RegisterTriggerGroup("PageNav") ' DOM object PageNav's child nodes now activate the UpdatePanel myPanel.Open%> <h1> Main Cotent </h1><%response.Write(test1)%><%myPanel.Close%><% ASPAjax.Close()' Close ASPajax at the end of the HTML %> Link to comment Share on other sites More sharing options...
justsomeguy Posted March 16, 2012 Share Posted March 16, 2012 I'm not sure how a refresh gets triggered, but it doesn't look it is using test1 anywhere in the ajax. You're writing the value explicitly to the element, but the code to set up the refresh doesn't do anything with it from what I can tell. Is there an example online that you're trying to base your code on? Link to comment Share on other sites More sharing options...
ibrahimjan Posted March 16, 2012 Author Share Posted March 16, 2012 Ok this is my live link http://www.jancodesign.com/test3.asp?test1=testing The simple idea is to be able to pick up data from the DB up to date and constantly refreshing the new data on the page, thats where the refresh comes in, it seams to work fine with out a QueryString, if you modify the asp file manually and upload it to the server it seams to refresh the content without intervention. The code generated from the ASPAjax is: <script type='text/javascript' src='/aspajax/aspajax.asp?ixsf23x4sn=s83hjdhj'></script><script type='text/javascript' >ASPAjax.activateDOM('PageNav','MainContent',true,true,true); </script><span class='asp-ajax-loader' style='position:absolute' id='AJAXLOADER_____MainContent'></span><div style='display:inline' id='AJAX_____MainContent'> <h1> Main Cotent </h1>testing<script type='text/javascript' >ASPAjax.activateDOM('AJAX_____MainContent','MainContent',true,false,true);try{clearTimeout (DIC__MainContent)}catch(e){};DIC__MainContent = setTimeout (function(){ASPAjax.submit('','MainContent')}, 5000);</script></div> Link to comment Share on other sites More sharing options...
ibrahimjan Posted March 16, 2012 Author Share Posted March 16, 2012 I tried it with changing the JS, and it seams to refresh with the QueryString fine, please have a look at bottom part of the JS. <%test1 =request.QueryString("test1")%><script type='text/javascript' src='/aspajax/aspajax.asp?ixsf23x4sn=s83hjdhj'></script><script type='text/javascript' >ASPAjax.activateDOM('PageNav','MainContent',true,true,true); </script><span class='asp-ajax-loader' style='position:absolute' id='AJAXLOADER_____MainContent'></span><div style='display:inline' id='AJAX_____MainContent'> <h1> Main Cotent </h1><%response.Write(test1)%><script type='text/javascript' >ASPAjax.activateDOM('AJAX_____MainContent','MainContent',true,false,true);try{clearTimeout (DIC__MainContent)}catch(e){};DIC__MainContent = setTimeout (function(){ASPAjax.submit('test4.asp<%test1%>','MainContent')}, 5000);</script></div> is there away I can change it on the ASP code?? Thank you Link to comment Share on other sites More sharing options...
justsomeguy Posted March 16, 2012 Share Posted March 16, 2012 I'm not sure there's a way to do it like you have it set up, the examples on their page use the ajax to load links and things. Those links can have whatever you want in the querystring, but your panel looks like it's just refreshing the current page. The loader adds its own querystring parameters, it doesn't use the ones on the current page. It would use whatever querystring parameters are in links inside the update panel. There's an example here, when you hover over the tabs you can see that the URLs have querystrings: http://www.aspajax.org/asp-ajax-examples-tabstrip.asp That's a different setup then your page though, that is using it to intercept the clicks and load them using ajax. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.