how to increase or decrease the @Model.Id by 1?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
hi
i use nopcommerce 4.50
i want to create links for previous and next product
<a href="admin/product/edit/@Model.Id" id="prevproduct">prev product</a>
<a href="admin/product/edit/@Model.Id" id="nextproduct">next product</a>

so how can i increase @Model.Id by 1 for next product and decrease by 1 for previous product?
1 year ago
you need to use like this
into createorupdate info page
@{
  var next = Model.Id + 1;
  var prev = Model.Id -1 ;
}

and then add this page it will work

<a href="~/Admin/Product/edit/@prev" id="prevproduct">prev product</a>
  <a href="~/Admin/Product/edit/@next " id="nextproduct">next product</a>


https://prnt.sc/lp1DQG2KwU4N
see this URL

Hope it will be helpful
Thanks
1 year ago
ilyas_patel wrote:
you need to use like this
into createorupdate info page
@{
  var next = Model.Id + 1;
  var prev = Model.Id -1 ;
}

and then add this page it will work

<a href="~/Admin/Product/edit/@prev" id="prevproduct">prev product</a>
  <a href="~/Admin/Product/edit/@next " id="nextproduct">next product</a>


Hope it will be helpful
Thanks


yes, it worked
thank you so much
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.