Avani,
I don't think you can use Webform controls as a rule. You can use either straight HTML controls or form helpers to generate the page controls. After that, you'll need code both in your controller action & in the view page. This code was taken from a working example.
It is also possible to cast ViewData so it is strongly typed. There are several blog postings on the Internet illustrating how to do it if you're interested.
<%@import Namespace="Relations" %>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%= Html.Encode(ViewData["Message"]) %></h2>
<ul id="childs">
<% foreach (Parent parent in ViewData["Parents"] as IEnumerable<Parent>)
{
%>
<li><%= parent.birthDate%>-<%= parent.birthPlace%>
<div>
<table width="90%" cellpadding="0px;" cellspacing="0px;">
<%
foreach (Child child in parent.Children)
{
%>
<tr><td><%= child.firstName%></td><td><%= child.lastName%></td><td><%= child.birthDate%></td></tr>
<%
}
%>
</table>
<a href="/Family/Show/<%= parent.RID%>">View Family</a><br /><br /><br />
</div>
</li>
<%} %>
</ul>
</asp:Content>
namespace Relations.Controllers
{
public class FamilyController : Controller
{
[Authorize]
public ActionResult Show()
{
RelationsDataContext relations = new RelationsDataContext();
IEnumerable<Parent> parentViewData = (from p in relations.Parents
orderby p.birthDate descending
select p);
ViewData["Parents"] = parentViewData;
return View();
}
}