Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model Project
- @{
- ViewData["Title"] = "Import Projects";
- }
- @if (!ViewData.ModelState.IsValid)
- {
- <div class="alert alert-danger" style="margin-top:10px;">
- <ul>
- @foreach (var modelState in ViewData.ModelState.Values)
- {
- foreach (var error in modelState.Errors)
- {
- <li>@error.ErrorMessage</li>
- }
- }
- </ul>
- </div>
- }
- <form asp-controller="Project" asp-action="Import" method="post" enctype="multipart/form-data">
- <div class="form-group" style="margin-top:10px;">
- <label for="file">Select File:</label>
- <input type="file" class="form-control-file" id="file" name="file">
- </div>
- <button type="submit" class="btn btn-primary" style="margin-top:10px;">Upload File</button>
- </form>
- <h1>Import Instructions</h1>
- <p>To import projects, please upload a JSON file containing project data.</p>
- <h3>JSON Format</h3>
- <p>The JSON file should have the following structure:</p>
- <pre>
- {
- "projects": [
- {
- "title": "Project 1",
- "description": "Description of Project 1",
- "author": "John Doe",
- "programmingLanguage": "C#",
- "completionTime": 50,
- "status": "Completed"
- },
- {
- "title": "Project 2",
- "description": "Description of Project 2",
- "author": "Jane Smith",
- "programmingLanguage": "Java",
- "completionTime": 120,
- "status": "Completed"
- },
- {
- "title": "Project 3",
- "description": "Description of Project 3",
- "author": "Alice Johnson",
- "programmingLanguage": "Python",
- "completionTime": 80,
- "status": "Completed"
- }
- ]
- }
- </pre>
Add Comment
Please, Sign In to add comment