Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Estylesoft.Megawall.BackOffice.Core.UI.MegawallViewPage<object>" %>
- <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
- <script>
- var profiles = new Array();
- <% foreach (var item in ViewData["ListProfile"]) { %>
- profiles[item.profileID] = {field1 : value1, field2 : value2...};
- // item.profileID - это я просто так написал, посмотри, как у тебя поле называется
- <% } %>
- $(document).ready(function()
- {
- $("#ListProfile").change(ShowSelectedProfile);
- });
- function ShowSelectedProfile()
- {
- var profileID = $("#ListProfile option:selected").attr("value");
- // Тут выберем инфу по профилю
- var profileInfo = userProfiles[profileID];
- // А дальше берем данные и пишем в то место на странице, куда хотим
- profileInfo.field1
- profileInfo.field2
- }
- <script>
- <h2><%= CurrentSection.Description() %></h2>
- <div>
- <%using (Html.BeginForm() ){ %>
- <p>Профили пользователей</p>
- <div><%=Html.ListBox("ListProfile", (SelectList)ViewData["ListProfile"])%></div>
- <% } %>
- </div>
- </asp:Content>
Add Comment
Please, Sign In to add comment