Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 767793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:04:53+00:00 2026-05-14T18:04:53+00:00

I have two user controls on the page and one of the user control

  • 0

I have two user controls on the page and one of the user control has this text aread.
which is used to add a note and but when they click add note button the page reloads.
I do not want the page to reload ,i was looking for an example which this is done without
postback.

Thanks

i tired doing this using JSON , but it throws the following error

The HTTP verb POST used to access path ‘/Documents/TestNote/Documents/AddNote’ is not allowed.

<script type="text/javascript">
    $(document).ready(function() {

        $("#btnAddNote").click(function() {
            alert("knock knock");
            var gnote = getNotes();
            //var notes = $("#txtNote").val();
            if (gnote == null) {
                alert("Note is null");
                return;

            }

            $.post("Documents/AddNote", gnote, function(data) {
                var msg = data.Msg;
                $("#resultMsg").html(msg);
            });
        });
    });

    function getNotes() {
        alert("I am in getNotes function");
        var notes = $("#txtNote").val();
        if (notes == "")
            alert("notes is empty");
        return (notes == "") ? null : { Note: notes };
    }
</script>
</asp:Content>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:04:54+00:00Added an answer on May 14, 2026 at 6:04 pm

    Something like this would give you the ability to send data to an action do some logic and return a Json result then you can update your View accordingly.

    Javascript Function

    function AddNote(){
       var d = new Date(); // IE hack to prevent caching
    
       $.getJSON('/MyController/MyAction', { data: "hello world", Date: d.getTime() }, function(data) {
         alert(data);
         // call back update your view here
       });
    }
    

    MyController Action

    public virtual JsonResult MyAction(string data)
    {
       // do stuff with your data here, which right now my data equals hello world for this example
       return Json("ReturnSomeObject");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control in my wp7 application which contains two text boxes
I have two user controls on the same page. One contains a ListView that
I have a user control in a master page with two drop down lists.
I have two User Controls already created now I want to use one as
I have two user controls, in one of them I have a textbox, i
Is it possible to have two controls on one page side-by-side in Silverlight? It
i have two user controls , both of them in the same master page
I have a user control and it has a method which is executed when
I have two instances of a user control on a page. Both have fields
I have two user controls in my ASP.Net project, one that is explictly for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.