aspnet-client-validation icon indicating copy to clipboard operation
aspnet-client-validation copied to clipboard

Remote does not handle `url` that already has `?`

Open 3400442579 opened this issue 10 months ago • 2 comments

?handler=Unique?IP=192.168.1.2

请求 url 会有两个 ‘?’

3400442579 avatar Jan 09 '25 08:01 3400442579

请求 url 会有两个 ‘?’

Translation: The request url will have two ‘?’

Seems legit, if url already has a ? we should use a & here to concatenate payload: https://github.com/haacked/aspnet-client-validation/blob/c616741b43a5a88049ef45660defd24c9a958a2a/src/index.ts#L390

dahlbyk avatar Jan 09 '25 22:01 dahlbyk

asp.net core razor pages

[PageRemote(ErrorMessage ="已存在", PageHandler= "AccountUnique")]
PageHandler 会自动生成 xxxxx?handler=AccountUnique

request.open('get', url + '?' + payload);

就会变成

xxxxx?handler=AccountUnique?payload

请求页面就会不存在,

如果用 [PageRemote(ErrorMessage ="已存在", PageName = "AccountUnique")] 是正常的 ,

3400442579 avatar Jan 10 '25 03:01 3400442579