Click here to Skip to main content
15,887,267 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Click Event in Menu Control not firing Pin
Kandepu Rajesh16-Feb-14 10:24
Kandepu Rajesh16-Feb-14 10:24 
GeneralRe: Click Event in Menu Control not firing Pin
Prasad Vj16-Feb-14 21:07
professionalPrasad Vj16-Feb-14 21:07 
GeneralRe: Click Event in Menu Control not firing Pin
Rob Achmann19-Feb-14 3:32
Rob Achmann19-Feb-14 3:32 
JokeRe: Click Event in Menu Control not firing Pin
ZurdoDev18-Feb-14 15:25
professionalZurdoDev18-Feb-14 15:25 
GeneralRe: Click Event in Menu Control not firing Pin
Rob Achmann19-Feb-14 3:30
Rob Achmann19-Feb-14 3:30 
GeneralRe: Click Event in Menu Control not firing Pin
ZurdoDev19-Feb-14 3:51
professionalZurdoDev19-Feb-14 3:51 
AnswerRe: Click Event in Menu Control not firing Pin
Prasad Vj16-Feb-14 21:09
professionalPrasad Vj16-Feb-14 21:09 
Questionmvc 4 Ajax.BeginForm with Web API? Pin
Rob Achmann15-Feb-14 15:06
Rob Achmann15-Feb-14 15:06 
vs 2013 express for web

I have an MVC 4 web app and a WebAPI service returning JSON formatted data.

I tried to use Ajax.BeginForm to call the WebAPI service.

It does call it correctly
C#
@model IEnumerable<MyApp.Models.SomeClass>

@using (Ajax.BeginForm(
            new AjaxOptions
            {
                HttpMethod = "get",
                Url="api/MyWebAPI",
                InsertionMode = InsertionMode.Replace,
                UpdateTargetId = "Resultlist"
            }))
{

    <div class="row">
        <div class="col-lg-12">
            <h3>Service Call Details - Method A</h3>
            <input type="submit" class="btn btn-default" value=" Get Via Asynch Method A " />
        </div>
    </div>
}
<div id="ResultList">
    <table class="table">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Caption)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Active)
            </th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Caption)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.ClassifierGroupId }) |
                    @Html.ActionLink("Details", "Details", new { id = item.ClassifierGroupId }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.ClassifierGroupId })
                </td>
            </tr>
        }

    </table>

</div>


But the results don't fill the form.

Now, when the data came from the Home controller's Index function, that returned data as a View with model as an ActionRequest...:

C#
public ActionResult Index()
  {
      ViewBag.Title = "Home Page";

      IEnumerable<SomeClass> model = db.SomeClasses.ToList();


      return View(model);
  }


So how do I convert the WepAPI returned JSON data to something that the razor form can use for the Model data?

Any help appreciated.

GS Sniff | :^)
GaltSalt
maker of .Net thingys

AnswerRe: mvc 4 Ajax.BeginForm with Web API? Pin
Rob Achmann16-Feb-14 10:48
Rob Achmann16-Feb-14 10:48 
AnswerRe: mvc 4 Ajax.BeginForm with Web API? Pin
Rob Achmann19-Feb-14 3:33
Rob Achmann19-Feb-14 3:33 
QuestionBuild API in ASP.NET Web Form Pin
Hy Chanhan15-Feb-14 5:14
professionalHy Chanhan15-Feb-14 5:14 
AnswerRe: Build API in ASP.NET Web Form Pin
Rob Achmann16-Feb-14 1:51
Rob Achmann16-Feb-14 1:51 
AnswerRe: Build API in ASP.NET Web Form Pin
ZurdoDev18-Feb-14 15:26
professionalZurdoDev18-Feb-14 15:26 
Questionsource code Pin
punith Kumar Raj15-Feb-14 0:28
punith Kumar Raj15-Feb-14 0:28 
AnswerRe: source code Pin
Tom Marvolo Riddle15-Feb-14 0:43
professionalTom Marvolo Riddle15-Feb-14 0:43 
AnswerRe: source code Pin
Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)15-Feb-14 1:43
protectorTadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)15-Feb-14 1:43 
QuestionI am getting RSAProtection Error, please help me Pin
indian14314-Feb-14 7:16
indian14314-Feb-14 7:16 
QuestionSelect multiple row of gridview using Shift+select functionality without using checkboxes. Pin
maheshakamudli14-Feb-14 3:12
maheshakamudli14-Feb-14 3:12 
AnswerRe: Select multiple row of gridview using Shift+select functionality without using checkboxes. Pin
Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)14-Feb-14 19:13
protectorTadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)14-Feb-14 19:13 
QuestionAbout gate way Pin
punith Kumar Raj14-Feb-14 2:39
punith Kumar Raj14-Feb-14 2:39 
AnswerRe: About gate way Pin
Richard Andrew x6414-Feb-14 19:15
professionalRichard Andrew x6414-Feb-14 19:15 
AnswerRe: About gate way Pin
Tom Marvolo Riddle14-Feb-14 19:23
professionalTom Marvolo Riddle14-Feb-14 19:23 
QuestionHow to insert a .swf file in a ASP.Net page Pin
Kandepu Rajesh13-Feb-14 19:04
Kandepu Rajesh13-Feb-14 19:04 
AnswerRe: How to insert a .swf file in a ASP.Net page Pin
thatraja13-Feb-14 20:28
professionalthatraja13-Feb-14 20:28 
GeneralRe: How to insert a .swf file in a ASP.Net page Pin
Kandepu Rajesh13-Feb-14 20:50
Kandepu Rajesh13-Feb-14 20:50 

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.