Hi all,
I have an ASP.Net MVC application using Web API Controller, I want to call get method for Button Click using TypeScript, here is my Web Api Controller and its action method.
And here is my HTML, I want to bind the results to the divSearchResult listbox, any sort of help would be very helpful, I am little bit new to the front end world, thanks in advance.
@{
ViewBag.Title = "Home Page";
}
<script src="~/Scripts/Search/search.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Home Page</title>
</head>
<body style="position: absolute; height: 98%;min-height:98%;width:85%;min-width:85%;">
<div style="position: absolute; height: 90%;min-height:90%;width:95%;min-width:95%;">
<div style="position: absolute; height: 90%;min-height:90%;width:95%;min-width:95%;">
</body>
</html>
I have an ASP.Net MVC application using Web API Controller, I want to call get method for Button Click using TypeScript, here is my Web Api Controller and its action method.
publicclass HomeController : ApiController { [System.Web.Http.ActionName("GetByString")]public IEnumerable<File834Dto> Get(string subscriberNumber) {var someObj = SearchResults.SearchBySubscriberNumber(subscriberNumber);return (someObj != null) ? someObj.FileResults : null;//NorthwindEntities db = new NorthwindEntities();//var data = from item in db.Customers// select item;//return data.ToList(); } }
And here is my HTML, I want to bind the results to the divSearchResult listbox, any sort of help would be very helpful, I am little bit new to the front end world, thanks in advance.
@{
ViewBag.Title = "Home Page";
}
<script src="~/Scripts/Search/search.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Home Page</title>
</head>
<body style="position: absolute; height: 98%;min-height:98%;width:85%;min-width:85%;">
<div style="position: absolute; height: 90%;min-height:90%;width:95%;min-width:95%;">
<div style="position: absolute; height: 90%;min-height:90%;width:95%;min-width:95%;">
<div id="divSearchResult" style="height: 90%;min-height:90%;width:95%;min-width:95%;"><select name="cars" multiple="multiple" style="position: absolute; top:5%;"><option value="volvo">Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo</option><option value="saab">Saab</option><option value="fiat">Fiat</option><option value="audi">Audi</option></select><label style="position: absolute; left:400px; top :5%;">Test</label><select name="cars" multiple="multiple" style="position: absolute; left:400px; top :10%;"><option value="volvo">Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo</option><option value="saab">Saab</option><option value="fiat">Fiat</option><option value="audi">Audi</option></select></div><div id="divSearch"><p><input type="text" name="txtSubscriberIdOrName"></p><p><button style="width: 150px; border-radius: 5px; background: url('../../Content/Images/search-icon-psd-png.jpg'); background-size: 25%, 25%, 25%;background-repeat: no-repeat;" id="search_report"> Search</button></p></div><div id="message"></div><div> Compiler: <input id="compiler" value="TypeScript" onkeyup="document.getElementById('message').innerText = sayHello()" /><br /> Framework: <input id="framework" value="ASP.NET" onkeyup="document.getElementById('message').innerText = sayHello()" /></div></div></div>
</body>
</html>
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."