Click here to Skip to main content
15,891,793 members
Articles / Web Development / ASP.NET

Improving ASP.NET MVC MUSIC STORE more usability with DotNetAge in 30 minutes

Rate me:
Please Sign up or sign in to vote.
4.87/5 (12 votes)
23 Nov 2010GPL38 min read 83.2K   5.5K   32  
Using the DotNetAge to upgrade the ASP.NET Mvc Music Store add widgets and security features just in minutes.
<%@ Control Language="C#" Inherits="DNA.Mvc.DynamicUI.WidgetViewUserControl" %>
<% string objID = Guid.NewGuid().ToString().Substring(0, 5);
   string _url = UserData["Url"] != null ? UserData["Url"].ToString() : "";// Model.GetValue("Url");
   string _file = string.IsNullOrEmpty(_url) ? "" : (VirtualPathUtility.IsAbsolute(_url) ? VirtualPathUtility.GetFileName(_url) : _url);
   string _bgcolor = UserData["BackgroundColor"].ToString();

   if (IsDesignMode)
   {
       List<SelectableNode> wmodes = new List<SelectableNode>();
       wmodes.AddRange(new SelectableNode[]{
       new SelectableNode("window", "window"),
   new SelectableNode("opaque", "opaque"),
   new SelectableNode("transparent", "transparent")});

       List<SelectableNode> qualities = new List<SelectableNode>();
       qualities.AddRange(new SelectableNode[]{
   new SelectableNode("low", "low"),
   new SelectableNode("autolow", "autolow"),
   new SelectableNode("autohigh", "autohigh"),
   new SelectableNode("medium", "medium"),
   new SelectableNode("high", "high"),
   new SelectableNode("best", "best")
    });
    
%>
<form action="#" class="ui-widget-settings ui-widget-content ui-corner-all">
<div>
    Url</div>
<div style="overflow: hidden;">
    <%:Ajax.TextBox(GenerateFieldID("Url"), _url)%>
    <%:Ajax.FileButton(GenerateFieldID("Url"), 
    WebContext.Current.Web.GetWebRootUri(), 
    new ButtonOptions() 
    { 
        Text = Html.Global("RES_BROWSE"), 
        Icons = new ButtonOptions.ButtonIcons()
        { 
            PrimaryIconCssClass = "ui-icon ui-icon-folder-open" 
        } 
    }, 
       null)%>
</div>
<div style="overflow: hidden; margin-top: 5px;">
    Width</div>
<div style="overflow: hidden;">
    <%:Ajax.Number(GenerateFieldID("Width"), (int)UserData["Width"])%></div>
<div>
    Height</div>
<div>
    <%:Ajax.Number(GenerateFieldID("Height"), (int)UserData["Height"])%></div>
<div>
    <%=PropertyDescriptors["WMODE"].DisplayName%></div>
<div>
    <%=Ajax.DropDown(GenerateFieldID( "WMODE"), wmodes, new DropDownOptions() { SelectedValue = UserData["WMODE"].ToString() })%>
</div>
<div>
    <%=PropertyDescriptors["Quality"].DisplayName%></div>
<div>
    <%=Ajax.DropDown(GenerateFieldID( "Quality"), qualities, new DropDownOptions() { SelectedValue = UserData["Quality"].ToString() })%></div>
<div>
    <%=PropertyDescriptors["FlashVars"].DisplayName%>
</div>
<div>
    <%:Ajax.TextBox(GenerateFieldID("FlashVars"), UserData["FlashVars"] != null ? UserData["FlashVars"].ToString() : "")%></div>
</form>
<%
    }
   if (string.IsNullOrEmpty(_url))
   { %>
<div class="dna-state-info">
    Please set the Flash object url.</div>
<% }
   else
   { %>
<object id="<%=objID %>" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="<%=UserData["Width"].ToString() %>" height="<%=UserData["Height"].ToString() %>">
    <param name="movie" value="<%=_file %>" />
    <param name="quality" value="<%=UserData["Quality"].ToString() %>" />
    <param name="bgcolor" value="<%=_bgcolor %>" />
    <embed name="<%=objID %>" src="<%=_url %>" quality="<%=UserData["Quality"].ToString() %>"
        bgcolor="<%=_bgcolor %>" width="<%=UserData["Width"].ToString()  %>" height="<%=UserData["Height"].ToString() %>"
        align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
        </embed>
</object>
<%} %>
<%=Html.StartupScripts()  %>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Architect DotNetAge
China China
In 1999, I started programming using Delphi, VB, VJ.From 2002 I started with .NET using C#.Since 2005 when i had became an EIP product manager I was focus on EIP and CMS technique. In 2008 i established dotnetage.com and started to shared my ideas and projects online. I believe "No shared no grow"

www.dotnetage.com

Comments and Discussions