英文:
Global Payments Hosted Fields won't display on Blazor Web Assembly app unless a page Refresh
问题
我必须使用Global Payments的Hosted Fields解决方案。我在index.html中包括javascript文件,并在razor页面中添加div。我在razor页面的OnAfterRenderAsync中调用JS Interop,配置和调用cardform的创建。但是,Hosted Fields不会显示,除非我进行刷新或后退然后前进,或者如果我使用开发者工具来检查,然后字段会显示。
我尝试重新加载窗口,但目前只能接受页面的一闪而过。我尝试将其移动到一个单独的组件,并设置一个虚拟字段以强制状态更改。我尝试重新加载、刷新、重置整个表单,什么都没用。只有在按下F5或返回到上一页再进入页面或打开开发者工具并检查时才会显示。我期望看到Hosted Fields。
奇怪的是,我在.Net Maui Blazor Hybrid中使用相同的Razor类库,它能正常工作,但如果我在Blazor Web Assembly中使用,它不起作用。
英文:
I am required to use the Hosted Fields solution from Global Payments. I include the javascript file in index.html and add the div's to the razor page. I make a call to JS Interop from the OnAfterRenderAsync in the razor page which configures and calls the cardform creation. However, the Hosted Fields don't display unless I do a Refresh or back button then forward or if I use developer tools to inspect, then the fields display.
I tried reloading the window, I'll take a flicker at this point. I have tried moving it to a separate component and setting a dummy field to force a state change. I have tried reload, refresh, reset the entire form, nothing. It only displays if I press F5 or go back a page and go into the page again or if I go to Developer Tools and Inspect. I expected to see the Hosted Fields.
What is strange is that I use this same Razor Class Library in .Net Maui Blazor Hybrid and it works fine, but if I use in the Blazor Web Assembly it doesn't work correctly.
答案1
得分: 1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论