2006年3月 9日 (木曜日)

15.1 Global オブジェクト (The Global Object)

リンク: 15.1 Global オブジェクト (The Global Object).

decodeURI 関数は新しいバージョンの URI を算出する。その中で、各エスケープシーケンスと encodeURI 関数により取り入れられる種類の UTF-8 符号は、そのあらわす文字に置換される。 encodeURI により取り入れられることのないエスケープシーケンスは置換されない。

decodeURI 関数が 1 個の引数 encodedURI で呼出されるとき、次のステップが取られる:

  1. ToString(encodedURI) を呼出す。
  2. reservedURISet を、 uriReserved と "#" の内で有効な各文字の一例を構成する文字列とする。
  3. Decode(Result(1), reservedURISet) を呼出す。
  4. Result(3) を返す。


NOTE  文字 "#" は、 URI 予約文字でなくてもエスケープシーケンスから復号されない。


| | コメント (0) | トラックバック (0)

2006年3月 3日 (金曜日)

ASP.NET.4GuysFromRolla.com: Accessing and Updating Data in ASP.NET 2.0: Filtering Database Data with Parameters

リンク: ASP.NET.4GuysFromRolla.com: Accessing and Updating Data in ASP.NET 2.0: Filtering Database Data with Parameters.
A Multipart Series on ASP.NET 2.0's Data Source Controls

ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET 2.0's new data
source controls.


  • Data Source Control Basics - explores the concepts
    and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.

  • Accessing Database Data - shows how to use the
    SqlDataSource and AccessDataSource controls to query data from a relational database.

  • Filtering Database Data with Parameters
    - learn how to
    retrieve just a subset of database data based on hard-coded values and
    values from the querystring, other Web controls on the page,
    session variables, and so on.
  • | | コメント (0) | トラックバック (0)

    2006年2月27日 (月曜日)

    Macromedia Flash: javascript clientside cookie to skip flash intro after first viewing

    リンク: Macromedia Flash: javascript clientside cookie to skip flash intro after first viewing.
    <html>
    <head>

        <script language="JavaScript" type="text/javascript">
        <!--
             function getCookie(NameOfCookie)
             {
                  if (document.cookie.length > 0)
                  {
                       begin = document.cookie.indexOf(NameOfCookie+"="

    );
                       if (begin != -1)
                       {
                            begin += NameOfCookie.length+1;
                            end = document.cookie.indexOf(";", begin);
                            if (end == -1) end = document.cookie.length;
                            return unescape(document.cookie.substring(begin, end));
                       }
                  }
                  return null;
             }

             function setCookie(NameOfCookie, value, expiredays)
             {
                  var ExpireDate = new Date ();
                  ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
                  document.cookie = NameOfCookie + "=" + escape(value)
                  + ((expiredays == null) ? "" : "; expires=none" + ExpireDate.toGMTString());
             }

    //-->
    </script>
    </head>

    <body bgcolor="#FFFFFF">

    <script language="JavaScript" type="text/javascript"> 
    <!--      
       introMovie = getCookie("intromov");
       if (introMovie!="true")    
       {
         document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'")
         document.write(" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'")
         document.write(" WIDTH=550 HEIGHT=400>")
         document.write(" <PARAM NAME=movie VALUE='images/intro.swf'> <PARAM NAME=quality VALUE=high> <PARAM
    NAME=scale VALUE=noborder> <PARAM NAME=bgcolor VALUE=#FFFFFF> ")
         document.write(" <EMBED src='images/intro.swf' quality=high scale=noborder bgcolor=#000000 ")
         document.write(" WIDTH=400 HEIGHT=550 TYPE='application/x-shockwave-flash' ")
         document.write(" PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>")
         document.write(" </EMBED></OBJECT>")
         setCookie('intromov', true, 365)
       }
       else
       {
         document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'")
         document.write(" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'")
         document.write(" WIDTH=550 HEIGHT=400>")
         document.write(" <PARAM NAME=movie VALUE='images/main.swf'> <PARAM NAME=quality VALUE=high> <PARAM
    NAME=scale VALUE=noborder> <PARAM NAME=bgcolor VALUE=#FFFFFF> ")
         document.write(" <EMBED src='images/main.swf' quality=high scale=noborder bgcolor=#000000 ")
         document.write(" WIDTH=550 HEIGHT=400 TYPE='application/x-shockwave-flash' ")
         document.write(" PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>")
         document.write(" </EMBED></OBJECT>")
        }
    //-->
    </script>
    </body>
    </html>

    | | コメント (0) | トラックバック (0)

    Rainbow - JiangHosting.Net

    リンク: Rainbow - JiangHosting.Net.

    <link rel="SHORTCUT ICON" href="/Rainbow/Portals/_Rainbow/portalicon.ico" >

    | | コメント (0) | トラックバック (0)

    2006年2月26日 (日曜日)

    How to set required NTFS permissions and user rights for an IIS 5.0 Web server

    リンク: How to set required NTFS permissions and user rights for an IIS 5.0 Web server.

    How to set required NTFS permissions and user rights for an IIS 5.0 Web server

    | | コメント (0) | トラックバック (0)

    CDOSYS

    リンク: CDOSYS.
    // language -- C#
    // import namespace
    using System.Web.Mail;

    private void SendEmail()
    {
       const string SERVER = "relay-hosting.secureserver.net";
       MailMessage oMail = new System.Web.Mail.MailMessage();
       oMail.From = "emailaddress@domainname";
       oMail.To = "emailaddress@domainname";
       oMail.Subject = "Test email subject";
       oMail.BodyFormat = MailFormat.Html; // enumeration
       oMail.Priority = MailPriority.High; // enumeration
       oMail.Body = "Sent at: " + DateTime.Now;
       SmtpMail.SmtpServer = SERVER;
       SmtpMail.Send(oMail); 
       oMail = null; // free up resources
    }

    | | コメント (0) | トラックバック (0)

    2006年2月24日 (金曜日)

    Membership Providers - Aquest Hosting Community

    リンク: Membership Providers - Aquest Hosting Community.

    Yes you have dbo access to your database so you have the access required to run the scripts that must be run to install the providers.

    To generate the script:

    On your computer, open the ASP.Net command line and enter:

    aspnet_regsql.exe -A all -sqlexportonly runproviders.sql

    That generates the basic script for you, and puts into a file called runproviders.sql. Open that file and use the "Edit | Replace" feature of your text editor to replace every instance of "aspnetdb" with your own database name.

    Connect to your SQL server and click the "New Script" button in SQL Server Studio, paste the script into the script text editor, and run it.

    That has created all your Roles, which you can see under the "Security | Roles" part of your database.

    Last part is to give your user account access to the roles with the following script (replace "YourUser" with your database user name), and run this little script. Then you are done with setting up SQL Server 2005 for the ASP.Net 2.0 Providers.

     

    Exec sp_addrolemember 'aspnet_Membership_FullAccess', 'YourUser'

    go

     

    Exec sp_addrolemember 'aspnet_Personalization_FullAccess', 'YourUser'

    go

     

    Exec sp_addrolemember 'aspnet_Profile_FullAccess', 'YourUser'

    go

     

    Exec sp_addrolemember 'aspnet_Roles_FullAccess', 'YourUser'

    go

     

    Exec sp_addrolemember 'aspnet_WebEvent_FullAccess', 'YourUser'

    go

    | | コメント (0) | トラックバック (0)

    How to setup ASP.Net 2 providers in SQL 2005

    リンク: How to setup ASP.Net 2 providers in SQL 2005.

    How to setup ASP.Net 2.0 Providers in SQL Server 2005

    This quick tutorial will show you how to setup the ASP.Net 2.0 Providers in SQL Server 2005

    To follow this tutorial, you will need 'dbo' permissions to your database, and if you are an Aquest Hosting customer with a SQL Server 2005 database, then you already have 'dbo' permissions to your database.

       

    Requirements:

                 

    You can connect to a SQL Server 2005 database using SQL Server Management Studio,
    and SQL Server 2005 Express Edition, which is available free as part of
    Visual Web Developer which can be downloaded free from


    http://go.microsoft.com/fwlink/?linkid=46255&clcid=0x409
    .


    This tutorial is using SQL Server Management Studio, but you should be able to figure out the
    other tools.

       

    Part 1: Create the script:

       
    1. Open the ASP.Net 2.0 command prompt on your computer by clicking "Start | All Programs |         Microsoft Visual Studio 2005 | Visual Studio Tools | Visual Studio 2005 Command Prompt".
    2. Enter "aspnet_regsql.exe -A all -sqlexportonly C:\runproviders.sql" and hit the enter key.
    3. *You have written the script to "C:\runproviders.sql", so open that file, and
              use your text editor's "Replace" feature to replace all occurences of "aspnetdb" with your database name.

       
       

    Part 2 - Run the script:


       
    1. Connect to your SQL Server 2005 database server.
    2. Click "New Query" in the top left corner.
    3. Copy and paste your sql script into the query window.
    4. Click the "Parse" check mark button to see if your script is error free.
    5. Click the "Execute" button to run your script.

       

       
       

    Part 3 - Verify Roles were added:


       
    1. Look in the Security folder under your database and see if the provider roles were added (see image). They
              all start with "aspnet_".

           

    Part 4 - Add your sql user account to the roles:


       
    1. Clear out the text in the Query window, or open a new Query window.
    2. Make sure your database is selected in the drop down list in the tool bar.
    3. Add the following script to the window.
               


                  Exec sp_addrolemember 'aspnet_Membership_FullAccess', 'yourUser'

                      go

                      Exec sp_addrolemember 'aspnet_Personalization_FullAccess', 'yourUser'

                      go

                      Exec sp_addrolemember 'aspnet_Profile_FullAccess', 'yourUser'

                      go

                      Exec sp_addrolemember 'aspnet_Roles_FullAccess', 'yourUser'

                      go

                      Exec sp_addrolemember 'aspnet_WebEvent_FullAccess', 'yourUser'

                      go

               


               
    4. Replace 'yourUser' in each command with your sql user name.
    5. Click "Parse" to check for errors.
    6. Click "Execute" to run the script.

       
       

    Completed:


       

    You have now completed setting up your ASP.Net 2.0 Providers in SQL Server 2005.

    | | コメント (0) | トラックバック (0)

    How to fix SQL Network Interfaces, error: 26

    リンク: How to fix SQL Network Interfaces, error: 26.

       

            Cause & Fix #1:

                 

    Cause: Server not configured for remote connections.

    The error is telling us that your server has not been configured to allow remote connections. If your SQL Server has not been configured to allow remote connections, then configure your SQL Server.

    Fix:

    SQL Server 2000: Open the SQL Server Client Network Utility. On the General tab enable the protocols you need to use. Typically this will be 'TCP/IP' and possibly 'Named Pipes'.

       

    SQL Server 2005 Open SQL Server Configuration Manager. Select "SQL Server 2005 Network Configuration |     Protocols for MSSQLSERVER" then enable the protocols you need.

       

       


            Cause & Fix #2:

                 

    Cause: ASP.Net 2.0 Providers are trying to pull from the server's (nonexistent) Providers database.


    By
    default the machine.config file is trying to pull the Provider
    information from a SQLExpress database using an invalid connection
    string named "LocalSQLServer". Many web servers will not have
    SQLExpress enabled, and will not have this value set to a valid SQL
    Server database that is of use to you. In a shared hosting environment,
    this is especially true, as it would be expected that you would want
    your Provider information stored in your database and not some single
    database shared by the other users of that web server.


    Fix:


           

    Since you
    probably cannot access the machine.config file, you need to override
    the Provider settings in your web.config file, and set the connection
    string name to your connection string name. The following code comes
    from the machine.config file and has been modified to first remove each
    provider before adding the provider.


       


            Add the following code to your web.config file just under
                the "<system.web>" tag.


                

       


            Make sure to replace the 3 occurrences of connectionStringName="LocalSQLServer" with your connection string name.



       

    This goes in the system.web section of web.config.



           
                <membership>


       


           
                 <providers>


       


           
                 <remove
                name="AspNetSqlMembershipProvider" />


       


           
                 <add
                name="AspNetSqlMembershipProvider"


       


           
                 
                type="System.Web.Security.SqlMembershipProvider,
                
           

       


       


           
                 
                System.Web, Version=2.0.0.0, Culture=neutral, 
                
           

       


       


           
                 
                PublicKeyToken=b03f5f7f11d50a3a"


       


           
                 
                connectionStringName="LocalSQLServer"


       


           
                 
                enablePasswordRetrieval="false"


       


           
                 
                enablePasswordReset="true"


       


           
                 
                requiresQuestionAndAnswer="true"


       


           
                 
                applicationName="/"


       


           
                 
                requiresUniqueEmail="false"


       


           
                 
                passwordFormat="Hashed"


       


           
                 
                maxInvalidPasswordAttempts="5"


       


           
                 
                minRequiredPasswordLength="7"


       


           
                 
                minRequiredNonalphanumericCharacters="1"


       


           
                 
                passwordAttemptWindow="10"


       


           
                 
                passwordStrengthRegularExpression="" />


       


           
                 </providers>


       


           
                 </membership> 
                
           

       


       


           
                 <profile>


       


           
                 <providers>


       


           
                 <remove
                name="AspNetSqlProfileProvider" />


       


           
                  <add name="AspNetSqlProfileProvider"
                
           

       


       


           
                 
                connectionStringName="LocalSQLServer" 
                
           

       


       


           
                 
                applicationName="/"


       


           
                 
                type="System.Web.Profile.SqlProfileProvider,


       


           
                 
                System.Web, Version=2.0.0.0, Culture=neutral, 
                
           

       


       


           
                 
                PublicKeyToken=b03f5f7f11d50a3a" />


       


           
                 </providers> 
                
           

       


       


           
                 </profile>


       


           
                 <roleManager>


       


           
                 <providers>


       


           
                 <remove
                name="AspNetSqlRoleProvider" />


       


           
                 <add
                name="AspNetSqlRoleProvider"
                
           

       


       


           
                 
                connectionStringName="LocalSQLServer"
                
           

       


       


           
                 
                applicationName="/"


       


           
                 
                type="System.Web.Security.SqlRoleProvider,
                
           

       


       


           
                 
                System.Web, Version=2.0.0.0, Culture=neutral, 
                
           

       


       


           
                 
                PublicKeyToken=b03f5f7f11d50a3a" />


       


           
                 </providers>


       


           
                 </roleManager>

    | | コメント (0) | トラックバック (0)

    2006年2月23日 (木曜日)

    Prototype.js Documentation List

    リンク: Prototype.js Documentation List.

    Quick Guide to Prototype [particletree.com]
    Prototype in script.aculo.us Wiki [wiki.script.aculo.us]









    | | コメント (0) | トラックバック (0)

    より以前の記事一覧