In my javascript file, I got an ajax to get all list and iterate these data and append <a id='userID' class='btn'>Assign ID<> to my list.

So, how do a add postback to these anchor and redirect it inside my method in the server. Below is my code but didn't work. When I click the achor button, it just redirect/refresh to the same page without doing any changes and didn't show the text.

<a id='uniqueID' class='btn assignID' href='javascript:void(0);' onclick='javascript:__doPostBack('uniqueID','')'>Assign ID</a>

protected void Action_assignID(object sender, EventArgs e)
{
  // assign ID action
  Response.Write("Pass");
}

I have read that SqlMembershipProvider doesn't work with SQL Azure, but I am currently using it. I initially encountered some issues, but I am able to login to the site and access role information.

So what is the deal? Do only certain parts of SqlMembershipProvider not work with SQL Azure?

I am using asp.net mvc 5 site for few different domains. Like testsite.com and mysite.com. And because it have different domain in Startup.Auth.cs I need setup different accounts. How can I do that for each domain?

    public void ConfigureAuth(IAppBuilder app)
    {
        ......
        // google account for testsite.com
        app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
        {               
            ClientId = "xxxxxxxxxxxxxxxxxxxxxx",
            ClientSecret = "xxxxxxxxxxxx"
        });

        // google account for mysite.com?

    }

Or how I can change those settings in runtime based on site url?

Thanks!

Duke

When I try to build my solution for my MVC project I get the error:

Cannot convert from 'test.Models.User' to 'test.Models.ApplicationUser'

This is is my class User:

    public class User
{
    public int UserId { get; set; }
    [DataType(DataType.Text)]
    public string Name { get; set; }
    [DataType(DataType.PhoneNumber)]
    public string PhoneNumber { get; set; }
    [DataType(DataType.EmailAddress)]
    public string Email { get; set; }
 }

And this is my class UsersController:

  public class UsersController : Controller
{
    private ApplicationDbContext db = new ApplicationDbContext();

    // GET: Users
    public ActionResult Index()
    {
        return View(db.Users.ToList()); //Here
    }

    // GET: Users/Details/5
    public ActionResult Details(int? id)
    {
        if (id == null)
        {
            return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        }
        User user = db.Users.Find(id); //Here
        if (user == null)
        {
            return HttpNotFound();
        }
        return View(user);
    }

    // GET: Users/Create
    public ActionResult Create()
    {
        return View();
    }

    // POST: Users/Create
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create([Bind(Include = "UserId,Name,PhoneNumber,Email")] User user)
    {
        if (ModelState.IsValid)
        {
            db.Users.Add(user); //Here
            db.SaveChanges();
            return RedirectToAction("Index");
        }

        return View(user);
    }

    // GET: Users/Edit/5
    public ActionResult Edit(int? id)
    {
        if (id == null)
        {
            return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        }
        User user = db.Users.Find(id); //Here
        if (user == null)
        {
            return HttpNotFound();
        }
        return View(user);
    }

    // POST: Users/Edit/5
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Edit([Bind(Include = "UserId,Name,PhoneNumber,Email")] User user)
    {
        if (ModelState.IsValid)
        {
            db.Entry(user).State = EntityState.Modified;
            db.SaveChanges();
            return RedirectToAction("Index");
        }
        return View(user);
    }

    // GET: Users/Delete/5
    public ActionResult Delete(int? id)
    {
        if (id == null)
        {
            return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        }
        User user = db.Users.Find(id); //Here
        if (user == null)
        {
            return HttpNotFound();
        }
        return View(user);
    }

    // POST: Users/Delete/5
    [HttpPost, ActionName("Delete")]
    [ValidateAntiForgeryToken]
    public ActionResult DeleteConfirmed(int id)
    {
        User user = db.Users.Find(id); //Here
        db.Users.Remove(user);
        db.SaveChanges();
        return RedirectToAction("Index");
    }

    protected override void Dispose(bool disposing)
    {
        if (disposing)
        {
            db.Dispose();
        }
        base.Dispose(disposing);
    }
}

The extension: enter image description here

This is the view for index (User):

    @model IEnumerable<BowlingBookingSys.Models.User>

    @{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PhoneNumber)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Email)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PhoneNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.UserId }) |
            @Html.ActionLink("Details", "Details", new { id=item.UserId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.UserId })
        </td>
    </tr>
}

</table>

I want to add a item in a List from JS script

ViewModel Property:

public ICollection<Channel> Channels { get; set; } = new List<Channel>();

Javascript:

 @Model.Channels.Add(new Channel{ Name = "123" });

I'm using MS Identity and when I'm using a reset token to reset the password, I get this exception:

Inner Exception Type: System.Security.Cryptography.CryptographicException Inner Exception: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.

This is what the code looks:

var TheProvider = new DpapiDataProtectionProvider("Sample");
UserManager<IdentityUser> TheUserManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>());
TheUserManager.UserTokenProvider = new DataProtectorTokenProvider<IdentityUser>(TheProvider.Create("EmailConfirmation"));

string TheResetCode = TheUserManager.GeneratePasswordResetToken(TheUserMembershiptID);

IdentityResult TheResult = TheUserManager.ResetPassword(TheUserMembershiptID, TheResetCode, TheNewPassword);

I've looked around but I haven't found a solution. What do I need to change to make it work?

Thanks.

i have a textbox.
when i type something i will call function Enter() by onKeyup event.
when i paste that i will call function Paste() by paste event that i bind.
there is the example:
1. create a textbox

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

2. setting the keyup event, and bind 'paste' event by jquery

$('TextBox1').keyup(function (event) { Enter(event); }).bind('paste', function (event) { Paste(event); };

3. assume the Enter() and Paste() will alert different message

function Enter(e) { alert(e.which); }
function Paste(e) { alert(e.clipboardData.getData('Text')) };

4. when i typing anything, it will alert and show keycode. 5. when i paste something, it will alert twice, one is show keycode, one is show paste info

I hope when i paste, just only triggered Paste event once, doesn't triggered Enter event.
please teach me how to do. thanks.

I get date from my model and it is displayed in view

@Html.DisplayFor(modelItem => item.UpdateDate)

UpdateDate is datetime.(Format 2017-01-12 17:16:32.013)

What I want to do is, compare it with current date and show difference in time.

  • If the difference between current datetime and UpdatedDate is less than 60 min then it should say "'X' Minues ago" (where 'X' is difference in minutes)

  • If the difference between current datetime and UpdatedDate is more than 60 min and less than 24 hours then it should say " 'Y' Hours 'X' Minues ago" (where 'X' is difference in minutes and 'Y' is hours)

  • If the difference between current datetime and UpdatedDate is more than 24 hours then it should say " 'Z' days 'Y' Hours 'X' Minues ago" (where 'X' is difference in minutes and 'Y' is hours and 'Z' is days)

I want to do this in view. Your help is really appreciated.

Thanks

Hey all new to the MVC world so I'm sure I am not doing something correct here. I am trying to call a function from the model page from my view index page to populate some tooltips.

In my model:

public class tips
{
    public List<string> allTips()
    {
        List<string> theTips = new List<string>();

        theTips.Add("example 1");
        theTips.Add("example 2");

        return theTips;
    }

    private List<string> _tips;
    public List<string> getTips { get { return _tips; } set { _tips = allTips(); } }
}

And in my view:

public ActionResult Index()
{
    var blah = new tips().getTips;

    ViewBag.pageTips = blah;

    return getMainData();
}

And then I have this on the razor page:

@Html.Raw(ViewBag.pageTips[1])

Which should display example 2 on the page but instead it just displays null as the value for the toolTips.

Currently it has a value of null when it gets to the return for the pageTips in my view.

So what would I be doing incorrectly? I put some stops here and there and notice that it never calls the allTips() function so that's a good starting place as to what I need to do in order to do that.

I just figured that calling the .getTips would fire off the theTips function?

This question already has an answer here:

we are sending POST with JSON object like:

{
   "ListId": "1",
   "Items": [
    {
        "EmailAddress": "awesomeemail@awesome.com",
        "PhoneNumber": "sample string 2",
        "FirstName": "sample string 3",
        "LastName": "sample string 4",
        "Gender": 0,
        "Industry": "sample string 6",
        "ItemFieldValues": [
            {
                "TextValue": "sample string 1",
                "NumberValue": 2,
                "MoneyValue": 3.0,
                "YesNoValue": true,
                "DateValue": "2017-01-12T11:47:52.0699749+02:00",
                "ItemFieldId": 5
            },
        ]      
    },
    ]
}

When Items are around 30 000 or less, the controller is hit and the JSON is parsed by the model binder successfully. When I try to send 50 000 the IIS returns "404 not found". Not even Application_BeginRequest is fired in the Global.asax. I have tried to add these lines to the web config file.

<jsonSerialization maxJsonLength="50000000"></jsonSerialization>

and

<httpRuntime executionTimeout="2147483647" maxRequestLength="2147483647" />

and

<add key="aspnet:MaxJsonDeserializerMembers" value="2147483647" />

We need to be able to POST millions of Items in one request. I have Test Console application which generates the json and send it to the server via custom WebClient(no timeout problem) all on localhost env. I think the problem is with the Http Buffer, but can't come up with or find solution. Any suggestions?

pcloud direct download links are unique & only works for ip address which generated it.

so this links can't be share & also don't work in remote upload of any files hosting service.

I searched google last whole night it didn't help me.

My friend told me try fiddler or use WebRequest to solve this problem. But none helped me.

I have below mark-up code in my ASPX page.

        <asp:Repeater ID="rep" runat="server">
            <ItemTemplate>
                <asp:GridView ID="grdVw" runat="server" AutoGenerateColumns="true">
                </asp:GridView>
            </ItemTemplate>
        </asp:Repeater>

Below C# code in my ASPX.CS page

    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();

        for (int i = 0; i < 5; i++)
        {
            ds.Tables.Add(getDT());
        }

        rep.DataSource = ds.Tables;
        rep.DataBind();
    }


    private DataTable getDT()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("One");
        dt.Columns.Add("Two");
        dt.Columns.Add("Three");

        var row = dt.NewRow();
        row["One"] = "Value1";
        row["Two"] = "Value2";
        row["Three"] = "Value3";
        dt.Rows.Add(row);

        return dt;
    }

My intention is to have multiple gridviews depends on the number of tables of my dataset. After I run this code, I see nothing on the page. I don't know what wrong am I doing here?

I want to get data from database in code behind c# in asp.net. I am trying to get two columns in one result and put it in one gridview column. How to insert blank line between these two columns? The command text is

"Select question + ': '+ answer from Questions .... ".

Is there any way to get the result like this:

question:

answer (in new line).

Thanks a lot.

I am creating stackedbar chart for may following datatable did search over google for all possible solutions and modified my code but i dont know if my logic is going wrong this is my datatable My DataTable

and this is my Code:

  private void fillStackedChart()
    {
        dt = new DataTable();
      cmd = new MySqlCommand("SELECT STATUS , count( resultstatus ) AS Total_Count, clashresult.floor_srno, floor_master.floor_Name FROM clashresult INNER JOIN floor_master ON clashresult.floor_srno = floor_master.floor_srno WHERE floor_master.project_srno =2 GROUP BY STATUS , clashresult.floor_srno, floor_master.floor_Name ORDER BY floor_master.floor_Name", con);
        da = new MySqlDataAdapter(cmd);
        dt = new DataTable();
        da.Fill(dt);
        StackedChart.DataSource = dt;
            DataTable dt2 = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter("SELECT Distinct status from clashresult inner join floor_master on clashresult.floor_srno=floor_master.floor_srno where floor_master.project_srno=2 group by STATUS,clashresult.floor_srno,floor_master.floor_Name", con);
          adp.Fill(dt2);
        int amountofrows = Convert.ToInt32(dt2.Rows.Count);
        for (int i = 0; i < amountofrows; i++)
        {
            List<string> xvals = new List<string>();
            List<decimal> yvals = new List<decimal>();

            string serieName = dt2.Rows[i]["status"].ToString();
            StackedChart.Series.Add(serieName);

            StackedChart.Series[i].ChartType = SeriesChartType.StackedBar;

            //FORMATTING THE CHART
            StackedChart.Series[i].Label = dt.Rows[i]["Total_Count"].ToString();
            StackedChart.Legends.Add(new Legend(dt2.Rows[i]["status"].ToString()) { Docking = Docking.Right });
            StackedChart.Series[i].BorderWidth = 0;
            StackedChart.Series[i].BorderColor = Color.Black;
            StackedChart.Series[i]["PixelPointWidth"] = "30";
            StackedChart.Series[i].LabelForeColor = Color.White;
            StackedChart.BackColor = Color.LightSkyBlue;

            foreach (DataRow dr in dt.Rows)
            {
                try
                {
                    if (String.Equals(serieName, dr["status"].ToString(), StringComparison.Ordinal))
                    {
                        xvals.Add(dr["floor_Name"].ToString());
                        yvals.Add(Convert.ToDecimal(dr["Total_Count"].ToString()));
                    }
                }
                catch (Exception)
                {
                    throw new InvalidOperationException("Diagrammet kunde inte ritas upp");
                }
            }
            try
            {
                StackedChart.Series[serieName].XValueType = ChartValueType.String;
                StackedChart.Series[serieName].YValueType = ChartValueType.Auto;
                StackedChart.Series[serieName].Points.DataBindXY(xvals.ToArray(), yvals.ToArray());
            }
            catch (Exception)
            {
                throw new InvalidOperationException("Diagram Cannnot Be displayed!");
            }
        }
        StackedChart.DataBind();
        StackedChart.Visible = true;
    }

and I am getting the out put like this enter image description here

but the output i am looking for is like this:enter image description here

This is just single stacked bar but i want the same in above chart. Please help where i am going wrong. Thanks in advance

I export datagridview to excel. now,i want to save this excel file with unique name like date wise in a specific folder. and also i want to save the file without using save dialog file...

so plz help me how to do this...

this code is used for only exporting datagridview to excel.

if (dataGridView1.Rows.Count > 0)
            {
                Microsoft.Office.Interop.Excel._Application XcelApp = new Microsoft.Office.Interop.Excel.Application();
                XcelApp.Application.Workbooks.Add(Type.Missing);

                for (int i = 1; i < dataGridView1.Columns.Count + 1; i++)
                {
                    XcelApp.Cells[1, i] = dataGridView1.Columns[i - 1].HeaderText;
                }

                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    for (int j = 0; j < dataGridView1.Columns.Count; j++)
                    {
                        XcelApp.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value;
                    }
                }
                XcelApp.Columns.AutoFit();
                XcelApp.Visible = true;


            }

 [HttpGet]
        public ActionResult Sync()
        {

            string HApi = "demo";
            string appId = "";
            string company;
            string firstname;
            string lastmodifieddate;
            string lastname;



            string url = string.Format("https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey={0}", HApi);
            using (WebClient client = new WebClient())
            {
                string json = client.DownloadString(url);
                LiveReportSync liveSync = (new JavaScriptSerializer()).Deserialize<LiveReportSync>(json);

// From this doesnt work 
                firstname = liveSync.firstname.ToString();
                lastmodifieddate = liveSync.lastmodifieddate.ToString();
                company = liveSync.company.ToString();
                lastname = liveSync.lastname.ToString();
            }

            return View();
        }

now the output is

{"contacts":[{"addedAt":1390574181854,"vid":204727,"canonical-vid":204727,"merged-vids":[],"portal-id":62515,"is-contact":true,"profile-token":"AO_T-mPqtf_Gb7kIE3oMO0t7laL9CUb8gro7gEaIu7dpzETGI5Qate4csN1pv7LLwKX0T-EBZr-rNZpsdonxI36ppzWJIWxryUrWGrevbHLSfyD4QzNgRGg8AOnFodXPBDlR9kykxIPL","profile-url":"https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mPqtf_Gb7kIE3oMO0t7laL9CUb8gro7gEaIu7dpzETGI5Qate4csN1pv7LLwKX0T-EBZr-rNZpsdonxI36ppzWJIWxryUrWGrevbHLSfyD4QzNgRGg8AOnFodXPBDlR9kykxIPL/","properties":{"firstname":{"value":"Bob"},"lastmodifieddate":{"value":"1483461406481"},"company":{"value":""},"lastname":{"value":"Record"}},"form-submissions":[],"identity-profiles":[{"vid":204727,"saved-at-timestamp":1476768116149,"deleted-changed-timestamp":0,"identities":[{"type":"LEAD_GUID","value":"f9d728f1-dff1-49b0-9caa-247dbdf5b8b7","timestamp":1390574181878},{"type":"EMAIL","value":"mgnew-email@hubspot.com","timestamp":1476768116137}]}],"merge-audits":[]},{"addedAt":1392643921079,"vid":207303,"canonical-vid":207303,"merged-vids":[],"portal-id":62515,"is-contact":true,"profile-token":"AO_T-mNzaLWtoil0-THRN0tSOkWGwHqG4wH1-CAzOaSyuomoFAgd1RAxfWyaNwvoaTY7wpYXEozId-HnIzzaDFHoMr4AMtW4Cj4BG0Ku9KSxxFOkcROdXJ_-lqAAhUvYJidoK_oUnGrS","profile-url":"https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mNzaLWtoil0-THRN0tSOkWGwHqG4wH1-CAzOaSyuomoFAgd1RAxfWyaNwvoaTY7wpYXEozId-HnIzzaDFHoMr4AMtW4Cj4BG0Ku9KSxxFOkcROdXJ_-lqAAhUvYJidoK_oUnGrS/","properties":{"firstname":{"value":"Ff_FirstName_0"},"lastmodifieddate":{"value":"1479148429488"},"lastname":{"value":"Ff_LastName_0"}},"form-submissions":[],"identity-profiles":[{"vid":207303,"saved-at-timestamp":1392643921090,"deleted-changed-timestamp":0,"identities":[{"type":"EMAIL","value":"email_0be34aebe5@abctest.com","timestamp":1392643921079},{"type":"LEAD_GUID","value":"058378c6-9513-43e1-a13a-43a98d47aa22","timestamp":1392643921082}]}],"merge-audits":[]},{"addedAt":1392646026523,"vid":207323,"canonical-vid":207323,"merged-vids":[],"portal-id":62515,"is-contact":true,"profile-token":"AO_T-mPYdmrPnVlj7ZWVYMITedAigswmj8Go9yY50CcP7sMjT19Oatzv64sXDDz4YWMu5kXx8jcrzUz34dTkY3FdEOF50goj0duVIYZxfjeCWwB1BbN2QFjEFe4HUClVXrDaWMYqZ2BO","profile-url":"https://app.hubspot.com/contacts/62515/lists/public/contact/_AO_T-mPYdmrPnVlj7ZWVYMITedAigswmj8Go9yY50CcP7sMjT19Oatzv64sXDDz4YWMu5kXx8jcrzUz34dTkY3FdEOF50goj0duVIYZxfjeCWwB1BbN2QFjEFe4HUClVXrDaWMYqZ2BO/","properties":{"firstname":{"value":"Ff_FirstName_3"},"lastmodifieddate":{"value":"1479148429310"},"company":{"value":""},"lastname":{"value":"Ff_LastName_3"}}....................

i need the values of properties i.e Firstname LastName Company etc also need a for each loop to enter each firstame in a different Sql row

I have this ASP:NET MVC Razor View which has a IEnumerable as model .

I'm creating a table where each line represents a item from the IEnumerable.

I'm using this code:

@foreach (var item in Model)
{
    <tr>
        <td>
            <input type="checkbox" name="selectedFoo" value="@item.isAdded"
               @(Html.Raw(item.isAdded? "checked=\"checked\"" : "")) />
            @item.FooName
        </td>

        <td>
            @Html.EditorFor(modelItem=> item.Name, new { htmlAttributes = new { @class = "form-control", style = "width: 70px" } })
            @Html.ValidationMessageFor(modelItem=> item.Name, "", new { @class = "text-danger" })

        </td>

     </tr>
}

My problem is that when I enter an incorrect value for the "Name" property all the other text input get the validation error.

Solutions?

Thank you.

i'm going to display loading message which is combined static and dynamic message in c# code behind like,

C#

string message; message = strTitle + " is Loading, please wait ";

while generating "export to excel file". should i use multi thread for this.?

Thanks

Login.aspx

protected void btnLogin_Click(object sender, EventArgs e)
    {
        String tbNRIC = txtLogUsername.Text.ToString();
        String tbPassword = txtLogPassword.Text.ToString();

        PatientDAO fmTd = new PatientDAO();
        fmTd.getPatientByNricPassword(tbNRIC, tbPassword);

        if(?? > 0)
        {
            Response.Redirect("Home.aspx");
        }
        else
        {

        }
    }

How to i response.redirect after checking if username and password match?

PatientDAO.cs

public int getPatientByNricPassword(String tbNRIC, String tbPassword)
        {
            string DBConnect = ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;

            SqlDataAdapter da;
            DataSet ds = new DataSet();
            Patient mypatient = new Patient();

            StringBuilder sqlStr = new StringBuilder();

            int result = 0;

            sqlStr.AppendLine("Select * from Login where");
            sqlStr.AppendLine("tbNRIC = @paratbNRIC AND tbPassword = @paratbPassword");

            try
            {
                SqlConnection myConn = new SqlConnection(DBConnect);
                da = new SqlDataAdapter(sqlStr.ToString(), myConn);

                da.SelectCommand.Parameters.AddWithValue("@paratbNRIC", tbNRIC);
                da.SelectCommand.Parameters.AddWithValue("@paratbPassword", tbPassword);
                DataTable dt = new DataTable();
                da.Fill(dt);
            }
            catch (SqlException ex)
            {
                logManager log = new logManager();
                log.addLog("PatientDAO.getPatientByNricPassword", sqlStr.ToString(), ex);
                mypatient = null;
            }
            return result;
        }

How do i pass the result to Login.aspx?

Patient.cs

public class Patient
    {
        public string tbNRIC { get; set; }
        public string tbPassword { get; set; }
    }

How to check from PatientDAO to see if Username and Password Match and Login.aspx Response.Redirect.

I have a view where I conditionally iterate and print items: SPANs are not displayed (as expected).

<div>
@if (Model.SomeCondition)
{
    @foreach (var x in Model.SomeData)
    {
        <span>@x.Title</span>
    }
}
</div>

Now I'd like not to display the enclosing DIV, however it doesn't work: SPANs are still not displayed, but the DIV is. Why does this happen?

@if (Model.SomeCondition)
{
<div>
    @foreach (var x in Model.SomeData)
    {
        <span>@x.Title</span>
    }
</div>
}

i have a problem with a form on visual studio using ASP.NET.

There is my form :

<div class="form-horizontal">
    <form method="post" action="/update">
        <h4>Edit</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model[0].idContrato, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model[0].idContrato, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model[0].idContrato, "", new { @class = "text-danger" })
            </div>
        </div> ... <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </form>
</div>

When i execute and inspect it,the line : <form method="post" action="/update"> is changed into <form action="/home/Edit/010001" method="post" novalidate="novalidate"> where /home/Edit/010001 is the url of my page and 010001 the id of the contract i want to edit in my form.

So when i press the button validate, it refresh the page and nothing happen.

Any idea?