Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am doing my 1st project in MVC2.0 and stuck in MODEL while sending dataset from model to view. Please some one guide me. This is my view



VIEW CODE.
<div style="width:98%; text-align:center; padding-top:5%">

<label for="UserName">id:</label> <%= Html.TextBox("MUunit") %> <input type="submit" value="Scan" />

<%--<%= Html.Encode(ViewData["message"]) %>--%>
</div>

<% } %>
When button is clicked the value entered in textbox eg:"12345" comes to controller

CONTROLLER CODE:

Un ut = new Un();
public ActionResult Index()
{
return View();
}

[HttpPost]

public ActionResult Index(string textbox)
{
textbox = Request.Form["MUunit"];
return View(Details(textbox));
}
the value passed to MODEL. The model connected to database and return DATASET.

public class Un {
public DataSet Details(string txbox)
{

DataSet objDataset = new DataSet();

objDataset = Details(txbox);

return objDataset;
}
}
It return dataset. how to pass dataset to view??
Posted

1 solution

refer this link..

http://www.codeproject.com/Articles/486161/Creating-a-simple-application-using-MVC-4-0



hope this help you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900