I need to format my Date Column in a certain format, but also needs to be sorted as a Date. Its sorts it like text because of the .ToString. Any advise how to sort it as Date but still keep the format?

View:

<script>
    $(function () {
        $('#dataTableHistory').DataTable({
            "iDisplayLength": 50,
            "order": [[0, "desc"]]
        });
    });
</script>

<table id="dataTableHistory" class="display">


    <thead>
        <tr>
            <th>Date</th>
            <th>User</th>
            <th>Action</th>
        </tr>
    </thead>

    <tbody>
        @foreach (var o in (List<CompoundSheetHistory>)ViewData["CompoundSheetHistories"])
        {
            <tr>
                <td>@o.DateCreated.ToString("dd MMM yyyy HH:mm:ss")</td>
                <td>@o.User.FirstName</td>
                <td>@o.ActionDescription</td>
            </tr>
        }
    </tbody>
</table>

On the first load, and when I click on the sort button, it sort the column, what seems to be like text.

results of sorting

Have a project with Entity Framework Core and asp.net mvc core. This project was working correctly. But when removed migration folder from Data layer and then update DB, suddenly showed me an error like this :

Cannot override the 'href' attribute for . An with a specified 'href' must not have attributes starting with 'asp-route-' or an 'asp-action', 'asp-controller', 'asp-area', 'asp-route', 'asp-protocol', 'asp-host', 'asp-fragment', 'asp-page' or 'asp-page-handler' attribute.

Actually I want to open a view with <a asp-action="..." ...> from home controller to another controller in a area. please help me.

enter image description here

I have the following form in GSP

 <g:form name="myForm" url="[controller:'result']">

The form input goes to the result controller which checks if the input is valid or not, and if it's not valid, it adds an error attribute to the GSP, and if it is valid it redirects to the result page. I am having issues with the error attribute which is added after the form is submitted. So when I load the page for the first time, I get the error groovy.lang.MissingPropertyException: No such property: error for class. So my question is that is there a way that I can check if a property is added yet? I tried <g:if test="${error}">, but it didn't work. Any help is appreciated!

I am a social yearbooker in Korea, mobile and web development.

This time I want to develop a hybrid web using ionic version 1.

ionic version1 also knows that support has ended.

However, I have to develop with version1, so there are various problems during the process.

An additional feature is the board(CRUD), photo taking and upload music playback.

  1. When I create a hybrid app with ionic version1, will it work on most Android or iPhone?

  2. What is the best way to design an audio player?

  3. What do you think about trying to use Spring as backend?

Thank you for reading.

I am trying to implement a required field validator on my form so that when I click my 'send' button it only works if all of the required fields have a value. Right now though even if I set up a RequiredFieldValidator and click send the function still fires and is not stopped. This is my code as of now:

Default.aspx

   <form action="./Default.aspx" method="post" runat="server">
        <div id="tabs" style="border:none" class="">
            <br />
            <br />
            <button class="backBtn" type="button" name="goBackBtn" onclick="backBtnClicked()"><img src="https://png.icons8.com/back-arrow/win8/1600"></button>
            <h1 class="title">Create NetEvent</h1>

            <br />

            <fieldset>
                <legend>Sender Info</legend>
                <div class="row">
                  <label class="senderInfoUniversal senderInfoLabel">Username:</label>
                  <input class="senderInfoUniversal senderInfoInput" type="text" runat="server" id="eventFormName" readonly="readonly"/>
                </div>
                <div class="row">
                  <label class="senderInfoUniversal senderInfoLabel">Email:</label>
                  <input class="senderInfoUniversal senderInfoInput" type="text" runat="server" id="eventFormEmail" readonly="readonly"/>                  
                </div>  
                <div class="row">
                    <label class="senderInfoUniversal senderInfoInputExtra">*Sender email used when sending out NetEvent</label>
                </div>
            </fieldset>

            <br />

            <fieldset>
                <legend>Type of Event</legend>
                <div class="row">
                    <div data-toggle="buttons" class="btn-group col-md-12">
                        <label runat="server" id="serviceDisruptionLabel" class="btn btn-default" for="serviceDisruptionBtn" onclick="displayServiceDisruptionForm()">Service Disruption
                            <input class="labelInput" id="serviceDisruptionBtn" type="radio" required="required"/>
                        </label>
                        <label runat="server" id="plannedOutageLabel" class="btn btn-default" for="plannedOutageBtn" onclick="displayPlannedOutageForm()">Planned Outage
                            <input class="labelInput" id="plannedOutageBtn" type="radio"/>
                        </label>
                    </div>
                </div>
            </fieldset>

            <br /> 

            <fieldset>
                <legend>NetEvent Information</legend>

                <div id="serviceDisruptionForm" hidden="hidden">
                    <div class="col-md-6">

                        <div class="form-group">
                            <label class="userInfo"> Subject Line
                                <span class="required">*</span>
                            </label>
                            <asp:TextBox type="text" runat="server" id="eventFormSubjectLineSD" class="userInfo form-control customFormElement" 
                                title="Invalid Subject Name"></asp:TextBox>
                            <asp:RequiredFieldValidator 
                                runat="server" 
                                ControlToValidate="eventFormSubjectLineSD" 
                                ErrorMessage="THIS DID NOT WORK">
                            </asp:RequiredFieldValidator>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Summary
                                <span class="required">*</span>
                            </label>
                            <textarea type="text" runat="server" id="eventFormSummarySD" class="userInfo form-control" 
                                title="Invalid Subject Name"/>   
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Resources Affected
                                <span class="required">*</span>
                            </label>
                            <select type="text" runat="server" id="eventFormResourcesAffectedSD" class="userInfo form-control" 
                                title="Invalid Subject Name" clientIdMode="static">
                                <option style="display:none;"></option>
                            </select>
                            <textarea runat="server" id="eventFormResourcesAffectedOtherSD" clientIdMode="static"></textarea>
                            <textarea runat="server" id="resourcesOtherRowSD" hidden="hidden" clientIdMode="static"></textarea>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> People Affected
                                <span class="required">*</span>
                            </label>
                            <textarea type="text" runat="server" id="eventFormPeopleAffectedSD" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Work Around
                                <span class="required">*</span>
                            </label>
                            <textarea type="text" runat="server" id="eventFormWorkAroundSD" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Start Time
                                <span class="required">*</span>
                            </label>
                            <input type="text" runat="server" id="eventFormStartTimeSD" class="userInfo form-control" 
                                title="Invalid Subject Name" clientIdMode="static"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Estimated Time of Resolution
                                <span class="required">*</span>
                            </label>
                            <div class="col">
                                <label id="unknownTextSD" for="eventFormTimeCheckBoxSD">Unknown</label>
                                <input type="checkbox" runat="server" id="eventFormTimeCheckBoxSD" clientIdMode="static"/>  
                            </div>                                                  
                            <input type="text" runat="server" id="eventFormEstimatedTimeOfResolutionSD" class="userInfo form-control" 
                                title="Invalid Subject Name" clientIdMode="static"/>                       
                        </div>

                        <div class="form-group">
                            <label id="draftLabelSD" class="userInfo">Save as Draft</label>
                            <input type="checkbox" runat="server" id="eventFormDraftCheckBoxSD" clientIdMode="static"/>
                            <textarea runat="server" id="eventFormDraftEmailInputSD" clientIdMode="static" hidden="hidden" 
                                placeholder="Type in the emails you would like the draft to be set to, seperated by a comma"/>        
                        </div>

                    </div>
                </div>  

                <div id="plannedOutageForm" hidden="hidden">
                    <div class="col-lg-6">

                        <div class="form-group">
                            <label class="userInfo"> Subject Line
                                <span class="required">*</span>
                            </label>
                            <input type="text" runat="server" id="eventFormSubjectLinePO" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Summary
                                <span class="required">*</span>
                            </label>
                            <textarea type="text" runat="server" id="eventFormSummaryPO" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Resources Being Changed
                                <span class="required">*</span>
                            </label>
                            <select type="text" runat="server" id="eventFormResourcesBeingChangedPO" class="userInfo form-control" 
                                title="Invalid Subject Name" clientIdMode="static">
                                <option style="display:none;"></option>
                            </select>
                            <textarea runat="server" id="eventFormResourcesBeingChangedOtherPO" clientIdMode="static"></textarea>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Change Benefits
                                <span class="required">*</span>
                            </label>
                            <textarea type="text" runat="server" id="eventFormChangeBenefitsPO" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Impact on End Users
                                <span class="required">*</span>
                            </label>
                            <textarea type="text" runat="server" id="eventFormImpactOnEndUsersPO" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Proposed Start Date/Time
                                <span class="required">*</span>
                            </label>
                            <input type="text" runat="server" id="eventFormProposedStartDatePO" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label class="userInfo"> Proposed End Date/Time
                                <span class="required">*</span>
                            </label>
                            <input type="text" runat="server" id="eventFormProposedEndDatePO" class="userInfo form-control" 
                                title="Invalid Subject Name"/>
                        </div>

                        <div class="form-group">
                            <label id="draftLabelPO" class="userInfo">Save as Draft</label>
                            <input type="checkbox" runat="server" id="eventFormDraftCheckBoxPO" clientIdMode="static"/>
                            <textarea runat="server" id="eventFormDraftEmailInputPO" clientIdMode="static" hidden="hidden" 
                                placeholder="Type in the emails you would like the draft to be set to, seperated by a comma"/>        
                        </div>
                    </div>
                </div>
            </fieldset>    
            
            <br />                

            <asp:Button ID="eventFormSubmitBtn" runat="server" Text="Send" OnClientClick="setValidators()" OnClick="eventFormSubmitBtn_Clicked"/>

            <asp:HiddenField ID="typeHolder" runat="server" />
        </div>
    </form>

Also all of this is nested within a form running on the server.

Default.aspx.cs

 // Buttin Submit Methods
    protected void eventFormSubmitBtn_Clicked(object sender, EventArgs e)
    {
        saveData();
        goBackToStartPage();
    }

So right now even if the form has empty fields, clicking the button still sends me to another page. Does it have something to do with my Type of event field set, where I am toggling between a service disruption or planned outage? I want to make it so when the Service disruption is selected the send button pressed does not work unless required fields have a value and same for when planned outage is selected.

enter image description here

Actually, I have my project in ASP.Net Web Form, and I want to change all UI, use bootstrap, change color, font, but I cannot change any internal logic.

Really, I am working on CSS and HTML Files.

My question is, do you know the best way to do this? any advice?

I have gotten stuck on this code I am trying to accomplish that allows the user to search for spotify artists in an asp.net web page.

It is supposed to be simple but I think I may be overthinking it and now I am getting an error on the web page after I click my search button.

This is my aspx.cs code thus far.

using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Task_3
{
    public partial class Default : System.Web.UI.Page
    {
        public void button1Clicked(object sender, EventArgs args)
        {
            button1.Text = "Search";
            string[] hello = {"Hello, World"};
            MainClass.Main(hello);
            MainClass.SetInput(search1.Text);
            TableRow tRow = new TableRow();
            TableRow tRow2 = new TableRow();
            TableCell album1 = new TableCell();
            TableCell artist1 = new TableCell();
            TableCell date1 = new TableCell();
            TableCell tracks1 = new TableCell();
            TableCell popularity1 = new TableCell();
            TableCell id1 = new TableCell();
            TableCell album2 = new TableCell();
            TableCell artist2 = new TableCell();
            TableCell date2 = new TableCell();
            TableCell tracks2 = new TableCell();
            TableCell popularity2 = new TableCell();
            TableCell id2 = new TableCell();
            album1.Text = "Album Name";
            artist1.Text = "Artist Name";
            date1.Text = "Date of Release";
            tracks1.Text = "Number of Tracks";
            popularity1.Text = "Popularity";
            id1.Text = "ID";
            tRow.Cells.Add(album1);
            tRow.Cells.Add(artist1);
            tRow.Cells.Add(date1);
            tRow.Cells.Add(tracks1);
            tRow.Cells.Add(popularity1);
            tRow.Cells.Add(id1);
            Table1.Rows.Add(tRow);
            tRow2.Cells.Add(album2);
            tRow2.Cells.Add(artist2);
            tRow2.Cells.Add(date2);
            tRow2.Cells.Add(tracks2);
            tRow2.Cells.Add(popularity2);
            tRow2.Cells.Add(id2);
            Table1.Rows.Add(tRow2);
            album1.BorderStyle = BorderStyle.Solid;
            artist1.BorderStyle = BorderStyle.Solid;
            date1.BorderStyle = BorderStyle.Solid;
            tracks1.BorderStyle = BorderStyle.Solid;
            popularity1.BorderStyle = BorderStyle.Solid;
            id1.BorderStyle = BorderStyle.Solid;
            Table1.BorderStyle = BorderStyle.Solid;
            Table1.Visible = true;
            id2.Text = MainClass.getData(2);
        }
    }

    class MainClass
    {
        static string input;
        static string [] data = new string[25];
        public static void fillData(){
            for (int j = 0; j < 25; j++)
            {
                data[j] = "" + j.ToString();
            }
        }
        public static string getData(int j){
           // fillData();
            return data[j];
           // return input;
        }
        public static void SetInput(string str){
            input = str;
        }
        public string GetInput(){
            return input;
        }
        public static void Main(string[] args)
        {
            fillData();
            string search = input;//"Muse";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.spotify.com/v1/search?q=" + search + "&type=artist");

            request.Method = "GET";
            request.ContentType = "application/json";
            request.Accept = "application/json";
            request.Headers.Add("Authorization", "Bearer " + "BQD9zxTbUh3sZhf42Z6ewRp85-VFdel5CwSa4qa-Y0FvjvgQ98jEBHC8-ws1_kCie0sEijsvcgk1EPCje5bqgeCG5vmXWpsf3Myd5gPFpjICLhF-BUEmT83VeAbUfnKD37kHBP_8ZyP-xvI");

            HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // causing the error on website
            string myResponse = "";
            using (System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream()))
            {
                myResponse = sr.ReadToEnd();
                sr.Close();
                response.Close();
            }
            string[] idStrings = new string[50];
            int index1;
            for (int i = 0, startIndex = 0; i < 50; i++)
            {
                idStrings[i] = "";
                index1 = myResponse.IndexOf("id\" : \"", startIndex);
                if (index1 == -1) break;
                else idStrings[i] = myResponse.Substring(index1 + 7, 22);
                startIndex = index1 + 30;
            }
            string id = "4aawyAB9vmqN3uQ7FjRGTy";
            HttpWebRequest idRequest = (HttpWebRequest)WebRequest.Create("https://api.spotify.com/v1/albums/" + id);

            idRequest.Method = "GET";
            idRequest.ContentType = "application/json";
            idRequest.Accept = "application/json";
            idRequest.Headers.Add("Authorization", "Bearer " + "BQD9zxTbUh3sZhf42Z6ewRp85-VFdel5CwSa4qa-Y0FvjvgQ98jEBHC8-ws1_kCie0sEijsvcgk1EPCje5bqgeCG5vmXWpsf3Myd5gPFpjICLhF-BUEmT83VeAbUfnKD37kHBP_8ZyP-xvI");

            HttpWebResponse idResponse = (HttpWebResponse)idRequest.GetResponse();
            string myIdResponse = "";
            using (System.IO.StreamReader sr = new System.IO.StreamReader(idResponse.GetResponseStream()))
            {
                myIdResponse = sr.ReadToEnd();
            }

            Console.WriteLine(myResponse.ToString());

            for (int i = 0; i < 50; i++)
            {
                Console.WriteLine(idStrings[i]);
            }


        }

This is my aspx web page code.

<%@ Page Language="C#" Inherits="Task_3.Default" %>
<!DOCTYPE html>
<html>
<head runat="server">
    <title>Default</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:TextBox id="search1" runat="server" />
            <asp:Button id="button1" runat="server" Text="Search" OnClick = "button1Clicked"/>
            <asp:Table id="Table1" runat="server" Visible = "true" BackColor = "Coral" BorderStyle = "Solid" Width = "300" Height = "300" ForeColor = "Black" Enabled = "true" />
        </form>
    </body>
    </html>

What am I doing wrong here? I commented where the HTTP 500.Error processing request is, however I do not know how to fix it. The code works through terminal but not through the web page...???

I may be writing to much into this and there may be an easier way however I have not worked in an asp.net environment before so I am new.

Any help would be appreciated!

Also if someone can tell me how to go about the next step of taking the input and getting the id from the artist results of search, this would help as well!

This is the error:

    System.Net.WebException
The remote server returned an error: (400) Bad Request.
Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System

I have a scenario in which I have 4 multiple projects of webRTC(Videocall project, Chat project, Screen Sharing project, Editing Tool Project), All of Above projects are working as standalone entity.But My need is to integrate them all in single One Page Application.

All Projects use different versions of same Nuget Package and different .net framework as well, For an instance one project includes

  <package id="Microsoft.AspNet.SignalR" version="1.0.0-rc2" targetFramework="net40" />

and second project use

 <package id="Microsoft.AspNet.SignalR" version="1.0.0" targetFramework="net45" />

therefore i can't merge them in one project and if i change the versions i lost the functionality

My soultion with Problem

I added all my projects under single solution file, so i don't have any package version issue or framework conflict because every projects have its own framework and package version

My Need I want to create partial views of all web projects and render them all on my main project I also want to keep one hub file for all above projects as every project has its own hub file

but I am unable to do this Need your suggestions and help

Thanks

Let's say I have a class that looks like this:

    private class CompanyPerson
    {
        public Person Person { get; set; }
        public string UserTokenGuid { get; set; }
    }

And then Person looks like this:

    private class Person
    {
        public Info Info { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        ....
    }

And Info...

    private class Info 
    {
        ...
    }

Now, if I create an instance of CompanyPerson:

CompanyPerson companyPerson = new CompanyPerson();

That's all good. But then if I immediadlty try this:

companyPerson.Person.FirstName = "Bob";

It throws an error because companyPerson.Person does not exist. I get that, and I understand why. But, this is a deep class with sub-classes that go 8 or 9 deep. Is there some way to instantiate all of the sub classes along with the parent class?

I am currently prototyping OAuth2 authorization server options, and want to use IdentityServer4.

But it would require alot of work to put an ASP.NET Core App on top of the current .NET Framework stack (v4.5) that I am working on. This stack also relies heavily on the IoC container "Spring", so thats another issue.

I have tried looking at ASOS, but I run in to similar problems.

Isn't there a proper OAuth2 authorization server framework made for good old ASP.NET that is still being maintained?

Maybe some of you have some input to how you solved a similar situation?

We have an application that we want to configure deployment values under appSettings tags withing the application user interface. It seems in order to do that we need to grant application pool identity write permissions to the application root folder. We do not want to do that. Is there a way to edit a web.config file without granting the application pool identity additional permissions ?

I have two classes, One is called Development, the other BuildingTypes...Development collects a list of BuildingTypes:

public class BuildingTypes
    {
        public string BuildingType { get; set; }
    }

    public class Development
    {
        public List<BuildingTypes> BuildingTypes { get; set; }

    }

what I am trying to is a list of BuildingType (no s) to get this result:

    <BuildingTypes>
    <BuildingType> Condo/Apartment </BuildingType>
    <BuildingType> Townhouse </BuildingType>
    </BuildingTypes>

But when I try this:

    List<BuildingTypes> buildingTypes = new List<BuildingTypes>();

                    if (houseCounter != 0)
                    {

                        BuildingTypes buildingType = new BuildingTypes();

                        buildingType.BuildingType = "House";

                        buildingTypes.Add(buildingType);

                    }

                    if (townsCounter != 0)
                    {

                        BuildingTypes buildingType = new BuildingTypes();

                        buildingType.BuildingType = "Townhouse";

                        buildingTypes.Add(buildingType);

                    }

                    development.BuildingTypes = buildingTypes;

I get this result:

<BuildingTypes>
<BuildingTypes>
<BuildingType>House</BuildingType>
</BuildingTypes>
<BuildingTypes>
<BuildingType>Townhouse</BuildingType>
</BuildingTypes>
</BuildingTypes>

Why do I get extra BuildingTypes Nodes? Sooooo weird.

Is it possible to run a .NET app which I've installed on the client's machine from my web app? And can I pass data to it?

Basically I'm trying to send HTML/PDF directly to the default printer without invoking the browser's print dialogue.

i have this code m trying to validate it but unable to so what i want it to look like this 12-12345-1-1 when the user types in the text box it should be able to get the dashes automatically is this possible through C# or j-query

<asp:TextBox ID="txtNum" runat="server" placeholder="number" class="form-control" OnTextChanged="txtNum_TextChanged1" ></asp:TextBox>
<asp:RegularExpressionValidator ID="regxNum" ValidationExpression="\d{3}\d{3}\d{4}" runat="server" ErrorMessage="Invalid Num#" ControlToValidate="txtNum" ForeColor="Red"></asp:RegularExpressionValidator>

C#

if ((txtNum.Text.ToString().Length == 2) || (txtNum.Text.ToString().Length == 5) || (txtNum.Text.ToString().Length == 1))
      txtNum.Text = txtNum.Text.ToString() + "-";

Is there a way to call all the pages included in the website? (cshtml pages with controller, not razor pages)

Why?

I have a website, with a translation system, which consists of defining on every page a set of key/text with default values in English, which are then translated if the language is not the default. All pages have a base page on which is stored the bag of translation keys, it is therefore easy to access once the page has run. I have set up a way to gather all the keys on a page by adding a fictive lang (in that case the keys are inserted in DB if they do not exist). In that way I can add most of the keys in my DB.

However there are always pages complicated to reach, such as error pages, login, or any small part of pages that requires a bit of logic first.

Therefore I am looking for a way to run all pages on the website (potentially with an empty model).

If that is not possible, I could go for a listing of all routes on the website, that would probably not help to reach 100% of pages, but most of them.

It may also help to run tests on the website. If necessary it might be done at compilation time.

I have an MVC view that has a dropdownlist "array" on it. Essentially there is a drop down that I have declared as follows:

                        <div class="col-md-10">
                        @Html.DropDownListFor(modelItem => Model.VetteeContactList[i].OwnershipPercentage, Enumerable.Range(25,76).Select(o => new SelectListItem{ Text = o.ToString(), Value = o.ToString()}), new { @onchange = "CheckPercentages(this.value)" })
                    </div>

This drop down is in a much larger div that will show up on the view from 1 to 4 times. Briefly, the drop down contains the values 25-100.

I am trying to figure how to make the CheckPercentage function get the values from all drop downs and sum them to make sure they do not go over 100. I know right now, the function is retrieving the specific value when I change it. I am struggling with how to get the entire array of them to sum them.

Which Authorize Attribute ?
System.Web.Http.Authorize
System.Web.Mvc.Authorize

using System.Web.Mvc      // or
using System.Web.Http  

A typical controller

    [Authorize]
    public class SomeController : Controller

We have controllers Annotated with [Authorize] I just noticed that due to using namespaces the annotations technically refer to different attribute classes.

The project contains MVC controllers and WEBAPI controllers.

Which one should I use and why ? What issues might we have if I dont fix this ?

I'm trying to configure Angular 2 and Asp.Net MVC 5 using Visual Studio and everything was okay til I decide to add new node modules.

What is the correct configuration when using MVC 5 and Angular 2 com build the node modules during dev enviroment? Should I change the build process to Webpack?

Thank you!

@RequestMapping(value="/addpost",method=RequestMethod.POST)
    public ModelAndView addpost(HttpServletRequest request,HttpServletResponse response,@ModelAttribute("r") Reg reg)
    {
        int id=r.id;
        System.out.println(id);
        return mv;
    }

In this code,there is given @ModelAttribute("r") Reg reg.Wether this modelattribute is taking values from jsp page?Can anyone explains the working of this ModelAttribute?

I am trying to set a value by default in a drop down list which generated through a Model sent from controller and using select listitem.

Please check and let me know. Thanks in advance

would you mind to help me and say what I am doing wrong? I cannot spot the error and consequently after clicking the submit button, the HttpPost ActionResult method is not being hit?

Controller

public ActionResult Index()
    {
        return View();
    }

    [HttpPost]
    public ActionResult Index(testModel model)
    {
        if (ModelState.IsValid == true)
        {
            using (testRepository repository = new testRepository())
            {

            }
        }

        return View();
    }   

And the View

@using (Html.BeginForm("Index","Test",FormMethod.Post,new {autocomplete="off" })){    <fieldset>     
    @Html.LabelFor(m => m.testValue)
    @Html.TextBoxFor(m => m.testValue)
    <input type="submit" value="Submit" />
</fieldset>}