Saturday, June 25, 2011

The Root Security Policy

The Root Security Policy
The first document you’ll draft is the “Root Security Policy.” This is also the easiest to write, as it is the framework which points to the other policy documents.
As you draft a Root Security Policy, you will also enumerate the initial list of subordinate policies that you should produce next.

Friday, June 24, 2011

Manipulating HTML Server Controls

    <%@ Page Language="VB" %>

    <script runat="server">
       Sub Click(Sender as Object, e as EventArgs)
          select case Sender.Value
             case "Left"
                word_image.align = "left"
             case "Right"
                word_image.align = "right"
             case "Center"
                word_image.align = "center"
          end select

          Left.Style("Border-Style") = "notset"
          Right.Style("Border-Style") = "notset"
          Center.Style("Border-Style") = "notset"

          Sender.Style("Border-Style") = "inset"
        end Sub
    </script>

    <html><body>
        <font size="5">Sam's Teach Yourself ASP.NET in
        21 Days: Day 5 </font><hr><p>

        <form runat="server">
           <input type="Button" id="Left" runat="server"
              Value="Left" OnServerClick="Click" />
           <input type="Button" id="Center" runat="server"
              Value="Center" OnServerClick="Click" />
           <input type="Button" id="Right" runat="server"
              Value="Right" OnServerClick="Click" />
        </form>

        <img src="word.gif" id="word_image" runat="server">
        <div id="Label1" runat="server">This is an example
        of text. When the buttons above are clicked, the image
        will move around the text accordingly.<p> This example
        demonstrates the HtmlImage and HtmlInputButton controls.
        </div>

   </body></html>

Saving Values in the State Bag

    <%@ Page Language="VB" %>

    <script runat="server">
       Sub Page_Load(Sender as Object, e as EventArgs)
          if not Page.IsPostBack then
             ViewState("StartTime") = DateTime.Now
             lblMessage.Text = "The time is now: " & _
                ViewState("StartTime")
          end if
       end sub

       Sub Submit(obj as object, e as EventArgs)
          lblMessage.Text = "The time is now: " & _
             DateTime.Now & "<br>started at: " & _
             ViewState("StartTime")
       end Sub
   </script>

    <html><body>
       <font size="5">Sam's Teach Yourself ASP.NET in 21
      Days: Day 5 </font><hr><p>

       <form runat="server">
          <asp:Button id="btSubmit" runat="server" Text="Submit"
             onClick="Submit" />
          <p>
          <asp:Label id="lblMessage" runat=server />
       </form>
    </body></html>