locked
problem in use 2 table (with value textbox ,value list box) RRS feed

  • Question

  • User1928394251 posted

    hello

    i have view in my project .

    i want send value view (textbox and listbox)  to database and another view .

    note : value textboxes are afishtable , value istboxs are modirtable (2 table).

    how i can both of them put in view or database ?

    """"""""""""""""""i want send value textbox and checkbox to another( page or view ) and save in database or table. """"""""""""""""""

    my view this is :

    @model WebApplication1.Models.afishstudio
    @{
    ViewBag.Title = "تایید مدیریت";
    }

    <html>
    <head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/bootstrap-rtl.min.css" rel="stylesheet" />

    </head>
    <body>
    <div class="panel panel-primary">
    <div style="direction:rtl !important;margin:40px auto;width:70%">
    <h2> ورود به صفحه تایید آفیش </h2>
    </div>
    </div>
    <div>
    <div class="panel panel-body">

    <div style="direction:rtl !important;margin:40px auto;width:70%">

    @using (Html.BeginForm())
    {
    @Html.AntiForgeryToken()

    <div class="form-horizontal">

    @Html.TextBoxFor(model => model.id, new { htmlAttributes = new { @class = "form-control" } })

    <div class="form-group">

    <div class="col-md-10" dir="rtl">

    @Html.TextBoxFor(model => model.name, new { htmlAttributes = new { @class = "form-control" } })

    </div>

    </div>

    <div class="form-group">

    <div class="col-md-10" dir="rtl">

    @Html.TextBoxFor(model => model.family, new { htmlAttributes = new { @class = "form-control" } })

    </div>

    </div>

    <div class="form-group">

    <div class="col-md-10" dir="rtl">

    @Html.TextBoxFor(model => model.date, new { htmlAttributes = new { @class = "form-control" } })

    </div>

    </div>

    <div class="form-group">

    <div class="col-md-10" dir="rtl">

    @Html.TextBoxFor(model => model.time, new { htmlAttributes = new { @class = "form-control" } })

    </div>

    </div>

    <form method="post" action="">
    <select name="Choice" dir="rtl">
    <option value="1">1</option>
    <option value="2">2 </option>
    <option value="3">3</option>
    <option value="1">4</option>
    <option value="2">5</option>
    <option value="3">6</option>
    </select>
    <input type="submit" value="تاييد">
    </form>

    <div>
    @Html.ActionLink("تایید وارسال ", "ersal");
    </div>

    </div>
    }

    <div>
    @Html.ActionLink("Back to List", "show")
    </div>
    </div>
    </div>
    </div>
    </body>
    </html>

    """"""""""""""""""" i cant write controller and action for save values in database and post to another view.

    thanks

    Tuesday, December 18, 2018 7:09 AM

All replies

  • User646131187 posted

    Can you give some code to show what you're trying to do?  It would make it easier to address your issue.

    I THINK you are saying you want to use your textbox and listbox to provide variables for an SqlDataSource, is that right?

    Tuesday, December 18, 2018 8:52 AM