DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Any examples how to use with AJAX? #388

Open kelcarpenter opened 9 years ago

kelcarpenter commented 9 years ago

Hi Dmitry,

I am quite excited to use your library. However, I make frequent use of AJAX and partials, but have no clue how to use your library with AJAX and your documentation, how shall I say it?, leaves much to be desired. It would be great to see a working example of how to implement something like the following:

@using (Ajax.BeginForm(new AjaxOptions { Url = Url.Action("GetUsersList"),  UpdateTargetId = "targetDiv" })) {  
 ... the form fields go here ... as well as a submit button ...
} 

<div id="targetDiv">
... results returned from child action via AJAX would go here ...
</div>

How does this get coded with your TwitterBootstrapMVC extensions?

Thanks

Kelly Carpenter

DmitryEfimenko commented 9 years ago

it's very similar to the regular Bootstrap form:

@using (var f = Ajax.Bootstrap().Begin(new Form(), new AjaxOptions{}))
{

}
kelcarpenter commented 9 years ago

Thank you for your very quick response. Much appreciated.

This worked like a charm.

All the best!


From: Dmitry A. Efimenko notifications@github.com Sent: Wednesday, July 22, 2015 2:25 PM To: DmitryEfimenko/TwitterBootstrapMvc Cc: Kelly Carpenter Subject: Re: [TwitterBootstrapMvc] Any examples how to use with AJAX? (#388)

it's very similar to the regular Bootstrap form:

@using (var f = Ajax.Bootstrap().Begin(new Form(), new AjaxOptions{})) {

}

Reply to this email directly or view it on GitHubhttps://github.com/DmitryEfimenko/TwitterBootstrapMvc/issues/388#issuecomment-123870819.