Guest User

Untitled

a guest
Jan 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Estylesoft.Megawall.BackOffice.Core.UI.MegawallViewPage<object>" %>
  2. <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  3.  
  4. <script>
  5.  
  6. var profiles = new Array();
  7.  
  8. <% foreach (var item in ViewData["ListProfile"]) { %>
  9.  
  10. profiles[item.profileID] = {field1 : value1, field2 : value2...};
  11. // item.profileID - это я просто так написал, посмотри, как у тебя поле называется
  12.  
  13. <% } %>
  14.  
  15. $(document).ready(function()
  16. {
  17. $("#ListProfile").change(ShowSelectedProfile);
  18. });
  19.  
  20. function ShowSelectedProfile()
  21. {
  22. var profileID = $("#ListProfile option:selected").attr("value");
  23.  
  24. // Тут выберем инфу по профилю
  25. var profileInfo = userProfiles[profileID];
  26.  
  27. // А дальше берем данные и пишем в то место на странице, куда хотим
  28. profileInfo.field1
  29. profileInfo.field2
  30. }
  31.  
  32.  
  33. <script>
  34.  
  35. <h2><%= CurrentSection.Description() %></h2>
  36. <div>
  37. <%using (Html.BeginForm() ){ %>
  38. <p>Профили пользователей</p>
  39. <div><%=Html.ListBox("ListProfile", (SelectList)ViewData["ListProfile"])%></div>
  40. <% } %>
  41. </div>
  42. </asp:Content>
Add Comment
Please, Sign In to add comment