Last post Dec 15, 2009 01:22 AM by ravenet
Feb 16, 2009 12:46 AM|tempid159|LINK
I have one page called /gallery/default.aspx. When the page loads for the first time, I am calling a Page Method using jQuery and loading the list of albums just fine. When any one of the album is clicked, it routes to a virtual URL -- /gallery/albums/my-album1.aspx
which in turn redirects to the same /gallery/default.aspx page but with the "aid" (albumId) parameter as query string. The Page_Load event handler of the default.aspx looks something like this --
string id = Request.QueryString["id"];
"CallPageMethod('LoadDefault', , onSuccess, onFail);",
"CallPageMethod('LoadPhotos', ['albumId', 'my-album1'], onSuccess, onFail);",
true); //hard-coded to load my-album1 for now.
The first "If" part loads just fine. When I click on one of the albums, I get this JS error --
'$' is undefined.
If I replace the above section with just LoadPhotos (the second if statement), it loads the photos just fine. The jQuery ajax call back is not working for virtual URL's.
Is there any work around? Thanks for any help!
Feb 16, 2009 01:58 AM|tempid159|LINK
Never mind, I figured it out. When I dragged and dropped jQuery into the ASPX, the path was set to --
When the virtual URL request came, it was searching for the .js file at a different location --
which does not exist. I fixed the issue by modifying the path to the script source --
Notice the "/" before scripts.
It was now able to find the .js file and all's well again.
Feb 16, 2009 04:37 AM|magendran|LINK
I thing u r JQuery js path is wrong.. Please chech the path(drag and drop the js from .aspx page).
U try this.....
Dec 14, 2009 05:21 PM|ravesoft|LINK
This is not work when you are go new virual url. just try this way then you will be see
http://localhost/test/20091214 -- here not work
Dec 15, 2009 01:22 AM|ravenet|LINK
can you explain more about this way.