Click here to Skip to main content
15,888,521 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Few questions regarding MCSD and MCPD exam for dotnet Pin
Richard MacCutchan5-Jan-17 1:00
mveRichard MacCutchan5-Jan-17 1:00 
QuestionPassing Model info in MVC Pin
eejaynic2-Jan-17 8:27
eejaynic2-Jan-17 8:27 
AnswerRe: Passing Model info in MVC Pin
eejaynic2-Jan-17 13:42
eejaynic2-Jan-17 13:42 
QuestionCreate and Use an ASP.NET Core Website Template Pin
xiecsuk1-Jan-17 23:03
xiecsuk1-Jan-17 23:03 
AnswerRe: Create and Use an ASP.NET Core Website Template Pin
Afzaal Ahmad Zeeshan2-Jan-17 21:53
professionalAfzaal Ahmad Zeeshan2-Jan-17 21:53 
GeneralRe: Create and Use an ASP.NET Core Website Template Pin
xiecsuk2-Jan-17 22:29
xiecsuk2-Jan-17 22:29 
Questiontargeting .js files into different directories using typescript and tsconfig file - need really some help Pin
indian14331-Dec-16 5:51
indian14331-Dec-16 5:51 
QuestionCalling get method using typescript - need really some help Pin
indian14331-Dec-16 5:40
indian14331-Dec-16 5:40 
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.
public class 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%;">
        &lt;div id="divSearchResult" style="height: 90%;min-height:90%;width:95%;min-width:95%;"&gt;
            &lt;select name="cars" multiple="multiple" style="position: absolute; top:5%;"&gt;
                &lt;option value="volvo"&gt;Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo&lt;/option&gt;
                &lt;option value="saab"&gt;Saab&lt;/option&gt;
                &lt;option value="fiat"&gt;Fiat&lt;/option&gt;
                &lt;option value="audi"&gt;Audi&lt;/option&gt;
            &lt;/select&gt;

            &lt;label style="position: absolute; left:400px; top :5%;"&gt;Test&lt;/label&gt;
            &lt;select name="cars" multiple="multiple" style="position: absolute; left:400px; top :10%;"&gt;
                &lt;option value="volvo"&gt;Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo&lt;/option&gt;
                &lt;option value="saab"&gt;Saab&lt;/option&gt;
                &lt;option value="fiat"&gt;Fiat&lt;/option&gt;
                &lt;option value="audi"&gt;Audi&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
        &lt;div id="divSearch"&gt;
            &lt;p&gt;
                &lt;input type="text" name="txtSubscriberIdOrName"&gt;
            &lt;/p&gt;
            &lt;p&gt;
                &lt;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"&gt;
                    Search
                &lt;/button&gt;
            &lt;/p&gt;
        &lt;/div&gt;

        &lt;div id="message"&gt;&lt;/div&gt;
        &lt;div&gt;
            Compiler: &lt;input id="compiler" value="TypeScript" onkeyup="document.getElementById('message').innerText = sayHello()" /&gt;&lt;br /&gt;
            Framework: &lt;input id="framework" value="ASP.NET" onkeyup="document.getElementById('message').innerText = sayHello()" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

</body>
</html>
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."


modified 3-Jan-17 16:35pm.

QuestionHow Can I Expand the Field Name Column in an MVC Details view? Pin
Member 1282452923-Dec-16 14:41
Member 1282452923-Dec-16 14:41 
AnswerRe: How Can I Expand the Field Name Column in an MVC Details view? Pin
Afzaal Ahmad Zeeshan24-Dec-16 1:31
professionalAfzaal Ahmad Zeeshan24-Dec-16 1:31 
GeneralRe: How Can I Expand the Field Name Column in an MVC Details view? Pin
Member 1282452924-Dec-16 6:04
Member 1282452924-Dec-16 6:04 
GeneralRe: How Can I Expand the Field Name Column in an MVC Details view? Pin
Afzaal Ahmad Zeeshan24-Dec-16 7:29
professionalAfzaal Ahmad Zeeshan24-Dec-16 7:29 
AnswerRe: How Can I Expand the Field Name Column in an MVC Details view? Pin
Richard Deeming10-Jan-17 4:06
mveRichard Deeming10-Jan-17 4:06 
QuestionASP Button not displaying on Windows 2012 Server Pin
pmcm22-Dec-16 3:00
pmcm22-Dec-16 3:00 
AnswerRe: ASP Button not displaying on Windows 2012 Server Pin
Afzaal Ahmad Zeeshan22-Dec-16 3:57
professionalAfzaal Ahmad Zeeshan22-Dec-16 3:57 
GeneralRe: ASP Button not displaying on Windows 2012 Server Pin
pmcm22-Dec-16 4:02
pmcm22-Dec-16 4:02 
AnswerRe: ASP Button not displaying on Windows 2012 Server Pin
ZurdoDev22-Dec-16 5:15
professionalZurdoDev22-Dec-16 5:15 
GeneralRe: ASP Button not displaying on Windows 2012 Server Pin
pmcm22-Dec-16 23:47
pmcm22-Dec-16 23:47 
GeneralRe: ASP Button not displaying on Windows 2012 Server Pin
ZurdoDev23-Dec-16 2:12
professionalZurdoDev23-Dec-16 2:12 
QuestionConverting from XAML to HTML5 Pin
indian14320-Dec-16 11:24
indian14320-Dec-16 11:24 
AnswerRe: Converting from XAML to HTML5 Pin
koolprasad200320-Dec-16 22:39
professionalkoolprasad200320-Dec-16 22:39 
QuestionError: Server did not recognize the value of HTTP Header SOAPAction Pin
Scott5220-Dec-16 9:24
Scott5220-Dec-16 9:24 
AnswerRe: Error: Server did not recognize the value of HTTP Header SOAPAction Pin
jkirkerx20-Dec-16 10:35
professionaljkirkerx20-Dec-16 10:35 
GeneralRe: Error: Server did not recognize the value of HTTP Header SOAPAction Pin
Scott5221-Dec-16 1:50
Scott5221-Dec-16 1:50 
GeneralRe: Error: Server did not recognize the value of HTTP Header SOAPAction Pin
jkirkerx21-Dec-16 9:18
professionaljkirkerx21-Dec-16 9:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.