how to pass a parameter between two controllers?

0

It turns out that I have a button in my view, which calls a modal window which parametizo with the controller as follows:

<div class="modal fade" id="myModal" role="dialog" data-url="@Url.Action("partialViewPrueba", "Date", new { serieDesplegar = @item.rme_codigo})">

I would like to be able to do the same action, but in an automatic way, to expand = @ item.rme_codigo, since if I do not reference the serial parameter, Expand = @ item.rme_codigo, since serie desplegar shows me depending on the code of a "printer machine", will give an error that the code is null in the method of the class to which I call the controller and will not be able to return the "status"

all this is tested by web service, the data that the machine sends me is 5, I returned 5 data including this Status, that data I want to return it in my table, but I do not know how to parametrize it, since it returns null, I was trying it on how to call it and it returns null, I know that if I automatically parametizo a series myself, it returns me well, the question is, there is a way to parametizar the serieExploy with item.rme_codigo automatically in the view, that is in the same tabla ?, It should be noted that the data rme_codigo brings it to me from the DATABASE, thank you.

So I call the Status data in sight, without a clear parameter:

    @if (ViewBag.viubag != null)
    { 
            <table class="table">
                <tr>

                    <td>Status</td>

                </tr>
                <tr>
                    <td>
                        @ViewBag.viubag[5]
                    </td>

                </tr>


            </table>
}

en el controlador:


   public ActionResult verStatuss(string serieDesplegar)
        {
            string[] holi = new string[6];
            holi = logica.desplegarTabla(serieDesplegar);
            ViewBag.viubag = holi;
            return View(logica.desplegarTabla(serieDesplegar));
        }

pd: the method to display Tables shows me the 5 data of the machine, among them status, so I return as matrix [5] in the view, which is verStatuss, thanks in advance, hopefully it will be understood

    
asked by KonnAN 03.01.2019 в 20:27
source

0 answers