asp.net-mvc


Asp.net mvc4 bootstrap tab change


I can't succeed to hook an #Url.Action on the onshown event of a tab in one of my view (I want to change a property of my ViewModel on every new tab selection). Is there any trouble with this?
<div id="my-tab-content" class="tab-content" >
#foreach (var item in Model.LesCategories)
{
<div id="tabs-#item.Id" class=" tab-pane #item.ClasseActive" onshown="location.href ='#Url.Action("ChangeAction","Plat")'">
<table>
#foreach (var plat in Model.LesPlats)
{
if (plat.Category.Id == item.Id)
{
<tr>
<td>
#Html.DisplayFor(platItem => plat.Nom)
</td>
<td>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Action <span class="caret">
</span></a>
<ul class="dropdown-menu">
<li>Modifier</li>
<li>D├ętails</li>
<li>Supprimer</li>
<li>Descendre</li>
<li>Monter</li>
</ul>
</div>
</td>
</tr>
}
}
</table>
<div class="espace_bas">
</div>
</div>
You cannot bind onshown event like that. You have to capture tab container with jQuery and bind it with on option like shown in the docs:
$('.tab').on('shown', function (e) {
location.href ='#Url.Action("ChangeAction","Plat")';
})

Related Links

Bootstrap Glyphicon Popover
how to return to filled out form from other view in mvc
Edit page with a foreign key constraint fails in Asp.net MVC
MVC pass int from view to controller with a button click
PCL Attribute not seen in MVC ModelMetaDataProvider
How to a publish visual studio solution with two dependencies projects to azure?
EF Core + MVC 6 + .NET Core RC2 - EF not returning results
Can we display linq result in view without using model
EF - work with universal entity in library project, when not specified database entities
asp.net core not detecting classlibrary Model on View during runtime
Using Ajax.BeginForm helper in MVC 5 for uploading picture issue [duplicate]
Decorating class with Authorize assumes Office 365 login, instead of offering choice
how can pass the parametrized ActionResult value through ActionLink()
How to get HtmlHelper.Action() working inside a webforms aspx page
Session variables in MVC 5
Azure web apps life cycle

Categories

HOME
flutter
clojure
hortonworks-data-platform
serial-port
tcl
word-vba
swashbuckle
twitter-digits
weblogic11g
pyusb
tin-can-api
socrata
akka.net
coded-ui-tests
player-swift
binary-search
nservicebus
editor
vscode-settings
html5-video
avr
cloudrail
spring-boot-admin
flow
javers
cmusphinx
libpcap
hp-alm
ghost-blog
windows-applications
iteration
android-button
phonegap-desktop-app
x-sendfile
editorconfig
launchpad
clappr
localdb
reed-solomon
apex-code
deep-copy
nav
delete-row
xaf
ubuntu-server
msal
texture-mapping
es6-promise
subscription
html-form
uservoice
dump
reactivex
android-camera-intent
replicate
turbo-c
shift-reduce-conflict
hard-drive-failure
agents-jade
texture2d
hyperterm
ng-annotate
webdeploy-3.5
target-platform
hl7-v2
parsoid
openocd
spl
mtp
error-log
data-science-studio
sslv3
iife
android-design-library
servlet-listeners
computer-science-theory
jasmin
citymaps
jet.com-apis
dynamic-typing
pkcs#10
jquery-backstretch
youtrack-api
xml.modify
mod-python
glulookat
broadcom
loadlibrary
slimbox
tipsy
ccr
program-files
springboard
nntp
directoryentry
custom-protocol
webshop

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App