Upload and Validate XML against XSD in C# Razor Page, Visual Studio 2019

Опубликовано: 30 Сентябрь 2024
на канале: Brandan Jones
3,481
17

In this video, I create a new page on an existing project. I place a form with enctype=multiplart/form, and method=post. I add an upload button to upload a file to the server. On the server side, I receive the file, save it locally, setup XSD validation, and then read the file to validate it. I create a ValidationEventHandler to process errors, and then use an exception with try-catch to halt execution of the program, and report an error, when an error occurs.

This video is part of a playlist on integrating JSON Data APIs in C# Visual Studio 2019:    • Azure Fundamentals: Overview  

Source code is freely available on GitHub at https://github.com/discospiff/PlantDiary