khalidabuhakmeh/HtmxTables

Model bound properties appear to set values in partial response

Closed this issue · 2 comments

If you create a new partial in a post, the request values override what is returned in the response.
I know this isn't an issue for this repo, but looking for ideas on why this is happening.

Code change:
CodeChange

Response is not modified:
Response

This test was run against the Entry page, and I submitted the form with a Name = test and Age =1.
I tried to modify the response to set the value to Name = "ModifiedOnPost" and Age = 10000 in the OnPost method. The change appears to be made, but when the response gets to the browser the initial values are returned.

You can avoid this by calling:
PageContext.ModelState.Clear();