Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

using prototype with asp.net

  • 04-04-2007 8:37pm
    #1
    Registered Users, Registered Users 2 Posts: 872 ✭✭✭


    Hi,

    I have heard great things about prototype so im trying to use it with a basic asp.net page:
    [B]HTML[/B]
    <a href="javascript:doAjax()">Link</a>
    
    [B]JS[/B]
    
    function doAjax(){
     new Ajax.Request('default.aspx?id=1', {   method: 'get',   parameters: {}   }); 
    }
    

    I thought the above would call default.aspx?id=1 and do what i want it to do when this url is requested but nothing is happening.

    Any ideas what im doing wrong ?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Can you post the code behind for default.aspx?


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    it's just

    page_load
    {

    if(!IsPostBack)
    {
    //do stuff
    }

    if(Request["id"] == "1")
    {
    Response.Write("Ajax Called"); // this is meant to write out when the ajax.request is called in the javascript.
    }

    }

    i know i'm missing something very simple, i just dont know what it is...


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    HTML
    <a href="javascript:doAjax()">Link</a>

    JS

    function doAjax(){
    new Ajax.Request('http://www.yourserver.com/default.aspx?id=1', { method: 'get', parameters: {} });
    }

    I don't have time to really look at it but I'd hazard a guess and say that the default.aspx url isn't fully qualified. It is in the code above, try that.


Advertisement