IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET MVC Discussion :

Bouton radio perdent leur valeur sur pagination et tri par colonne


Sujet :

ASP.NET MVC

  1. #1
    Membre éprouvé Avatar de kheironn
    Homme Profil pro
    Chef de projets technique C# / MVC / .Net
    Inscrit en
    Février 2007
    Messages
    822
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets technique C# / MVC / .Net
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2007
    Messages : 822
    Points : 1 108
    Points
    1 108
    Par défaut Bouton radio perdent leur valeur sur pagination et tri par colonne
    Bonjour,
    Comme indiqué dans le titre, dès que je pagine ou que je trie par colonne, la valeur de mes bouton radio saute. withPhot revient sur indiff et isActive n'est plus coché du tout.
    Les valeurs sont bien passées au contrôleur et renvoyées dans le ViewBag

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
     
    @using (Html.BeginForm("Index", "Product", new
    {
        page = ViewBag.CurrentPage,
        sortOrder = ViewBag.CurrentOrder,
        customerId = ((SelectList)ViewBag.CustomerId).SelectedValue,
        providerId = ((SelectList)ViewBag.ProviderId).SelectedValue,
        withPhoto = ViewBag.WithPhoto,
        operationId = ((SelectList)ViewBag.OperationId).SelectedValue,
        productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue,
        customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue,
        productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue,
        product = ViewBag.Product,
        familyID = ((SelectList)ViewBag.FamilyID).SelectedValue,
        isActiv = ViewBag.IsActiv,
        buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue
    }, FormMethod.Get))
    {
     
        <div class="form-horizontal">
            <div class="form-group">
                <div class="col-md-11">
                    <h2>Liste des Articles</h2>
                </div>
                <div class="col-md-1">
                    <br />
                    <br />
                    @Html.ActionLink(" ", "Create", "Product", null, new { @class = "glyphicon glyphicon-plus btn btn-primary", @title = "Ajouter un article" })
                </div>
            </div>
            <hr />
        </div>
        <div class="form-horizontal">
            <div class="form-group">
                <div class="col-md-10 col-md-offset-1">
                    <h3>Filtrer les articles sur :</h3>
                </div>
                <div class="col-md-1">
                    <button type="submit" class="btn btn-primary" title="Rechercher">
                        <span class="glyphicon glyphicon-search"></span>
                    </button>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="row">
                        <div class="form-group">
                            <div class="col-md-2">
                                @Html.LabelFor(model => model.FirstOrDefault().Product.ProductLine.CustomerStock.Customer.Name, new { @class = "control-label" })
                            </div>
                            <div class="col-md-4">
                                @Html.DropDownList("CustomerID", (SelectList)ViewBag.CustomerId, "<Tous>", new { @id = "SelectCustomer", @class = "btn btn-default dropdown-toggle" })
                            </div>
                            <div class="col-md-2">
                                @Html.LabelFor(model => model.FirstOrDefault().Product.ProductType.Label, new { @class = "control-label" })
                            </div>
                            <div class="col-md-4">
                                @Html.DropDownList("ProductTypeID", (SelectList)ViewBag.ProductTypeID, "<Tous>", new { @id = "selectedType", @class = "btn btn-default dropdown-toggle" })
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <div class="col-md-2">
                                @Html.LabelFor(model => model.FirstOrDefault().Product.Family.Label, new { @class = "control-label" })
                            </div>
                            <div class="col-md-4">
                                @Html.DropDownList("FamilyID", (SelectList)ViewBag.FamilyID, "<Toutes>", new { @id = "selectedType", @class = "btn btn-default dropdown-toggle" })
                            </div>
                            <div class="col-md-2">
                                @Html.LabelFor(model => model.FirstOrDefault().Product.Label, new { @class = "control-label" })
                            </div>
                            <div class="col-md-4">
                                @Html.Editor("product", new { htmlAttributes = new { @class = "form-control" } })
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <div class="col-md-2">
                                @Html.LabelFor(model => model.FirstOrDefault().Product.PhotoPath, new { @class = "control-label" })
                            </div>
                            <div class="col-md-4">
                                <label class="radio-inline">@Html.RadioButton("withPhoto", "true") Oui</label>
                                <label class="radio-inline">@Html.RadioButton("withPhoto", "false") Non</label>
                                <label class="radio-inline">@Html.RadioButton("withPhoto", "null", true) Indif</label>
                            </div>
                            <div class="col-md-2">
                                @Html.Label("Produits actifs", new { @class = "control-label" })
                            </div>
                            <div class="col-md-4">
                                <label class="radio-inline">@Html.RadioButton("isActiv", "true", true) Oui</label>
                                <label class="radio-inline">@Html.RadioButton("isActiv", "false") Non</label>
                                <label class="radio-inline">@Html.RadioButton("isActiv", "null") Indif</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    @Html.Partial("PartialDependantDropDowns", new Logsys.Geolie.Anima.Mvc.Models.ProductProductLine())
                </div>
            </div>
        </div>
    }
     
    @if (Model != null && Model.Count > 0)
    {
        <div class="table-responsive">
            <table class="table table-striped table-hover table-condensed table-responsive">
                <tr>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.ProductID).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortById, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.CustomerProductID).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByCustProdId, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.Label).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByLabel, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.CreationDate).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByCreaDate, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().ProductLine.CustomerStock.Name).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByCusStk, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().ProductLine.Label).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByProdLin, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.Provider.Name).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByProv, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.OperationID).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByOpId, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.Operation.Label).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByOp, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.ReceptionPackaging.Label).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByExpP, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.ReceptionPackagingQuantity).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByExpQ, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        TODO
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.UnitWeight).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByUnitWei, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.ProductType.Label).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByTyp, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%">
                        @Html.DisplayNameFor(model => model.FirstOrDefault().Product.BuyingPrice)
                    </th>
                    <th width="5%">
                        @Html.DisplayNameFor(model => model.FirstOrDefault().Product.SellingPrince)
                    </th>
                    <th width="5%">
                        @Html.ActionLink(HttpUtility.HtmlDecode(Html.DisplayNameFor(model => model.FirstOrDefault().Product.IsActiv).ToHtmlString()), "Index", new { sortOrder = ViewBag.SortByActiv, page = ViewBag.CurrentPage, customerId = ((SelectList)ViewBag.CustomerId).SelectedValue, providerId = ((SelectList)ViewBag.ProviderId).SelectedValue, operationId = ((SelectList)ViewBag.OperationId).SelectedValue, productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue, customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue, productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue, product = ViewBag.Product, familyID = ((SelectList)ViewBag.FamilyID).SelectedValue, isActiv = ViewBag.IsActiv, buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue })
                    </th>
                    <th width="5%"></th>
                </tr>
                @foreach (var item in Model)
                {
                    <tr>
                        <td width="5%">
                            @Html.ActionLink(item.ProductID, "Details", new { id = item.Product.ProductID }, new { @title = "Détail" })
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.CustomerProductID)
                        </td>
                        <td width="15%">
                            @Html.DisplayFor(modelItem => item.Product.Label)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.CreationDate)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.ProductLine.CustomerStock.Name)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.ProductLine.Label)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.Provider.Name)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.OperationID)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.Operation.Label)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.ReceptionPackaging.Label)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.ReceptionPackagingQuantity)
                        </td>
                        <td width="5%">
                            subquery -> unités en stocks
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.UnitWeight)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.ProductType.Label)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.BuyingPrice)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.SellingPrince)
                        </td>
                        <td width="5%">
                            @Html.DisplayFor(modelItem => item.Product.IsActiv)
                        </td>
     
                        <td width="5%">
                            @Html.ActionLink(" ", "Edit", new { id = item.Product.ProductID }, new { @class = "glyphicon glyphicon-pencil", @title = "Modifier" })
                            &nbsp;&nbsp;
                            @Html.ActionLink(" ", "Delete", new { id = item.Product.ProductID }, new { @class = "glyphicon glyphicon-trash", @title = "Supprimer" })
                        </td>
                    </tr>
                }
            </table>
     
            Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
            @Html.PagedListPager(Model, page => Url.Action("Index", new
       {
           page,
           sortOrder = ViewBag.CurrentOrder,
           customerId = ((SelectList)ViewBag.CustomerId).SelectedValue,
           providerId = ((SelectList)ViewBag.ProviderId).SelectedValue,
           operationId = ((SelectList)ViewBag.OperationId).SelectedValue,
           productTypeId = ((SelectList)ViewBag.ProductTypeId).SelectedValue,
           customerStockID = ((SelectList)ViewBag.CustomerStockID).SelectedValue,
           productLineID = ((SelectList)ViewBag.ProductLineID).SelectedValue,
           product = ViewBag.Product,
           familyID = ((SelectList)ViewBag.FamilyID).SelectedValue,
           isActiv = ViewBag.IsActiv,
           buyerId = ((SelectList)ViewBag.BuyerId).SelectedValue
       }))
        </div>
    }

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
            public ActionResult Index(int? page, string sortOrder, string customerId, int? providerId, bool? withPhoto, string operationId, int? productTypeId, int? productLineId, int? customerStockId, string product, int? familyId, bool? isActiv, string buyerId)
            {
                ViewBag.WithPhoto = withPhoto;
                ViewBag.IsActiv = isActiv;
                [...]
    un œil extérieur serait le bienvenu.

    merci.
    En informatique, le problème se situe toujours entre le clavier et l'écran !
    Il y a deux chemins entre le clavier et l'écran : Par l'UC et par l'utilisateur.

  2. #2
    Membre éprouvé Avatar de kheironn
    Homme Profil pro
    Chef de projets technique C# / MVC / .Net
    Inscrit en
    Février 2007
    Messages
    822
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets technique C# / MVC / .Net
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2007
    Messages : 822
    Points : 1 108
    Points
    1 108
    Par défaut
    Personne n'a une idée ?
    En informatique, le problème se situe toujours entre le clavier et l'écran !
    Il y a deux chemins entre le clavier et l'écran : Par l'UC et par l'utilisateur.

  3. #3
    Membre éprouvé Avatar de kheironn
    Homme Profil pro
    Chef de projets technique C# / MVC / .Net
    Inscrit en
    Février 2007
    Messages
    822
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets technique C# / MVC / .Net
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2007
    Messages : 822
    Points : 1 108
    Points
    1 108
    Par défaut
    J'ai fait un truc bourrin en utilisant le ViewBag...
    En informatique, le problème se situe toujours entre le clavier et l'écran !
    Il y a deux chemins entre le clavier et l'écran : Par l'UC et par l'utilisateur.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. boutons qui perdent leur contenu
    Par adelsunwind dans le forum IHM
    Réponses: 2
    Dernier message: 09/04/2009, 10h46
  2. Variables qui perdent leur valeur lorsqu'utilisées dans fonction
    Par damlarumeur dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 19/02/2009, 09h05
  3. mes textbox serveur perdent leur valeur.
    Par dachir dans le forum ASP.NET
    Réponses: 12
    Dernier message: 12/06/2008, 11h43
  4. Variables globales qui perdent leur valeurs
    Par Rank dans le forum Access
    Réponses: 4
    Dernier message: 08/01/2007, 16h25
  5. Bouton radio : récupérer la valeur du bouton avec selectedIn
    Par djodjo dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 26/08/2005, 12h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo