locked
Ajax and Asp.net razor web pages RRS feed

  • Question

  • User-1234412845 posted

    I have a profile page which has a edit profile button which when clicked turn all the user detail fields (like first name, last name, country etc) into input textbox to edit the details and then click the save button to update the details in the database. Is there any way to work with ajax or any other language to implement this thing. Will be waiting for reply from you all guys. Thanks

    Thursday, April 14, 2016 5:24 PM

Answers

  • User61956409 posted

    Hi sshary19,

    I have a profile page which has a edit profile button which when clicked turn all the user detail fields (like first name, last name, country etc) into input textbox to edit the details and then click the save button to update the details in the database. Is there any way to work with ajax or any other language to implement this thing. Will be waiting for reply from you all guys. Thanks

    If you are using MVC pattern, you could call Controller action methods from razor page using jQuery Ajax to fetch data from database, then you could dynamically populate textboxes based on returned data on Ajax success callback function. About how to call Controller action methods using Ajax, please check this article.

    http://www.c-sharpcorner.com/UploadFile/337dfd/useful-way-to-call-controller-actions-from-html-using-jquery/

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2016 3:06 AM

All replies

  • User61956409 posted

    Hi sshary19,

    I have a profile page which has a edit profile button which when clicked turn all the user detail fields (like first name, last name, country etc) into input textbox to edit the details and then click the save button to update the details in the database. Is there any way to work with ajax or any other language to implement this thing. Will be waiting for reply from you all guys. Thanks

    If you are using MVC pattern, you could call Controller action methods from razor page using jQuery Ajax to fetch data from database, then you could dynamically populate textboxes based on returned data on Ajax success callback function. About how to call Controller action methods using Ajax, please check this article.

    http://www.c-sharpcorner.com/UploadFile/337dfd/useful-way-to-call-controller-actions-from-html-using-jquery/

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2016 3:06 AM
  • User-1234412845 posted

    Thanks, I hope this works 

    Friday, April 15, 2016 4:58 AM
  • User-1234412845 posted

    Hi sshary19,

    sshary19

    I have a profile page which has a edit profile button which when clicked turn all the user detail fields (like first name, last name, country etc) into input textbox to edit the details and then click the save button to update the details in the database. Is there any way to work with ajax or any other language to implement this thing. Will be waiting for reply from you all guys. Thanks

    If you are using MVC pattern, you could call Controller action methods from razor page using jQuery Ajax to fetch data from database, then you could dynamically populate textboxes based on returned data on Ajax success callback function. About how to call Controller action methods using Ajax, please check this article.

    http://www.c-sharpcorner.com/UploadFile/337dfd/useful-way-to-call-controller-actions-from-html-using-jquery/

    Best Regards,

    Fei Han

    No I am not using MVC pattern, I am using razor web pages. Is there any chance I can update profile data using ajax/jquery without reloading page in asp razor web pages not mvc.

    Saturday, April 30, 2016 5:00 PM