Real time delete functionality ASP NET MVC made with PUSHERPusher - Ping pong functionalityWhat is the claims in ASP .NET IdentityReal time chart using pusher and canvas jsAndroid Google Map + Pusher (real time) ListenerReal Time Fetching data with laravel5.2 , vue.js and pusherHow can I call controller post action from jquery (in custom view page) in mvc .net web apphow to display images pusher real time chatWhy solutions like pusher claim to be “Real time”?Real-time listener doesn't work in PWA with PusherReal time react web app with pusher and laravel

How to cope with regret and shame about not fully utilizing opportunities during PhD?

Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?

Is it safe to use two single-pole breakers for a 240v circuit?

Why was my Canon Speedlite 600EX triggering other flashes?

A case where Bishop for knight isn't a good trade

Re-testing of regression test bug fixes or re-run regression tests?

Why doesn't Iron Man's action affect this person in Endgame?

Why weren't the bells paid heed to in S8E5?

Would life always name the light from their sun "white"

Acronyms in HDD specification

AMPScript Lookup From Child Business Unit

The meaning of the Middle English word “king”

What is this old US Air Force plane?

Substring join or additional table, which is faster?

How to describe a building set which is like LEGO without using the "LEGO" word?

Unexpected Netflix account registered to my Gmail address - any way it could be a hack attempt?

Single word that parallels "Recent" when discussing the near future

is it correct to say "When it started to rain, I was in the open air."

Where to find every-day healthy food near Heathrow Airport?

White foam around tubeless tires

Uh oh, the propeller fell off

Is it wrong to omit object pronouns in these sentences?

Why did the soldiers of the North disobey Jon?

Find the unknown area, x



Real time delete functionality ASP NET MVC made with PUSHER


Pusher - Ping pong functionalityWhat is the claims in ASP .NET IdentityReal time chart using pusher and canvas jsAndroid Google Map + Pusher (real time) ListenerReal Time Fetching data with laravel5.2 , vue.js and pusherHow can I call controller post action from jquery (in custom view page) in mvc .net web apphow to display images pusher real time chatWhy solutions like pusher claim to be “Real time”?Real-time listener doesn't work in PWA with PusherReal time react web app with pusher and laravel






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
(https://pusher.com/tutorials/realtime-comments-aspnet/)



The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



I know that SignalR would work great here but I want to make it with a websocket.



Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



Thanks.



 public async Task<ActionResult> Delete_comment(Comment data)

Comment com1 = db.Comments.Find(data.CommentID);
db.Comments.Remove(com1);
db.SaveChanges();
var options = new PusherOptions();
options.Cluster = "eu";
var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
return Content("ok");



FORM



 <form onsubmit="return false;">
<input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
@Html.HttpMethodOverride(HttpVerbs.Delete)
<button class="btn" v-on:click="delete_comment()">remove </button>
</form>


DELETE SCRIPT



 listen2: function () 
my_channel.bind("asp_delete_event", (data) =>
this.comments.splice(data.index, 1);
alert("Comment Deleted2313");
)
,


delete_comment: function ()
axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
.then((response) =>
alert("Comment Deleted");
);
,









share|improve this question




























    0















    I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



    The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
    (https://pusher.com/tutorials/realtime-comments-aspnet/)



    The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
    If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



    I know that SignalR would work great here but I want to make it with a websocket.



    Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



    Thanks.



     public async Task<ActionResult> Delete_comment(Comment data)

    Comment com1 = db.Comments.Find(data.CommentID);
    db.Comments.Remove(com1);
    db.SaveChanges();
    var options = new PusherOptions();
    options.Cluster = "eu";
    var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
    ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
    return Content("ok");



    FORM



     <form onsubmit="return false;">
    <input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
    @Html.HttpMethodOverride(HttpVerbs.Delete)
    <button class="btn" v-on:click="delete_comment()">remove </button>
    </form>


    DELETE SCRIPT



     listen2: function () 
    my_channel.bind("asp_delete_event", (data) =>
    this.comments.splice(data.index, 1);
    alert("Comment Deleted2313");
    )
    ,


    delete_comment: function ()
    axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
    .then((response) =>
    alert("Comment Deleted");
    );
    ,









    share|improve this question
























      0












      0








      0








      I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



      The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
      (https://pusher.com/tutorials/realtime-comments-aspnet/)



      The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
      If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



      I know that SignalR would work great here but I want to make it with a websocket.



      Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



      Thanks.



       public async Task<ActionResult> Delete_comment(Comment data)

      Comment com1 = db.Comments.Find(data.CommentID);
      db.Comments.Remove(com1);
      db.SaveChanges();
      var options = new PusherOptions();
      options.Cluster = "eu";
      var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
      ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
      return Content("ok");



      FORM



       <form onsubmit="return false;">
      <input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
      @Html.HttpMethodOverride(HttpVerbs.Delete)
      <button class="btn" v-on:click="delete_comment()">remove </button>
      </form>


      DELETE SCRIPT



       listen2: function () 
      my_channel.bind("asp_delete_event", (data) =>
      this.comments.splice(data.index, 1);
      alert("Comment Deleted2313");
      )
      ,


      delete_comment: function ()
      axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
      .then((response) =>
      alert("Comment Deleted");
      );
      ,









      share|improve this question














      I am trying to implement a real time comment system in ASP.NET MVC 5 made via PUSHER web socket. I want to post and delete a comment in this system.



      The submit function works perfect, I followed the steps in this tutorial and everything worked fine.
      (https://pusher.com/tutorials/realtime-comments-aspnet/)



      The problem I have is at the delete function. First, I need to delete the comment from database(I need the commentID) and after that I need to make async to delete the comment from my webpage list(I need the index for that comment).
      If i use this.splice(index,1), the function deletes the item but when I refresh the page it reapers because I cannot reach the controller function.



      I know that SignalR would work great here but I want to make it with a websocket.



      Can you give me some advices on how I can implement this functionality? I am trying for more than 4 days and I can't find the resolvation.



      Thanks.



       public async Task<ActionResult> Delete_comment(Comment data)

      Comment com1 = db.Comments.Find(data.CommentID);
      db.Comments.Remove(com1);
      db.SaveChanges();
      var options = new PusherOptions();
      options.Cluster = "eu";
      var pusher = new Pusher("724721", "a3d740957cfa714c5b6e", "3e1e7ad2abc0c6ccf18f", options);
      ITriggerResult result = await pusher.TriggerAsync("asp_channel", "asp_delete_event", com1);
      return Content("ok");



      FORM



       <form onsubmit="return false;">
      <input type="hidden" id="CommentID" v-model="comment.CommentID" class="form-control" />
      @Html.HttpMethodOverride(HttpVerbs.Delete)
      <button class="btn" v-on:click="delete_comment()">remove </button>
      </form>


      DELETE SCRIPT



       listen2: function () 
      my_channel.bind("asp_delete_event", (data) =>
      this.comments.splice(data.index, 1);
      alert("Comment Deleted2313");
      )
      ,


      delete_comment: function ()
      axios.delete('@Url.Action("Delete_comment", "Comments", new , protocol: Request.Url.Scheme)', this.comment)
      .then((response) =>
      alert("Comment Deleted");
      );
      ,






      asp.net model-view-controller delete-row pusher






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 14:19









      Andrei TeodorescuAndrei Teodorescu

      11




      11






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314652%2freal-time-delete-functionality-asp-net-mvc-made-with-pusher%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314652%2freal-time-delete-functionality-asp-net-mvc-made-with-pusher%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?