0

I'm working on task where I need to update the process from the API.

There is API which is updating the number of items from backend c# mvc code and I need to show that number of items processed in to front-end which is managed by VueJS.

here is my code example for better understanding.

process.cs

int counter = 0;
foreach (int item in items)
{
    //some logic
    counter++;
    Session["NumberProcessed"] = counter;

}

display.vue

processClick(){
        var interval = setInterval(this.incrementTime, 1000);
        axios.post(api.hostname + '/api/process/update').then(response => {
        //some Code
    });
    },
    incrementTime() {
            this.timeCounter = this.timeCounter + 1;
            let processNumbers = Session["NumberProcessed"];
            alert(processNumbers);    
          },

but when I'm using same session into vue file it is throwing error

Uncaught ReferenceError: Session is not defined at

I had also tried with cookie and localstorage but it is not allow me to get those items too.

can anybody help me out with this issue...

  • Relevant: [What is the difference between client-side and server-side programming?](https://stackoverflow.com/q/13840429) – VLAZ Jul 06 '22 at 10:04
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jul 06 '22 at 12:12

0 Answers0