locked
ASP .Net Core Editors / Prototypes for creating web pages / views - drag and drop. RRS feed

  • Question

  • User134115210 posted

    Gretings,

    i am new to web developent but got about 20 years backend programming skills in c#

    i am trying to find easy solutions to build asp .net MVC pages / views using real-time designers to generate client code + stylesheets etc.

    Does these exist?

    I have found a particular package interesting but it looks like just raw html and a load of javascript components when exported.

    "Justinmind Prototyper 8.7.7"

    thank you.

    Sunday, March 1, 2020 1:56 AM

All replies

  • User1120430333 posted

    i am trying to find easy solutions to build asp .net MVC pages / views using real-time designers to generate client code + stylesheets etc.

    I suggest that you  learn ASP.NET Razor pages that  also uses the MVC pipe line, but it is much easier to develop with and it's kind of like using Windows form or ASP.NET Web form. There is no such tool that I know that your seeking. JavaScript, CSS and HTML are independent components that work in the same client-side environment, and some designer that going to combine all 3 technologies and try to build view is just a little too much to ask for in some pie in the sky solution.

    And if push comes to shove, you can use a controller and a view in a Razor page project too.

    https://stackify.com/asp-net-razor-pages-vs-mvc/

    @page
    @model CreateModel
    @{
        ViewData["Title"] = "Create";
    }
    
    <!DOCTYPE html>
    
    <link rel="stylesheet" href="Styles/StyleSheet.CSS" />
    
    <html>
    <head>
        <title>Create</title>
    </head>
    
    <body>
    <h1>Author Payroll</h1>
    
        <form method="post">
    
            <fieldset>
    
                <legend>Create</legend>
    
                <div asp-validation-summary="All">
                    <span>Please correct the following errors</span>
                </div>
    
                @Html.Hidden("PayRoll.AuthorId")
    
                <div class="form-group">
                    <div class="editor-field">
                        @Html.Label("Author:")
                        <select name="PayRoll.AuthorTypeId" asp-items="Model.PayRoll.AuthorTypes"></select>
                        <span class="alert-danger" asp-validation-for="PayRoll.AuthorTypeId"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="editor-field">
                        @Html.Label("Salary:")
                        <input type='text' class='txtbox' asp-for="PayRoll.Salary" />
                        <span class="alert-danger" asp-validation-for="PayRoll.Salary"></span>
                    </div>
                </div>
                <br />
                <p>
                    <input type="submit" name="submit" value="Save" />
                    <input type="submit" name="submit" value="Cancel" />
                </p>
    
            </fieldset>
    
    </form>
    </body>
    </html>
    
    
    
    
    
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using Microsoft.AspNetCore.Mvc.Rendering;
    
    namespace WebRazor3.x.Models
    {
        public class PayRollVM
        {
            public class Payroll
            {
                public int PayRollId { get; set; }
                public int AuthorId { get; set; }
                public string AuthorFirstName { get; set; }
                public string AuthorLastName { get; set; }
    
                [Required(ErrorMessage = "Author is required")]
                public string AuthorTypeId { get; set; }
    
                [Required(ErrorMessage = "Salary is required")]
                public int? Salary { get; set; }
    
                public List<SelectListItem> AuthorTypes { get; set; } = new List<SelectListItem>();
    
            }
            public List<Payroll> Payrolls { get; set; } = new List<Payroll>();
        }
    }
    
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Mvc.RazorPages;
    using WebRazor3.x.Models;
    
    namespace WebRazor3.x.Pages.PayRoll
    {
        public class CreateModel : PageModel
        {
            private readonly IPayRollDM _payrollDm;
            public CreateModel(IPayRollDM payrollDm)
            {
                _payrollDm = payrollDm;
            }
    
            [BindProperty]
            public PayRollVM.Payroll PayRoll { get; set; } 
            public IActionResult OnGet()
            {
                PayRoll = _payrollDm.Add();
                return Page();
            }
    
            public IActionResult OnPost(string submit)
            {
                if (submit == "Cancel") return RedirectToPage("Index");
    
                if (!ModelState.IsValid)
                {
                    PayRoll = _payrollDm.PopulateSelectedList(PayRoll);
                    return Page();
                }
    
                if (_payrollDm.BlnFindPayRollByAuthorId(int.Parse(PayRoll.AuthorTypeId)))
                {
                    ModelState.AddModelError("AuthorTypeId", "Author has an existing PayRoll record.");
                }
                else
                {
                    ModelState.Clear();
                }
    
                if (!ModelState.IsValid)
                {
                    PayRoll = _payrollDm.PopulateSelectedList(PayRoll);
                    return Page();
                }
    
                _payrollDm.Add(PayRoll);
                return RedirectToPage("Index");
                
            }
        }
    }
    using System.Linq;
    using Entities;
    using Microsoft.AspNetCore.Mvc.Rendering;
    using ServiceLayer;
    
    namespace WebRazor3.x.Models
    {
        public class PayRollDM : IPayRollDM
        {
            private IPayRollSvc svc;
            private IAuthorSvc svcauth;
            public PayRollDM(IPayRollSvc payRollSvc, IAuthorSvc authorSvc)
            {
                svc = payRollSvc;
                svcauth = authorSvc;
            }
    
            public PayRollVM GetAll()
            {
                var vm = new PayRollVM();
    
                var dtos = svc.GetAll().ToList();
    
                vm.Payrolls.AddRange(dtos.Select(dto => new PayRollVM.Payroll()
                {
                    PayRollId = dto.PayRollId,
                    AuthorId = dto.AuthorId,
                    AuthorFirstName = dto.AuthorFirstName,
                    AuthorLastName = dto.AuthorLastName,
                    Salary = dto.Salary
                }).ToList());
    
                return vm;
            }
    
            public PayRollVM.Payroll Find(int id)
            {
                var dto = svc.Find(id);
    
                var payroll = new PayRollVM.Payroll
                {
                    PayRollId = dto.PayRollId,
                    AuthorId = dto.AuthorId,
                    AuthorFirstName = dto.AuthorFirstName,
                    AuthorLastName = dto.AuthorLastName,
                    Salary = dto.Salary
                };
    
                return payroll;
            }
            public bool BlnFindPayRollByAuthorId(int id)
            {
                bool blnflag = false;
    
                var dto = svc.FindPayRollByAuthorId(id);
    
                if (dto.PayRollId != 0)
                {
                    blnflag = true;
                }
    
                return blnflag;
            }
            public PayRollVM.Payroll Add()
            {
                return PopulateSelectedList( new PayRollVM.Payroll());
            }
    
            public void Add(PayRollVM.Payroll payroll)
            {
                var dto = new DtoPayroll
                {
                    AuthorId = int.Parse(payroll.AuthorTypeId),
                    Salary = payroll.Salary
                };
    
                svc.Add(dto);
            }
    
            public PayRollVM.Payroll Update(int id)
            {
                var dto = Find(id);
    
                var payroll = new PayRollVM.Payroll
                {
                    PayRollId = dto.PayRollId,
                    AuthorId = dto.AuthorId,
                    AuthorTypeId = dto.AuthorId.ToString(),
                    AuthorFirstName = dto.AuthorFirstName,
                    AuthorLastName = dto.AuthorLastName,
                    Salary = dto.Salary
                };
    
                return payroll;
            }
    
            public void Update(PayRollVM.Payroll payroll)
            {
                var dto = new DtoPayroll
                {
                    PayRollId = payroll.PayRollId,
                    AuthorId = payroll.AuthorId,
                    Salary = payroll.Salary
                };
    
                svc.Update(dto);
            }
    
            public void Delete(int id)
            {
                var dto = new DtoId
                {
                    Id = id
                };
    
                svc.Delete(dto);
            }
    
            public PayRollVM.Payroll PopulateSelectedList(PayRollVM.Payroll payroll)
            {
                var dtos = svcauth.GetAuthorTypes().ToList();
    
                SelectListItem item = new SelectListItem();
                item.Value = "";
                item.Text = "Select..";
                payroll.AuthorTypes.Add(item);
    
                payroll.AuthorTypes.AddRange(dtos.Select(dto => new SelectListItem()
                {
                    Value = dto.Value,
                    Text = dto.Text
                }).ToList());
    
                var selected = (from a in payroll.AuthorTypes.Where(a => a.Value == payroll.AuthorTypeId) select a)
                    .SingleOrDefault();
    
                if (selected != null)
                    selected.Selected = true;
    
                return payroll;
    
            }
        }
    }
    

    Sunday, March 1, 2020 4:23 AM
  • User-854763662 posted

    Hi xcorporation ,

    xcorporation

    i am trying to find easy solutions to build asp .net MVC pages / views using real-time designers to generate client code + stylesheets etc.

    In ASP.NET Core, the official document has a detailed tutorial on how to create a Web App (MVC, Razor pages). For the automatic generation of related pages and controllers , you could use the scaffolding tool to produce Create, Read, Update, and Delete (CRUD) pages for the  model.

    You need take aside time to learn the follow links :

    https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/?view=aspnetcore-3.0

    https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/?view=aspnetcore-3.0

    https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-3.0&tabs=visual-studio#scaffold-movie-pages

    Best Regards,

    Sherry

    Monday, March 2, 2020 8:16 AM
  • User-474980206 posted

    all realtime html designers just generate html and javascript. you would then edit the html code to add the server feature you need. there are also template sites. asp.net is too small a market to have any that generate razor markup, or understand layout pages. 

    one of the goal of asp.net core was to use plain html as much as possible so designers (typically adobe tools) could be used.

    if you plan on being a front end developer, you are stuck learning markup, CSS. You should pick a framework like bootstrap or material design to start. 

    note: once you pick a framework, look for templates and designer for that framework.

    Monday, March 2, 2020 5:06 PM