ASP.NET
  Home arrow ASP.NET arrow Page 2 - ASP.NET Custom Server Controls: WordHack C...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

ASP.NET Custom Server Controls: WordHack Control
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2005-11-14

    Table of Contents:
  • ASP.NET Custom Server Controls: WordHack Control
  • What are the properties declared and how do we work with the control?
  • Is it getting rendered onto the page?
  • JavaScripts: the heart of WordHack
  • What is the WordHack Designer class?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ASP.NET Custom Server Controls: WordHack Control - What are the properties declared and how do we work with the control?


    (Page 2 of 5 )

    As I wanted the “WordHack” control to be as simple as possible, I declared only three properties.  Let us see them step by step.

    Private ReadOnly Property IsDesignTime()
            Get
                Return (Not Me.Site Is Nothing) AndAlso (Me.Site.DesignMode)
            End Get
        End Property

    It checks whether the control is at the stage of design-time or run-time.  This is  essential for me to determine whether the control needs to emit required JavaScript or not.  During design-time, it is not necessary to emit any JavaScript!   It needs to be emitted only at run-time.  You also need to observe that the property is “readonly” (no changes) and it is private (can be used only within the class and not outside the class).  I used it only within the “Render” method.

    Public Property Word2Hack() As String
            Get
                Return viewstate("Word2Hack") & ""
            End Get
            Set(ByVal Value As String)
                viewstate("Word2Hack") = Value
            End Set
        End Property

    The above property is used to specify the word which needs to be hacked (according to my story in the previous section, it would be simply “logout” or “yahoo” or whatever was needed).  The above property needs to be assigned to a specific URL.  The property that assigns the URL to the word being hacked from the browser has been defined as follows:

        Public Property RedirectURL() As String
            Get
                Return viewstate("RedirectURL") & ""
            End Get
            Set(ByVal Value As String)
                viewstate("RedirectURL") = Value
            End Set
        End Property

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Hai guys...this is another contribution of mine as part of ASP.NET controls...have a...
       · The demo is very good, but if I put two wordhecks there, the second doesn't work....
       · Hello, I think, I addressed those issues in the next article "ASP.NET Custom Server...
     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT