public class BlogPostSurfaceController : Umbraco.Web.Mvc.SurfaceController
{
List<Listing> _listingsP = new List<Listing>();
int _pageSize = 10;
[ChildActionOnly]
public ActionResult ShowCommentForm(int memberId)
{
// var member = Membership.GetUser(memberId);
var model = new Result();
//if (member != null)
//{
// model.Name = member.UserName;
// model.Email = member.Email;
//}
return PartialView("BlogCommentForm", model);
}
[HttpPost]
public ActionResult CreateComment(string address, string keywords, IEnumerable<string> cbservices, IEnumerable<string> cbcertificates, IEnumerable<string> cblanguages, string cbtime, string ratingtarget, string yearsinbusinees, string PageClicked, string SortBy, string RecordPerPage)
{
//model not valid, do not save, but return current Umbraco page
if (!ModelState.IsValid)
{
//Perhaps you might want to add a custom message to the ViewBag
//which will be available on the View when it renders (since we're not
//redirecting)
return CurrentUmbracoPage();
}
Result res=new Result()
{
Listings = GenerateData(_listingsP),
TotalCount = totalCount,
TotalPages = totalPages
};
TempData["ccgs"] = res;
return CurrentUmbracoPage();
}
and my view is
@using MySite.Controllers
@model Result
@using DoTaxServices
@using System.Globalization
@{
ServicesRepository SR = new ServicesRepository();
MembershipController MC = new MembershipController();
int CurrentMemberId = MC.GetCurrentMemberId();
var stateName = "";
if (!string.IsNullOrEmpty(Request["address"]))
{
TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;
stateName = textInfo.ToTitleCase(Request["address"].Replace("-", " "));
}
}
Find an Accountant
@using (Html.BeginUmbracoForm
i could not able to search data through database using postback surfacecontroller....
Search data through database using postback
public class BlogPostSurfaceController : Umbraco.Web.Mvc.SurfaceController {
and my view is
@using MySite.Controllers @model Result
@using DoTaxServices @using System.Globalization @{ ServicesRepository SR = new ServicesRepository();
}
Find an Accountant
please suggest solution?
is working on a reply...