Results 1 to 3 of 3

Thread: pagemethods

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    pagemethods

    I am using PageMethods in my javascript to call a function in my c# code which is static. In that code, all I have was "response.redirect("default.aspx").. but somehow it never gets redirected. It just stays there.

    Code:
    function testredirect()
    PageMethods.Navigation()
    
    C# code:
    Public static void Navigation()
    Response.redirect("Default.aspx");

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: pagemethods

    Hey,

    Have you set the EnablePageMethods property of the ScriptManager to True? Have you decorated the method with the appropriate attribute?

    See here:

    http://www.singingeels.com/Articles/...PNET_AJAX.aspx

    Gary

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: pagemethods

    Response.Redirect means nothing in ASP.NET AJAX. With PageMethods, you're using javascript to talk to a page, but a response.redirect is only relevant to a browser. If you want the page to redirect, send some javascript to the page using ScriptManager.RegisterStartupScript.

    document.location.href='page9.aspx';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width