Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..am beginner to mvc & ajax
trying to display a popup(partial view) when a user hover an actionlink.. is this possible to call ajax ??..

View page:

@Html.ActionLink(@item.bName, "Businessdetails", "NewSearch", new { id = item.UserID }, null )
PHP
$("#hover").mouseover(function () {
                $.ajax({
                    url: "@Url.Action("Businessdetails","NewSearch")",
                    success: function (Display) {
                        $("#details").html(result);
                    }
            });
        });


Controller:

public ActionResult Businessdetails(int id)
{

var cal = (from s
in db.tblUsers
where s.UserTypeId == 5 && s.UserID == id
select new Search
{
FirstName = s.FirstName,
bName = s.tblBusinessCategory.BusinessName,
bCategory = s.tblBusinessCategory.BusinessCategory,
bDescription = s.tblBusinessCategory.BusinessDescription,
EmailID = s.EmailID,
MobileNumber = s.MobileNumber,
WorkNumber = s.WorkNumber,
Address1 = s.tblAddress.Address1,
Address2 = s.tblAddress.Address2,
City = s.tblAddress.City,
State = s.tblAddress.State,
ZipCode = s.tblAddress.ZipCode

}).FirstOrDefault();
return View();


Partial view:

@model IEnumerable<sytmain.models.xxxx>
@foreach (var item in Model)
{



@item.bName


@item.City
@item.Address1@item.Address2
@item.MobileNumber

@item.StartTime@item.EndTime


@item.bID



}
Posted

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