Jun 28, 2014, 4:25 PM
How to get the value from View page to the controller using button click (direct event) below is my code attached
View Page
==================
Controller
=======================================
Model
=======================================
Thanks in advance,
Suresh G
==================
@Html.X().ResourceManager()
<div>
Name : @Html.TextBoxFor(model => model.Name, new { @class = "x-form-field", style = "width:300px;" })<br />
Address : @Html.TextBoxFor(model => model.Address, new { @class = "x-form-field", style = "width:300px;" })<br />
City : @Html.TextBoxFor(model => model.City, new { @class = "x-form-field", style = "width:300px;" })<br />
Country : @Html.TextBoxFor(model => model.Country, new { @class = "x-form-field", style = "width:300px;" })<br />
</div>
<div>
@( Html.X().Button() .Text("Submit")
.DirectEvents(de => {
de.Click.Url = Url.Action("DirectEventSubmit");
de.Click.EventMask.ShowMask = true;
})
)
</div>
=======================================Controller
=======================================
public ActionResult DirectEventSubmit()
{
return this.Direct();
}
=======================================Model
=======================================
public class Enquiry
{
DbFactory ObjDbfactory;
protected void InitializeDB()
{
ObjDbfactory = new DbFactory(DataBaseType.SQLServer, ConfigurationManager.ConnectionStrings["DatabaseConnection"].ConnectionString);
}
public string Mode { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Country { get; set; }
}
i had tried calling the model in the view page, it displays only the null value, please give me solution, how to get the value passed from the view page to the controller.Thanks in advance,
Suresh G
Last edited by Daniil; Jun 30, 2014 at 12:51 PM.
Reason: Please use [CODE] tags