I created a treeview webpart, and if you click a node, it modifies a SPList, and clears and recreates the treeview.
So when I click a node, the page gets refreshed, then the treeview function occurs and edits the list and recreates the treeview. THEN the problem is if I were to refresh the page by hitting F5, the same thing happens again i.e. the List gets modified again even though i didn’t click a node.
I suspect something like the treeview node select change event was activated again.
As well this happens when I hit refresh:

Is it somehow resending the tree click flag or something? How can I clear it when refreshing so it doesn’t try to resend it?
There are two common approaches for preventing actions performed on postback from being called repeatedly by user’s refreshing the page:
In whatever code that they are running do some sort of check to see if they have already done what they are about to do. Sometimes this is easy (i.e. they clicked to delete an item, but I see it’s already deleted) and sometimes it’s just not possible or practical.
After performing the postback that you don’t want to be repeated do a
Response.Redirect(to either another page, or even just the same page). By doing this when they hit refresh their ‘last action’ won’t be the pastback, it will be the result of the redirect. Of course, if they start using their history to go ‘back’ they could easily end up redoing whatever action you had done before. This course of action isn’t stopping them from intentionally (or maliciously) duplicating the action, it’s just allowing them to hit ‘refresh’ without accidentally duplicating the action. Also note that this comes with a cost. You will need perform another back and forth with the client, and you’ll need to re-generate the entire page (this will likely have a performance cost, and potentially be difficult to implement as well, depending on the specifics).