C
C#15mo ago
4

❔ im using models with tuple in razor view but it doesn't send data to action

code
5 Replies
4
4OP15mo ago
hi, I want to use multiple model in one razor view but data don't come to action from view
@{
Layout = null;
}

@model Tuple< LoginViewModel,RegisterViewModel,ResetPasswordViewModel>


<div id="log_in_container" class="log_in">
<div class="content">
<div class="modes">
<i class="fa-solid fa-moon"></i>
<i class="fa-solid fa-sun"></i>
</div>
<img class="site_logo"
onclick="location.href='../index.html'"
src="../assets/FITB_Game_logo.png"
alt="FITB Game logo" />
<form method="post" asp-action="Login" class="form" asp-route-returnUrl="@Context.Request.Query["ReturnUrl"]">

<div class="input_box">
<input asp-for="Item1.UserName" type="text" required />
<i>İstifadəçi Adı</i>
</div>

<div class="input_box">
<input asp-for="Item1.Password" type="password" required />
<i>Şifrə</i>
</div>
<div class="sign_in_links">
<a id="forgot_password" asp-controller="Account" asp-action="ForgotPassword">Şifrənizi unutmusunuz?</a>
<div>
<a id="sign_up" asp-controller="Account" asp-action="Register">Qeydiyyatdan keçin</a>
<i class="fa-solid fa-caret-right"></i>
</div>
</div>



<div class="input_box">
<button type="submit" value="Daxil ol">
Daxil ol
</button>
</div>

</form>
</div>
</div>
@{
Layout = null;
}

@model Tuple< LoginViewModel,RegisterViewModel,ResetPasswordViewModel>


<div id="log_in_container" class="log_in">
<div class="content">
<div class="modes">
<i class="fa-solid fa-moon"></i>
<i class="fa-solid fa-sun"></i>
</div>
<img class="site_logo"
onclick="location.href='../index.html'"
src="../assets/FITB_Game_logo.png"
alt="FITB Game logo" />
<form method="post" asp-action="Login" class="form" asp-route-returnUrl="@Context.Request.Query["ReturnUrl"]">

<div class="input_box">
<input asp-for="Item1.UserName" type="text" required />
<i>İstifadəçi Adı</i>
</div>

<div class="input_box">
<input asp-for="Item1.Password" type="password" required />
<i>Şifrə</i>
</div>
<div class="sign_in_links">
<a id="forgot_password" asp-controller="Account" asp-action="ForgotPassword">Şifrənizi unutmusunuz?</a>
<div>
<a id="sign_up" asp-controller="Account" asp-action="Register">Qeydiyyatdan keçin</a>
<i class="fa-solid fa-caret-right"></i>
</div>
</div>



<div class="input_box">
<button type="submit" value="Daxil ol">
Daxil ol
</button>
</div>

</form>
</div>
</div>
im using tuple for models
Angius
Angius15mo ago
How do you return it from the view?
4
4OP15mo ago
what do you mean ? with action ?
Angius
Angius15mo ago
How do you construct that tuple
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server