I am using temp data as follow in my controllers - very simple, when there is a problem:
TempData("StatusMessage") = "You have no items set to Auto-Ship."
Then on every page I have a user control as follows:
<div class="error-container">
<% If TempData.ContainsKey("ErrorMessage") Then%>
<script> $('div.error-container').show();</script>
<div class="msg-error"><p><%=TempData("ErrorMessage") %></p></div>
<% End If%>
<% If TempData.ContainsKey("StatusMessage") Then%>
<script> $('div.error-container').show();</script>
<div class="msg-status"><p><%=TempData("StatusMessage")%></p></div>
<% End If%>
<ul></ul>
</div>
Problem is when I do have an error added to tempdata it shows up properly on the first request but ALSO shows up again on the next request as well - which is obviously very confusing and not a desired behavior.
I am not using any IoC, I did see the post with the same problems when using that.