update to VS2022
This commit is contained in:
parent
146f0eeb0a
commit
49b635de91
457 changed files with 68000 additions and 4917 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,7 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.1.32328.378
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
License.txt = License.txt
|
||||
|
@ -57,4 +59,7 @@ Global
|
|||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {391AFB89-55FA-499F-99F7-112509430600}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
|
@ -11,6 +12,18 @@
|
|||
<RootNamespace>AspWebApp</RootNamespace>
|
||||
<AssemblyName>AspWebApp</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UseIISExpress>false</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -46,10 +59,6 @@
|
|||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Dlrsoft.Asp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\asp\bin\Release\Dlrsoft.Asp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Core">
|
||||
|
@ -140,8 +149,19 @@
|
|||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\asp\Asp.csproj">
|
||||
<Project>{f076a2d0-5200-42d7-9aea-9e1260efb138}</Project>
|
||||
<Name>Asp</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
60
aspclassiccompiler/Backup/ASPClassicCompiler.sln
Normal file
60
aspclassiccompiler/Backup/ASPClassicCompiler.sln
Normal file
|
@ -0,0 +1,60 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{244AF685-4E12-4893-89DA-939A2964C0FB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
License.txt = License.txt
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Parser", "Parser\Parser.vbproj", "{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScript", "VBScript\VBScript.csproj", "{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asp", "asp\Asp.csproj", "{F076A2D0-5200-42D7-9AEA-9E1260EFB138}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspWebApp", "AspWebApp\AspWebApp.csproj", "{24BF0EA3-2D82-4E85-B13D-EA9279F58812}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NerdDinnerAsp", "NerdDinnerAsp\NerdDinnerAsp.csproj", "{328C148C-DBEE-41A4-B1C7-104CBB216556}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBScriptTest", "VBScriptTest\VBScriptTest.csproj", "{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBSC", "VBSC\VBSC.csproj", "{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{57A0B340-BDA4-4DE3-B449-52B8C51D84B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0846368D-EA96-4AC4-81AF-E4F9B78CE60B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F076A2D0-5200-42D7-9AEA-9E1260EFB138}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{24BF0EA3-2D82-4E85-B13D-EA9279F58812}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{328C148C-DBEE-41A4-B1C7-104CBB216556}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3153B5A6-B372-46D0-A10B-0CC4C4FBAE9D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{556BAE6E-AA67-48C7-ACD6-1AB0AA930197}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
171
aspclassiccompiler/Backup/AspWebApp/AspWebApp.csproj
Normal file
171
aspclassiccompiler/Backup/AspWebApp/AspWebApp.csproj
Normal file
|
@ -0,0 +1,171 @@
|
|||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{24BF0EA3-2D82-4E85-B13D-EA9279F58812}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AspWebApp</RootNamespace>
|
||||
<AssemblyName>AspWebApp</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Dlrsoft.Asp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\asp\bin\Release\Dlrsoft.Asp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Extensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="default.htm" />
|
||||
<Content Include="test\byref.asp" />
|
||||
<Content Include="test\byref2.asp" />
|
||||
<Content Include="test\call.asp" />
|
||||
<Content Include="test\BuiltinConstants.asp" />
|
||||
<Content Include="components\adrot.txt" />
|
||||
<Content Include="components\AdRotator.asp" />
|
||||
<Content Include="components\BrowserCap.asp" />
|
||||
<Content Include="components\CDO.Asp" />
|
||||
<Content Include="components\clientcap.htm" />
|
||||
<Content Include="components\ContentRotator.Asp" />
|
||||
<Content Include="components\Counters\Docs\Contents.Htm" />
|
||||
<Content Include="components\Counters\Docs\Counter1.Htm" />
|
||||
<Content Include="components\Counters\Docs\Counter2.Htm" />
|
||||
<Content Include="components\Counters\Docs\Counter3.Htm" />
|
||||
<Content Include="components\Counters\Docs\Counter4.Htm" />
|
||||
<Content Include="components\Counters\Docs\Counter5.Htm" />
|
||||
<Content Include="components\Counters\Docs\Default.Htm" />
|
||||
<Content Include="components\Counters\Sample\Counters_JScript.Asp" />
|
||||
<Content Include="components\Counters\Sample\Counters_VBScript.Asp" />
|
||||
<Content Include="components\Counters\Sample\Global.Asa" />
|
||||
<Content Include="components\Counters\TOURL.Htm" />
|
||||
<Content Include="components\FileSystem.Asp" />
|
||||
<Content Include="components\ie.gif" />
|
||||
<Content Include="components\nts_iis.gif" />
|
||||
<Content Include="components\PermissionCheck.Asp" />
|
||||
<Content Include="components\Tiprot.Txt" />
|
||||
<Content Include="components\Tools.Asp" />
|
||||
<Content Include="test\datetest.asp" />
|
||||
<Content Include="test\extension.asp" />
|
||||
<Content Include="test\ifnull.asp" />
|
||||
<Content Include="test\imports.asp" />
|
||||
<Content Include="test\with.asp" />
|
||||
<Content Include="Database\AddDelete.asp" />
|
||||
<Content Include="Database\adovbs.inc" />
|
||||
<Content Include="Database\Authors.mdb">
|
||||
</Content>
|
||||
<Content Include="Database\Blob.Asp" />
|
||||
<Content Include="Database\LimitRows.asp" />
|
||||
<Content Include="Database\MultiScrolling.asp" />
|
||||
<Content Include="Database\SimpleQuery.asp" />
|
||||
<Content Include="Database\StoredProcedures.asp" />
|
||||
<Content Include="Database\Update.asp" />
|
||||
<Content Include="test\perftest2.asp" />
|
||||
<Content Include="test\datatypes.asp" />
|
||||
<Content Include="test\forloop.asp" />
|
||||
<Content Include="test\function.asp" />
|
||||
<Content Include="test\if.asp" />
|
||||
<Content Include="test\literals.asp" />
|
||||
<Content Include="test\perftest.asp" />
|
||||
<Content Include="test\servervars.asp" />
|
||||
<Content Include="Simple\Arrays.asp" />
|
||||
<Content Include="Simple\Components.Asp" />
|
||||
<Content Include="Simple\Conditional.asp" />
|
||||
<Content Include="Simple\Functions.asp" />
|
||||
<Content Include="Simple\HeaderInfo.Asp" />
|
||||
<Content Include="Simple\Includes.asp" />
|
||||
<Content Include="Simple\Looping.asp" />
|
||||
<Content Include="Simple\Variables.asp" />
|
||||
<Content Include="Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>3465</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
59
aspclassiccompiler/Backup/AspWebApp/Database/AddDelete.asp
Normal file
59
aspclassiccompiler/Backup/AspWebApp/Database/AddDelete.asp
Normal file
|
@ -0,0 +1,59 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
<% Response.Expires= -1 %>
|
||||
|
||||
<!--METADATA TYPE="typelib"
|
||||
uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Add/Delete Database Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
|
||||
|
||||
<!-- Display Header -->
|
||||
|
||||
<font size="4" face="Arial, Helvetica">
|
||||
<b>Add/Delete Database Sample</b></font><br>
|
||||
|
||||
<hr size="1" color="#000000">
|
||||
|
||||
<%
|
||||
Dim oConn
|
||||
Dim oRs
|
||||
Dim filePath
|
||||
|
||||
|
||||
' Map authors database to physical path
|
||||
filePath = Server.MapPath("authors.mdb")
|
||||
|
||||
|
||||
' Create ADO Connection Component to connect with sample database
|
||||
|
||||
|
||||
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
|
||||
|
||||
' To add, delete and update recordset, it is recommended to use
|
||||
' direct SQL statement instead of ADO methods.
|
||||
|
||||
oConn.Execute "insert into authors (author, YearBorn) values ('Paul Enfield', 1967)"
|
||||
|
||||
' Output Result
|
||||
Set oRs = oConn.Execute (" select * from authors where Author= 'Paul Enfield' and YearBorn =1967 " )
|
||||
Response.Write("<p>Inserted Author: " & oRs("Author") & "," & oRs("YearBorn"))
|
||||
' Close Recordset
|
||||
oRs.Close
|
||||
Set oRs= Nothing
|
||||
|
||||
|
||||
' Delete the inserted record
|
||||
oConn.Execute "Delete From authors where author='Paul Enfield' and YearBorn = 1967 "
|
||||
|
||||
' Output Status Result
|
||||
Response.Write("<p>Deleted Author: Paul Enfield, 1967")
|
||||
%>
|
||||
</BODY>
|
||||
</HTML>
|
BIN
aspclassiccompiler/Backup/AspWebApp/Database/Authors.mdb
Normal file
BIN
aspclassiccompiler/Backup/AspWebApp/Database/Authors.mdb
Normal file
Binary file not shown.
48
aspclassiccompiler/Backup/AspWebApp/Database/Blob.Asp
Normal file
48
aspclassiccompiler/Backup/AspWebApp/Database/Blob.Asp
Normal file
|
@ -0,0 +1,48 @@
|
|||
<% @ LANGUAGE=VBScript %>
|
||||
<% Option Explicit %>
|
||||
<HTML>
|
||||
|
||||
<%
|
||||
' This sample utilizes the Image field in the PUB_INFO table.
|
||||
' This table is installed with Microsoft SQL Server in the
|
||||
' PUBS database.
|
||||
|
||||
|
||||
Dim oConn
|
||||
Dim oRs
|
||||
Dim Pic
|
||||
Dim PicSize
|
||||
Dim strConn
|
||||
|
||||
|
||||
' Setup HTTP Header Information so that the browser interprets
|
||||
' the returned data as a gif graphic file. Note that browsers
|
||||
' interpret returned information using MIME headers -- not file
|
||||
' extensions.
|
||||
|
||||
Response.Buffer = TRUE
|
||||
Response.ContentType = "image/gif"
|
||||
|
||||
|
||||
' Create ADO Connection Object. Use OLEDB Source with
|
||||
' default sa account and no password
|
||||
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
strConn="Provider=SQLOLEDB;User ID=sa;Initial Catalog=pubs;Data Source="& Request.ServerVariables("SERVER_NAME")
|
||||
' Query SQL to obtain recordset containing gif BLOB
|
||||
oConn.Open strConn
|
||||
Set oRs = oConn.Execute("SELECT logo FROM pub_info WHERE pub_id='0736'")
|
||||
|
||||
' Obtain local variable of GIF
|
||||
|
||||
PicSize = oRs("logo").ActualSize
|
||||
Pic = oRs("logo").GetChunk(PicSize)
|
||||
|
||||
|
||||
' Write Data back to client. Because MIME type is set to
|
||||
' image/gif, the browser will automatically render as picture
|
||||
|
||||
Response.BinaryWrite Pic
|
||||
Response.End
|
||||
%>
|
||||
dsafds
|
93
aspclassiccompiler/Backup/AspWebApp/Database/LimitRows.asp
Normal file
93
aspclassiccompiler/Backup/AspWebApp/Database/LimitRows.asp
Normal file
|
@ -0,0 +1,93 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!--METADATA TYPE="typelib"
|
||||
uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
|
||||
<!--#INCLUDE FILE="adovbs.inc"-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>LimitRows From Database</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
|
||||
|
||||
|
||||
<!-- Display Header -->
|
||||
|
||||
<font size="4" face="Arial, Helvetica">
|
||||
<b>LimitRows From Database</b></font><br>
|
||||
|
||||
<hr size="1" color="#000000">
|
||||
|
||||
Contacts within the Authors Database:<br><br>
|
||||
|
||||
<%
|
||||
Dim oConn
|
||||
Dim oRs
|
||||
Dim curDir
|
||||
Dim Index
|
||||
|
||||
|
||||
' Map authors database to physical path
|
||||
|
||||
curDir = Server.MapPath("authors.mdb")
|
||||
|
||||
' Create ADO Connection Component to connect
|
||||
' with sample database
|
||||
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir
|
||||
|
||||
|
||||
' Create ADO Recordset Component
|
||||
|
||||
Set oRs = Server.CreateObject("ADODB.Recordset")
|
||||
Set oRs.ActiveConnection = oConn
|
||||
|
||||
|
||||
' Set Recordset PageSize so that it only
|
||||
' holds 10 rows
|
||||
|
||||
oRs.PageSize = 10
|
||||
|
||||
|
||||
' Get recordset
|
||||
|
||||
oRs.Source = "SELECT * FROM authors"
|
||||
oRs.CursorType = adOpenStatic
|
||||
|
||||
|
||||
' Open Recordset
|
||||
oRs.Open
|
||||
%>
|
||||
|
||||
|
||||
<TABLE border = 1>
|
||||
<%
|
||||
Dim RecordCount
|
||||
RecordCount = 0
|
||||
|
||||
Do while ((Not oRs.eof) And (RecordCount < oRs.PageSize)) %>
|
||||
|
||||
<tr>
|
||||
<% For Index=0 to (oRs.fields.count-1) %>
|
||||
<TD VAlign=top><% = oRs(Index)%></TD>
|
||||
<% Next %>
|
||||
</tr>
|
||||
|
||||
<%
|
||||
RecordCount = RecordCount + 1
|
||||
oRs.MoveNext
|
||||
Loop
|
||||
%>
|
||||
|
||||
</TABLE>
|
||||
|
||||
|
||||
<%
|
||||
oRs.close
|
||||
oConn.close
|
||||
%>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
124
aspclassiccompiler/Backup/AspWebApp/Database/MultiScrolling.asp
Normal file
124
aspclassiccompiler/Backup/AspWebApp/Database/MultiScrolling.asp
Normal file
|
@ -0,0 +1,124 @@
|
|||
<% @LANGUAGE="VBSCRIPT" %>
|
||||
<% Option Explicit %>
|
||||
<!--#INCLUDE FILE="adovbs.inc"-->
|
||||
<!--METADATA TYPE="typelib"
|
||||
uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>MultiScrolling Database Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
|
||||
|
||||
|
||||
<!-- Display Header -->
|
||||
|
||||
<font size="4" face="Arial, Helvetica">
|
||||
<b>MultiScrolling Database Sample</b></font><br>
|
||||
|
||||
<hr size="1" color="#000000">
|
||||
|
||||
Contacts within the Authors Database:<br><br>
|
||||
|
||||
<%
|
||||
Dim oConn
|
||||
Dim oRs
|
||||
Dim filePath
|
||||
Dim Mv
|
||||
Dim PageNo
|
||||
Dim j
|
||||
Dim i
|
||||
|
||||
|
||||
' Map authors database to physical path
|
||||
|
||||
filePath = Server.MapPath("authors.mdb")
|
||||
|
||||
|
||||
' Create ADO Connection Component to connect with
|
||||
' sample database
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
|
||||
|
||||
|
||||
' Create ADO Recordset Component
|
||||
|
||||
Set oRs = Server.CreateObject("ADODB.Recordset")
|
||||
|
||||
|
||||
' Determine what PageNumber the scrolling currently is on
|
||||
|
||||
Mv = Request("Mv")
|
||||
|
||||
If Request("PageNo") = "" Then
|
||||
PageNo = 1
|
||||
Else
|
||||
PageNo = Request("PageNo")
|
||||
End If
|
||||
|
||||
' Setup Query Recordset (4 records per page)
|
||||
|
||||
oRs.Open "SELECT * FROM Authors", oConn, adOpenStatic
|
||||
oRs.PageSize = 4
|
||||
|
||||
|
||||
' Adjust PageNumber as Appropriate
|
||||
If Mv = "Page Up" or Mv = "Page Down" Then
|
||||
Select Case Mv
|
||||
Case "Page Up"
|
||||
If PageNo > 1 Then
|
||||
PageNo = PageNo - 1
|
||||
Else
|
||||
PageNo = 1
|
||||
End If
|
||||
Case "Page Down"
|
||||
If oRs.AbsolutePage < oRs.PageCount Then
|
||||
PageNo = PageNo + 1
|
||||
Else
|
||||
PageNo = oRs.PageCount
|
||||
End If
|
||||
Case Else
|
||||
PageNo = 1
|
||||
End Select
|
||||
End If
|
||||
|
||||
oRs.AbsolutePage = PageNo
|
||||
%>
|
||||
|
||||
<!-- Draw Table of Contacts in DB -->
|
||||
|
||||
<TABLE BORDER=1>
|
||||
<% For j = 1 to oRs.PageSize %>
|
||||
<TR>
|
||||
<% For i = 0 to oRs.Fields.Count - 1 %>
|
||||
<TD VALIGN=TOP><%= oRs(i) %></TD>
|
||||
<% Next %>
|
||||
</TR>
|
||||
|
||||
<%
|
||||
oRs.MoveNext
|
||||
|
||||
' Don't try to print the EOF record.
|
||||
If oRs.EOF Then
|
||||
Exit For
|
||||
End If
|
||||
Next %>
|
||||
</TABLE>
|
||||
|
||||
<!-- Scrolling Navigation Control for Sample -->
|
||||
|
||||
<Form Action=MultiScrolling.asp Method="POST">
|
||||
<Input Type="Hidden" Name="PageNo" Value="<%= PageNo %>">
|
||||
<!-- Only show appropriate buttons -->
|
||||
<% If PageNo < oRs.PageCount Then %>
|
||||
<INPUT TYPE="Submit" Name="Mv" Value="Page Down">
|
||||
<% End If %>
|
||||
|
||||
<% If PageNo > 1 Then %>
|
||||
<INPUT TYPE="Submit" Name="Mv" Value="Page Up">
|
||||
<% End If %>
|
||||
|
||||
</Form>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
71
aspclassiccompiler/Backup/AspWebApp/Database/SimpleQuery.asp
Normal file
71
aspclassiccompiler/Backup/AspWebApp/Database/SimpleQuery.asp
Normal file
|
@ -0,0 +1,71 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Simple ADO Query</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
|
||||
|
||||
<!-- Display Header -->
|
||||
|
||||
<font size="4" face="Arial, Helvetica">
|
||||
<b>Simple ADO Query with ASP</b></font><br>
|
||||
|
||||
<hr size="1" color="#000000">
|
||||
|
||||
Contacts within the Authors Database:<br><br>
|
||||
|
||||
<%
|
||||
Dim oConn
|
||||
Dim oRs
|
||||
Dim filePath
|
||||
Dim Index
|
||||
|
||||
|
||||
' Map authors database to physical path
|
||||
filePath = Server.MapPath("authors.mdb")
|
||||
|
||||
|
||||
' Create ADO Connection Component to connect
|
||||
' with sample database
|
||||
|
||||
|
||||
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
|
||||
|
||||
|
||||
' Execute a SQL query and store the results
|
||||
' within recordset
|
||||
|
||||
Set oRs = oConn.Execute("SELECT * From authors")
|
||||
%>
|
||||
|
||||
|
||||
<TABLE border = 1>
|
||||
<%
|
||||
Do while (Not oRs.eof) %>
|
||||
|
||||
<tr>
|
||||
<% For Index=0 to (oRs.fields.count-1) %>
|
||||
<TD VAlign=top><%= oRs(Index)%></TD>
|
||||
<% Next %>
|
||||
</tr>
|
||||
|
||||
<% oRs.MoveNext
|
||||
Loop
|
||||
%>
|
||||
|
||||
|
||||
</TABLE>
|
||||
|
||||
|
||||
<%
|
||||
oRs.close
|
||||
oConn.close
|
||||
%>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,63 @@
|
|||
<% @ LANGUAGE="VBSCRIPT" %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!--METADATA TYPE="typelib"
|
||||
uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
|
||||
<% ' This example can be used to call the ByRoyalty stored procedure
|
||||
' installed with the PUBS database with Microsoft SQL Server.
|
||||
|
||||
' This sample assumes that SQL Server is running on the local machine
|
||||
%>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Using Stored Procedures</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY bgcolor="white" topmargin="10" leftmargin="10">
|
||||
|
||||
<!-- Display Header -->
|
||||
|
||||
<font size="4" face="Arial, Helvetica">
|
||||
<b>Using Stored Procedures</b></font><p>
|
||||
|
||||
<%
|
||||
Dim oConn
|
||||
Dim strConn
|
||||
Dim oCmd
|
||||
Dim oRs
|
||||
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
Set oCmd = Server.CreateObject("ADODB.Command")
|
||||
|
||||
|
||||
' Open ADO Connection using account "sa"
|
||||
' and blank password
|
||||
|
||||
strConn="Provider=SQLOLEDB;User ID=sa;Initial Catalog=pubs;Data Source="& Request.ServerVariables("SERVER_NAME")
|
||||
oConn.Open strConn
|
||||
Set oCmd.ActiveConnection = oConn
|
||||
|
||||
|
||||
' Setup Call to Stored Procedure and append parameters
|
||||
|
||||
oCmd.CommandText = "{call byroyalty(?)}"
|
||||
oCmd.Parameters.Append oCmd.CreateParameter("@Percentage", adInteger, adParamInput)
|
||||
|
||||
|
||||
' Assign value to input parameter
|
||||
|
||||
oCmd("@Percentage") = 75
|
||||
|
||||
|
||||
' Fire the Stored Proc and assign resulting recordset
|
||||
' to our previously created object variable
|
||||
|
||||
Set oRs = oCmd.Execute
|
||||
%>
|
||||
|
||||
Author ID = <% Response.Write oRs("au_id") %><BR>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
54
aspclassiccompiler/Backup/AspWebApp/Database/Update.asp
Normal file
54
aspclassiccompiler/Backup/AspWebApp/Database/Update.asp
Normal file
|
@ -0,0 +1,54 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!--METADATA TYPE="typelib"
|
||||
uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Update Database</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" topmargin="10" leftmargin="10">
|
||||
|
||||
<!-- Display Header -->
|
||||
|
||||
<font size="4" face="Arial, Helvetica">
|
||||
<b>Update Database</b></font><br>
|
||||
|
||||
<hr size="1" color="#000000">
|
||||
|
||||
<%
|
||||
Dim oConn ' object for ADODB.Connection obj
|
||||
Dim oRs ' object for output recordset object
|
||||
Dim filePath ' Directory of authors.mdb file
|
||||
|
||||
|
||||
' Map authors database to physical path
|
||||
filePath = Server.MapPath("authors.mdb")
|
||||
|
||||
' Create ADO Connection Component to connect with sample database
|
||||
|
||||
Set oConn = Server.CreateObject("ADODB.Connection")
|
||||
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
|
||||
|
||||
' To add, delete and update recordset, it is recommended to use
|
||||
' direct SQL statement instead of ADO methods.
|
||||
oConn.Execute "Update Authors Set Author ='Scott Clinton'" _
|
||||
& "where Author='Scott Guthrie' "
|
||||
Set oRs = oConn.Execute ( "select * from Authors where author" _
|
||||
& "= 'Scott Clinton'" )
|
||||
%>
|
||||
|
||||
Changed Author: <%= oRs("Author") %>, <%= oRs("Yearborn") %> <P>
|
||||
|
||||
<%
|
||||
oConn.Execute "Update Authors Set Author ='Scott Guthrie'" _
|
||||
& "where Author='Scott Clinton' "
|
||||
Set oRs = oConn.Execute ( "select * from Authors where author" _
|
||||
& "= 'Scott Guthrie'" )
|
||||
%>
|
||||
|
||||
Changed Author: <%= oRs("Author") %>, <%= oRs("Yearborn") %>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
33
aspclassiccompiler/Backup/AspWebApp/Database/adovbs.inc
Normal file
33
aspclassiccompiler/Backup/AspWebApp/Database/adovbs.inc
Normal file
|
@ -0,0 +1,33 @@
|
|||
<%
|
||||
'--------------------------------------------------------------------
|
||||
' Microsoft ADO
|
||||
'
|
||||
' Copyright (c) 1996-1998 Microsoft Corporation.
|
||||
'
|
||||
'
|
||||
'
|
||||
' ADO constants include file for VBScript
|
||||
'
|
||||
'--------------------------------------------------------------------
|
||||
|
||||
'---- CursorTypeEnum Values ----
|
||||
Const adOpenForwardOnly = 0
|
||||
Const adOpenKeyset = 1
|
||||
Const adOpenDynamic = 2
|
||||
Const adOpenStatic = 3
|
||||
|
||||
'---- CursorOptionEnum Values ----
|
||||
Const adHoldRecords = &H00000100
|
||||
Const adMovePrevious = &H00000200
|
||||
Const adAddNew = &H01000400
|
||||
Const adDelete = &H01000800
|
||||
|
||||
'...
|
||||
'... Lots more lines like the ones above go here ...
|
||||
'...
|
||||
|
||||
'---- RecordTypeEnum Values ----
|
||||
Const adSimpleRecord = 0
|
||||
Const adCollectionRecord = 1
|
||||
Const adStructDoc = 2
|
||||
%>
|
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AspWebApp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("DLRSoft")]
|
||||
[assembly: AssemblyProduct("VBScript.NET")]
|
||||
[assembly: AssemblyCopyright("Copyright © DLRSoft 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.2.32072")]
|
112
aspclassiccompiler/Backup/AspWebApp/Simple/Arrays.asp
Normal file
112
aspclassiccompiler/Backup/AspWebApp/Simple/Arrays.asp
Normal file
|
@ -0,0 +1,112 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<%
|
||||
'Declare a simple fixed size array.
|
||||
Dim aFixed(4)
|
||||
|
||||
'Declare a dynamic (resizable) array.
|
||||
Dim aColors()
|
||||
|
||||
|
||||
'Assign values to fixed size array.
|
||||
|
||||
aFixed(0) = "Fixed"
|
||||
aFixed(1) = "Size"
|
||||
aFixed(2) = "Array"
|
||||
aFixed(3) = "Session ID: " & Session.SessionID
|
||||
|
||||
|
||||
'Allocate storage for the array.
|
||||
Redim aColors(14)
|
||||
|
||||
'Store values representing a simple color table
|
||||
'to each of the elements.
|
||||
|
||||
aColors(0) = "RED" '[#FF0000]
|
||||
aColors(1) = "GREEN" '[#008000]
|
||||
aColors(2) = "BLUE" '[#0000FF]
|
||||
aColors(3) = "AQUA" '[#00FFFF]
|
||||
aColors(4) = "YELLOW" '[#FFFF00]
|
||||
aColors(5) = "FUCHSIA" '[#FF00FF]
|
||||
aColors(6) = "GRAY" '[#808080]
|
||||
aColors(7) = "LIME" '[#00FF00]
|
||||
aColors(8) = "MAROON" '[#800000]
|
||||
aColors(9) = "NAVY" '[#000080]
|
||||
aColors(10) = "OLIVE" '[#808000]
|
||||
aColors(11) = "PURPLE" '[#800080]
|
||||
aColors(12) = "SILVER" '[#C0C0C0]
|
||||
aColors(13) = "TEAL" '[#008080]
|
||||
%>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Array Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="Arial, Helvetica">
|
||||
<B>Array Sample</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
<TABLE CELLPADDING=10 BORDER=1 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD BGCOLOR=WHITE>
|
||||
<FONT SIZE="3" FACE="Arial, Helvetica">
|
||||
<B>A Resizable Array</B><BR>
|
||||
</FONT>
|
||||
</TD>
|
||||
|
||||
<TD BGCOLOR=WHITE>
|
||||
<FONT SIZE="3" FACE="Arial, Helvetica">
|
||||
<B>A Fixed Size (4 element) Array</B><BR>
|
||||
</FONT>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>
|
||||
<%
|
||||
Dim intColors
|
||||
Dim i
|
||||
|
||||
'Calculate array size.
|
||||
intColors = UBound(aColors)
|
||||
|
||||
'Print out contents of resizable array into
|
||||
'table column.
|
||||
|
||||
For i = 0 To intColors - 1
|
||||
Response.Write("<FONT COLOR=" & Chr(34) & aColors(i) & Chr(34) &">" & aColors(i) &"<br></FONT>")
|
||||
Next
|
||||
%>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<%
|
||||
'Calculate Array Size.
|
||||
intColors = UBound(aFixed)
|
||||
|
||||
|
||||
'Print out contents of fixed array into table
|
||||
'column.
|
||||
|
||||
For i = 0 To intColors -1
|
||||
Response.Write(aFixed(i) & "<br>")
|
||||
Next
|
||||
%>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
40
aspclassiccompiler/Backup/AspWebApp/Simple/Components.Asp
Normal file
40
aspclassiccompiler/Backup/AspWebApp/Simple/Components.Asp
Normal file
|
@ -0,0 +1,40 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Using Components</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<b>Using Components with ASP</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
This script uses the Tools component that
|
||||
comes with IIS to generate a random number.
|
||||
<BR>
|
||||
<BR>
|
||||
|
||||
<%
|
||||
Dim objExample
|
||||
|
||||
'Instantiate Component on the Server.
|
||||
Set objExample = Server.CreateObject("MSWC.Tools")
|
||||
%>
|
||||
|
||||
Random Number = <%= objExample.Random() %>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
60
aspclassiccompiler/Backup/AspWebApp/Simple/Conditional.asp
Normal file
60
aspclassiccompiler/Backup/AspWebApp/Simple/Conditional.asp
Normal file
|
@ -0,0 +1,60 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Conditional Operator Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Conditional Operator Sample</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
<!-- If...Then example -->
|
||||
|
||||
<%
|
||||
Dim varDate
|
||||
varDate = Date()
|
||||
%>
|
||||
|
||||
<P>The date is: <%= varDate %></P>
|
||||
|
||||
<%
|
||||
'Select Case statement to display a message based on the day of the month.
|
||||
Select Case Day(varDate)
|
||||
Case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
||||
Response.Write("<P>It's the beginning of the month.</P>")
|
||||
|
||||
Case 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
|
||||
Response.Write("<P>It's the middle of the month.</P>")
|
||||
|
||||
Case Else
|
||||
Response.Write("<P>It's the end of the month.</P>")
|
||||
End Select
|
||||
%>
|
||||
|
||||
<P>The time is: <%= Time %></P>
|
||||
|
||||
<%
|
||||
'Check for AM/PM, and output appropriate message.
|
||||
|
||||
If (Right(Time,2)="AM") Then
|
||||
Response.Write("<P>Good Morning</P>")
|
||||
Else
|
||||
Response.Write("<P>Good Evening</P>")
|
||||
End If
|
||||
%>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
54
aspclassiccompiler/Backup/AspWebApp/Simple/Functions.asp
Normal file
54
aspclassiccompiler/Backup/AspWebApp/Simple/Functions.asp
Normal file
|
@ -0,0 +1,54 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
|
||||
|
||||
'Define Server Side Script Function.
|
||||
Function PrintOutMsg(strMsg, intCount)
|
||||
Dim i
|
||||
|
||||
'Output Message count times.
|
||||
For i = 1 to intCount
|
||||
Response.Write(strMsg & "<BR>")
|
||||
Next
|
||||
|
||||
'Return number of iterations.
|
||||
PrintOutMsg = intCount
|
||||
End Function
|
||||
|
||||
</SCRIPT>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Functions</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Server Side Functions</B></FONT><BR>
|
||||
|
||||
<P>
|
||||
The function "PrintOutMsg" prints out a specific message a set number of times.<P>
|
||||
|
||||
|
||||
<%
|
||||
'Store number of times function printed message.
|
||||
Dim intTimes
|
||||
|
||||
'Call function.
|
||||
intTimes = PrintOutMsg("This is a function test!", 4)
|
||||
|
||||
'Output the function return value.
|
||||
Response.Write("<p>The function printed out the message " & intTimes & " times.")
|
||||
%>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1 @@
|
|||
<B>This text is coming from HeaderInfo.asp.</B>
|
32
aspclassiccompiler/Backup/AspWebApp/Simple/Includes.asp
Normal file
32
aspclassiccompiler/Backup/AspWebApp/Simple/Includes.asp
Normal file
|
@ -0,0 +1,32 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Server Side Includes</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Server Side Includes</B></FONT><BR>
|
||||
|
||||
|
||||
<P>Server-Side Includes can be done using the
|
||||
#Include File command. The below text in bold
|
||||
has been generated with a Server-Side Include:
|
||||
|
||||
<P> <!--#INCLUDE FILE="HeaderInfo.asp"--> </P>
|
||||
|
||||
<P>Include files can be referenced using either
|
||||
absolute or relative paths.<BR>
|
||||
</BODY>
|
||||
</HTML>
|
71
aspclassiccompiler/Backup/AspWebApp/Simple/Looping.asp
Normal file
71
aspclassiccompiler/Backup/AspWebApp/Simple/Looping.asp
Normal file
|
@ -0,0 +1,71 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Looping</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Looping with ASP</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
<!-- Looping with a For loop. -->
|
||||
|
||||
<%
|
||||
Dim intCounter
|
||||
For intCounter = 1 to 5 %>
|
||||
|
||||
<FONT SIZE=<% = intCounter %>>
|
||||
|
||||
Hello World with a For Loop!<BR>
|
||||
</FONT>
|
||||
|
||||
<% next %>
|
||||
<HR>
|
||||
|
||||
<!-- Looping with a While...Wend loop. -->
|
||||
|
||||
<%
|
||||
intCounter = 1
|
||||
While(intCounter < 6) %>
|
||||
|
||||
<FONT SIZE=<% = intCounter %>>
|
||||
|
||||
Hello World with a While Loop!<BR>
|
||||
</FONT>
|
||||
|
||||
<% intCounter = intCounter + 1 %>
|
||||
|
||||
<% wend %>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- Looping with a Do...While loop. -->
|
||||
|
||||
<%
|
||||
intCounter = 1
|
||||
Do While(intCounter < 6) %>
|
||||
|
||||
<FONT SIZE=<% =intCounter %>>
|
||||
|
||||
Hello World with a Do...While Loop!<BR>
|
||||
</FONT>
|
||||
|
||||
<% intCounter = intCounter+1 %>
|
||||
|
||||
<% loop %>
|
||||
</BODY>
|
||||
</HTML>
|
90
aspclassiccompiler/Backup/AspWebApp/Simple/Variables.asp
Normal file
90
aspclassiccompiler/Backup/AspWebApp/Simple/Variables.asp
Normal file
|
@ -0,0 +1,90 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Variable Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Variable Sample</B></FONT><BR>
|
||||
|
||||
<HR>
|
||||
<H3>Integer Manipulation</H3>
|
||||
|
||||
<%
|
||||
'Declare variable.
|
||||
Dim intVar
|
||||
|
||||
'Assign the variable an integer value.
|
||||
intVar = 5
|
||||
%>
|
||||
|
||||
|
||||
<P><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></P>
|
||||
|
||||
|
||||
<HR>
|
||||
<H3>String Manipulation</H3>
|
||||
|
||||
<%
|
||||
'Declare variable.
|
||||
Dim strVar
|
||||
|
||||
'Assign the variable a string value.
|
||||
strVar = "Jemearl"
|
||||
%>
|
||||
|
||||
<P>This example was done by <%= strVar + " Smith" %></P>
|
||||
|
||||
|
||||
<HR>
|
||||
<H3>Boolean Manipulation</H3>
|
||||
|
||||
<%
|
||||
'Declare variable.
|
||||
Dim blnVar
|
||||
|
||||
'Assign the variable a Boolean value.
|
||||
blnVar = true
|
||||
|
||||
'Output message based on value.
|
||||
If (blnVar) Then
|
||||
Response.Write "<P>The Boolean value is True.</P>"
|
||||
Else
|
||||
Response.Write "<P>The Boolean value is False.</P>"
|
||||
End If
|
||||
%>
|
||||
|
||||
<HR>
|
||||
<H3>Date and Time</H3>
|
||||
|
||||
<%
|
||||
'Declare variable.
|
||||
Dim dtmVar
|
||||
|
||||
'Assign the variable a value.
|
||||
dtmVar = #08 / 27 / 97 5:11:42pm#
|
||||
%>
|
||||
|
||||
<P>The date and time is <%= dtmVar %>
|
||||
|
||||
<%
|
||||
'Set the variable to the web server date and time.
|
||||
dtmVar = Now()
|
||||
%>
|
||||
|
||||
<P>The <STRONG>system</strong> date and time is <%= dtmVar %></P>
|
||||
</BODY>
|
||||
</HTML>
|
26
aspclassiccompiler/Backup/AspWebApp/Web.config
Normal file
26
aspclassiccompiler/Backup/AspWebApp/Web.config
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<appSettings/>
|
||||
<connectionStrings/>
|
||||
<system.web>
|
||||
<compilation debug="true">
|
||||
</compilation>
|
||||
<authentication mode="Windows"/>
|
||||
<customErrors mode="Off"/>
|
||||
<httpHandlers>
|
||||
<add verb="*" path="*.asp" validate="false" type="Dlrsoft.Asp.AspHandler, Dlrsoft.Asp"/>
|
||||
</httpHandlers>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<directoryBrowse enabled="true" />
|
||||
<handlers>
|
||||
<remove name="ASPClassic"/>
|
||||
<add name="ASPClassic" verb="*" path="*.asp" type="Dlrsoft.Asp.AspHandler, Dlrsoft.Asp"/>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
34
aspclassiccompiler/Backup/AspWebApp/components/AdRotator.asp
Normal file
34
aspclassiccompiler/Backup/AspWebApp/components/AdRotator.asp
Normal file
|
@ -0,0 +1,34 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Ad Rotator Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Ad Rotator Sample</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
|
||||
<%
|
||||
Dim objAd
|
||||
Set objAd = Server.CreateObject("MSWC.AdRotator")
|
||||
%>
|
||||
|
||||
<%= objAd.GetAdvertisement("adrot.txt") %>
|
||||
<A HREF="AdRotator_VBScript.asp"> Revisit Page </A>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
170
aspclassiccompiler/Backup/AspWebApp/components/BrowserCap.asp
Normal file
170
aspclassiccompiler/Backup/AspWebApp/components/BrowserCap.asp
Normal file
|
@ -0,0 +1,170 @@
|
|||
<% @ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
<% Response.Buffer=TRue %>
|
||||
<% Response.Expires=-1 %>
|
||||
|
||||
<!--METADATA TYPE="Cookie" NAME="BrowsCap" SRC="clientCap.htm"-->
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Using the Browser Capabilities Component</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<H2>Using the Browser Capabilities Component</H2>
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
<%
|
||||
Dim objBrowsCap
|
||||
Set objBrowsCap = Server.CreateObject("MSWC.BrowserType")
|
||||
%>
|
||||
|
||||
<TABLE border>
|
||||
<TR>
|
||||
<TH>Cap Name</TH>
|
||||
<TH>Value</TH>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>browser</TD>
|
||||
<TD> <% = objBrowsCap.browser %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>version</TD>
|
||||
<TD> <% = objBrowsCap.version %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>cookies</TD>
|
||||
<TD> <% = objBrowsCap.cookies %></TD>
|
||||
</TR>
|
||||
|
||||
<TR><TD>javaapplets</TD>
|
||||
<TD><% = objBrowsCap.javaapplets %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>VBScript</TD>
|
||||
<TD><% = objBrowsCap.VBScript %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>JavaScript</TD>
|
||||
<TD><%=objBrowsCap.JavaScript%></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>platform</TD>
|
||||
<TD><% = objBrowsCap.platform %></TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<% If objBrowsCap.browser = "IE" and objBrowsCap.version >4 then %>
|
||||
<TR>
|
||||
<TD COLSPAN=2> <strong>New Feature for IE5 </strong></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>horizontal resolution</TD>
|
||||
<TD><% = objBrowsCap.width %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>vertical resolution</TD>
|
||||
<TD><% = objBrowsCap.height %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>availHeight</TD>
|
||||
<TD><% = objBrowsCap.availHeight %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>availWidth</TD>
|
||||
<TD><% = objBrowsCap.availWidth %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>Buffer Depth</TD>
|
||||
<TD><% = objBrowsCap.bufferDepth %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>Color Depth</TD>
|
||||
<TD><% = objBrowsCap.colorDepth %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>Java enabled ?</TD>
|
||||
<TD><% = objBrowsCap.javaEnabled %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>cpu Class</TD>
|
||||
<TD><% = objBrowsCap.cpuClass %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>system Language</TD>
|
||||
<TD><% = objBrowsCap.systemLanguage %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>user Language</TD>
|
||||
<TD><% = objBrowsCap.userLanguage %></TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD>connectionType (lan, modem, offline)</TD>
|
||||
<TD><% = objBrowsCap.connectionType %></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>Is Java installed ?</TD>
|
||||
<TD><% = objBrowsCap.Java%></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>MSJava version</TD>
|
||||
<TD><% = objBrowsCap.javaVersion%></TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD>Is MSJava version equal to "5,0,3016,0" ?</TD>
|
||||
<TD><% = objBrowsCap.compVersion%></TD>
|
||||
</TR>
|
||||
<% End if %>
|
||||
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
48
aspclassiccompiler/Backup/AspWebApp/components/CDO.Asp
Normal file
48
aspclassiccompiler/Backup/AspWebApp/components/CDO.Asp
Normal file
|
@ -0,0 +1,48 @@
|
|||
<%@ Language = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>CDO Component</TITLE>
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>CDO Component</B></FONT>
|
||||
|
||||
<P>This sample demonstrates how to use the Collaboration
|
||||
Data Objects for NTS Component to send a simple
|
||||
e-mail message.
|
||||
|
||||
<P>To actually send the message, you must have the SMTP
|
||||
Server that comes with the Windows NT Option Pack Installed.
|
||||
|
||||
<%
|
||||
Dim objMyMail
|
||||
Set objMyMail = Server.CreateObject("CDONTS.NewMail")
|
||||
|
||||
'For demonstration purposes, both From and To
|
||||
'properties are set to the same address.
|
||||
|
||||
objMyMail.From = "someone@Microsoft.com"
|
||||
objMyMail.To = "someone@Microsoft.com"
|
||||
|
||||
objMyMail.Subject = "Sample"
|
||||
objMyMail.Body = "I hope you like the sample"
|
||||
|
||||
'Send the message
|
||||
objMyMail.Send
|
||||
%>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,46 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
|
||||
<%
|
||||
'Make sure that the client-browser doesn't cache.
|
||||
|
||||
Response.Expires = 0
|
||||
%>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Content Rotator Sample</TITLE>
|
||||
</HEAD>
|
||||
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Content Rotator Sample</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
<%
|
||||
Dim objContRot
|
||||
Set objContRot = Server.CreateObject("MSWC.ContentRotator")
|
||||
|
||||
'Specify the file that has the content.
|
||||
|
||||
Response.Write(objContRot.ChooseContent("tiprot.txt"))
|
||||
%>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
<A HREF="ContentRotator_VBScript.asp">Refresh (You may have to do this several times)</A>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,15 @@
|
|||
<HTML><HEAD><TITLE>Contents</TITLE><BASE TARGET="TEXT"></HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<TABLE><TR><TD NOWRAP><FONT FACE="ARIAL,HELVETICA" SIZE=2>
|
||||
<OL>
|
||||
Counters Component<BR>
|
||||
<OL>
|
||||
<A HREF="counter1.htm">Counters Component</A><BR>
|
||||
<A HREF="counter2.htm">Get method</A><BR>
|
||||
<A HREF="counter3.htm">Increment method</A><BR>
|
||||
<A HREF="counter4.htm">Remove method</A><BR>
|
||||
<a href="counter5.htm">Set method</a><BR>
|
||||
</OL>
|
||||
</OL>
|
||||
</FONT></TABLE>
|
||||
</BODY></HTML>
|
|
@ -0,0 +1,143 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
|
||||
<title>Counters Component</title>
|
||||
<script language="JavaScript">
|
||||
|
||||
szNavVersion = navigator.appVersion
|
||||
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
if (szNavVersion.indexOf ("4.") >= 0) {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
} else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
}
|
||||
else if (navigator.appName == "Netscape") {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
}
|
||||
else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<meta NAME="DESCRIPTION" CONTENT="Internet Information Server reference information">
|
||||
</head>
|
||||
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000">
|
||||
<font face="Verdana, Arial, Helvetica">
|
||||
|
||||
<h1><a name="_counters_component"></a>Counters Component</h1>
|
||||
|
||||
<p>The Counter component creates a <b>Counters </b>object that can create, store,
|
||||
increment, and retrieve any number of individual counters. </p>
|
||||
|
||||
<p>A counter is a persistent value that contains an integer. You can manipulate a counter
|
||||
with the <b>Get</b>, <b>Increment</b>, <b>Set</b>, and <b>Remove </b>methods of the <b>Counters
|
||||
</b>object. Once you create the counter, it persists until you remove it.</p>
|
||||
|
||||
<p>Counters do not automatically increment on an event like a page hit. You must manually
|
||||
set or increment counters using the <a href="counter5.htm"><b>Set</b></a> and <a
|
||||
href="counter3.htm"><b>Increment</b></a> methods.</p>
|
||||
|
||||
<p>Counters are not limited in scope. Once you create a counter, any page on your site can
|
||||
retrieve or manipulate its value. For example, if you increment and display a counter
|
||||
named <i>hits</i> in a page called Page1.asp, and you increment <i>hits</i> in another
|
||||
page called Page2.asp, both pages will increment the same counter. If you hit Page1.asp,
|
||||
and increment <i>hits</i> to 34, hitting Page2.asp will increment <i>hits</i> to 35. The
|
||||
next time you hit Page1.asp, <i>hits</i> will increment to 36.</p>
|
||||
|
||||
<p>All counters are stored in a single text file, Counters.txt, which is located in the
|
||||
same directory as the Counters<i>.</i>dll file. </p>
|
||||
|
||||
<h2>File Names</h2>
|
||||
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td>Counters.dll</td>
|
||||
<td>The Counters component.</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>Counters.txt</td>
|
||||
<td>The file that stores all individual counters on a site. Counters.txt is a UTF8-encoded
|
||||
file. You can have any Unicode characters in a counter name. </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
<h2>Syntax</h2>
|
||||
|
||||
<p>Create the <b>Counters</b> object one time on your server by adding the following to
|
||||
the Global.asa file:</p>
|
||||
|
||||
<pre><b><OBJECT
|
||||
RUNAT=Server
|
||||
SCOPE=Application
|
||||
ID=Counter
|
||||
PROGID="MSWC.Counters">
|
||||
</OBJECT></b></pre>
|
||||
|
||||
<h2>Registry Entries</h2>
|
||||
|
||||
<p>None.</p>
|
||||
|
||||
<h2>Remarks</h2>
|
||||
|
||||
<p>Only create one <b>Counters </b>object in your site. This single <b>Counters </b>object
|
||||
can create any number of individual counters. </p>
|
||||
|
||||
<p><b>Note</b> For Personal Web Server on Windows 95, a Counters component has already
|
||||
been specified in the Global.asa file in the default virtual directory. You can work with
|
||||
the <b>Counters </b>object the component creates as if it were a built-in object by
|
||||
calling <b>Counters.Get</b>, <b>Counters.Increment</b>, <b>Counters.Remove</b>, and <b>Counters.Set</b>. You should not create another instance of the <b>Counters </b>object. </p>
|
||||
|
||||
<h2>Methods </h2>
|
||||
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td><a href="counter2.htm"><b>Get</b></a> </td>
|
||||
<td>Returns the value of the counter. </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><a href="counter3.htm"><b>Increment</b></a> </td>
|
||||
<td>Increases the counter by 1.</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><a href="counter4.htm"><b>Remove</b></a> </td>
|
||||
<td>Removes the counter from the Counters.txt file. </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><a href="counter5.htm"><b>Set</b></a> </td>
|
||||
<td>Sets the value of the counter to a specific integer. </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><br>
|
||||
</p>
|
||||
|
||||
<h2>Example</h2>
|
||||
|
||||
<p>Create an instance of the <b>Counters </b>object in the Global.asa file with the ID
|
||||
attribute set to <code>Counter</code>: </p>
|
||||
|
||||
<pre><OBJECT RUNAT=Server SCOPE=Application ID=Counter PROGID="MSWC.Counters"> </OBJECT>
|
||||
</pre>
|
||||
|
||||
<p>You can then use that <b>Counters </b>object on one page to create all the counters you
|
||||
need:</p>
|
||||
|
||||
<pre>There have been <%= Counter.Increment('defaultPageHits') %> to this site.
|
||||
</pre>
|
||||
|
||||
<p>Then on another page you can increment the counter in the following manner:</p>
|
||||
|
||||
<pre>You are visitor number<%= Counter.Increment('LinksPageHits') %> to this page.
|
||||
</pre>
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
|
||||
<title>Get</title>
|
||||
<script language="JavaScript">
|
||||
|
||||
szNavVersion = navigator.appVersion
|
||||
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
if (szNavVersion.indexOf ("4.") >= 0) {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
} else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
}
|
||||
else if (navigator.appName == "Netscape") {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
}
|
||||
else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<meta NAME="DESCRIPTION" CONTENT="Internet Information Server reference information">
|
||||
</head>
|
||||
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000">
|
||||
<font face="Verdana, Arial, Helvetica">
|
||||
|
||||
<h1><a name="_get"></a>Get</h1>
|
||||
|
||||
<p>The <b>Get </b>method takes the name of a counter and returns the current value of the
|
||||
counter. If the counter doesn't exist, the method creates it and sets it to 0.</p>
|
||||
|
||||
<h2>Syntax</h2>
|
||||
|
||||
<pre><b>Counters.Get</b>(<i>CounterName</i>)
|
||||
</pre>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<dl>
|
||||
<dt><i>CounterName</i></dt>
|
||||
<dd>A string containing the name of the counter.</dd>
|
||||
</dl>
|
||||
|
||||
<h2>Example</h2>
|
||||
|
||||
<p>Display the value a counter with <code><%= Counters.Get(<i>CounterName</i>) %></code>.
|
||||
Assign the value of the counter to a variable with <code><% countervar = Counters.Get(<i>CounterName</i>)
|
||||
%></code>. </p>
|
||||
|
||||
<p>The following script displays the vote tally from a poll about favorite colors. </p>
|
||||
|
||||
<pre><% If colornumber = "1" Then
|
||||
Counters.Increment("greencounter")
|
||||
Else
|
||||
If colornumber = "2" Then
|
||||
Counters.Increment("bluecounter")
|
||||
Else
|
||||
If colornumber = "0" Then
|
||||
Counters.Increment("redcounter")
|
||||
End If
|
||||
End If
|
||||
End If %>
|
||||
<P>Current vote tally:
|
||||
<P>red: <% =Counters.Get("redcounter") %>
|
||||
<P>green: <% = Counters.Get("greencounter") %>
|
||||
<P>blue: <% = Counters.Get("bluecounter") %>
|
||||
</pre>
|
||||
|
||||
<h2>Applies To</h2>
|
||||
|
||||
<p>Counters component</p>
|
||||
|
||||
<h2>See Also</h2>
|
||||
|
||||
<p><a href="counter3.htm"><b>Increment</b></a>, <a href="counter4.htm"><b>Remove</b></a>, <a
|
||||
href="counter5.htm"><b>Set</b></a> </p>
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
|
||||
<title>Increment</title>
|
||||
<script language="JavaScript">
|
||||
|
||||
szNavVersion = navigator.appVersion
|
||||
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
if (szNavVersion.indexOf ("4.") >= 0) {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
} else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
}
|
||||
else if (navigator.appName == "Netscape") {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
}
|
||||
else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<meta NAME="DESCRIPTION" CONTENT="Internet Information Server reference information">
|
||||
</head>
|
||||
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000">
|
||||
<font face="Verdana, Arial, Helvetica">
|
||||
|
||||
<h1><a name="_increment"></a>Increment</h1>
|
||||
|
||||
<p>The <b>Increment</b> method takes the name of a counter, adds 1 to the current value of
|
||||
the counter, and returns the counter's new value. If the counter doesn't exist, the method
|
||||
creates it and sets its value to 1.</p>
|
||||
|
||||
<h2>Syntax</h2>
|
||||
|
||||
<pre><b>Counters.Increment</b>(<i>CounterName</i>)
|
||||
</pre>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<dl>
|
||||
<dt><i>CounterName</i></dt>
|
||||
<dd>A string containing the name of the counter.</dd>
|
||||
</dl>
|
||||
|
||||
<h2>Example</h2>
|
||||
|
||||
<p>Increment the value of a counter with <code><% Counters.Increment(<i>CounterName</i>)
|
||||
%></code>. Increment and display the value of a counter with <code><%=
|
||||
Counters.Increment(<i>CounterName</i>) %></code>. </p>
|
||||
|
||||
<p>To retrieve the value of a counter, use <b>Counters.Get</b>. To set a counter to a
|
||||
specific value, use <b>Counters.Set</b>. </p>
|
||||
|
||||
<p>The following code implements a one-line page-hit counter. </p>
|
||||
|
||||
<pre><P>There have been <%= Counters.Increment("hits") %> visits to this Web page. </P>
|
||||
</pre>
|
||||
|
||||
<p>In this example, <b>Counters.Increment </b>increases the counter by one each time the
|
||||
client requests the page from the server. </p>
|
||||
|
||||
<h2>Applies To</h2>
|
||||
|
||||
<p>Counters component</p>
|
||||
|
||||
<h2>See Also</h2>
|
||||
|
||||
<p><a href="counter2.htm"><b>Get</b></a>, <a href="counter4.htm"><b>Remove</b></a>, <a
|
||||
href="counter5.htm"><b>Set</b></a> </p>
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
|
||||
<title>Remove</title>
|
||||
<script language="JavaScript">
|
||||
|
||||
szNavVersion = navigator.appVersion
|
||||
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
if (szNavVersion.indexOf ("4.") >= 0) {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
} else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
}
|
||||
else if (navigator.appName == "Netscape") {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
}
|
||||
else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<meta NAME="DESCRIPTION" CONTENT="Internet Information Server reference information">
|
||||
</head>
|
||||
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000">
|
||||
<font face="Verdana, Arial, Helvetica">
|
||||
|
||||
<h1><a name="_remove"></a>Remove</h1>
|
||||
|
||||
<p>The <b>Remove </b>method takes the name of a counter, removes the counter from the
|
||||
Counters object, and deletes the counter from the Counters.txt file.</p>
|
||||
|
||||
<h2>Syntax</h2>
|
||||
|
||||
<pre><b>Counters.Remove(</b><i>CounterName</i><b>)
|
||||
</b></pre>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<dl>
|
||||
<dt><i>CounterName</i></dt>
|
||||
<dd>A string containing the name of the counter.</dd>
|
||||
</dl>
|
||||
|
||||
<h2>Example</h2>
|
||||
|
||||
<p>The following code removes the counter <code>hitscounter </code>from the Counters.txt
|
||||
file. </p>
|
||||
|
||||
<pre><% Counters.Remove(hitscounter) %>
|
||||
</pre>
|
||||
|
||||
<h2>Applies To</h2>
|
||||
|
||||
<p>Counters component</p>
|
||||
|
||||
<h2>See Also</h2>
|
||||
|
||||
<p><a href="counter2.htm"><b>Get</b></a>, <a href="counter3.htm"><b>Increment</b></a>, <a
|
||||
href="counter5.htm"><b>Set</b></a> </p>
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
|
||||
<title>Set</title>
|
||||
<script language="JavaScript">
|
||||
|
||||
szNavVersion = navigator.appVersion
|
||||
|
||||
if (navigator.appName == "Microsoft Internet Explorer") {
|
||||
if (szNavVersion.indexOf ("4.") >= 0) {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
} else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
}
|
||||
else if (navigator.appName == "Netscape") {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
|
||||
}
|
||||
else {
|
||||
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<meta NAME="DESCRIPTION" CONTENT="Internet Information Server reference information">
|
||||
</head>
|
||||
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000">
|
||||
<font face="Verdana, Arial, Helvetica">
|
||||
|
||||
<h1><a name="_set"></a>Set</h1>
|
||||
|
||||
<p>The <b>Set </b>method takes the name of a counter and an integer, sets the counter to
|
||||
the value of the integer, and returns the new value. If the counter doesn't exist, <b>Counters.Set
|
||||
</b>creates it and sets it to the value of the integer.</p>
|
||||
|
||||
<p>To retrieve the value of a counter, use <b>Counters.Get</b>. To increment a counter by
|
||||
1, use <b>Counters.Increment</b>. </p>
|
||||
|
||||
<h2>Syntax</h2>
|
||||
|
||||
<pre><b>Counters.Set</b>(<i>CounterName</i>, <i>int</i>)
|
||||
</pre>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<dl>
|
||||
<dt><i>CounterName</i></dt>
|
||||
<dd>A string containing the name of the counter.<br>
|
||||
</dd>
|
||||
<dt><i>int</i></dt>
|
||||
<dd>The new integer value for <i>CounterName</i>.</dd>
|
||||
</dl>
|
||||
|
||||
<h2>Example</h2>
|
||||
|
||||
<p>The following code resets the hit counter <code>pageHits </code>to 0: </p>
|
||||
|
||||
<pre><% Counters.Set(pageHits, 0) %>
|
||||
</pre>
|
||||
|
||||
<h2>Applies To</h2>
|
||||
|
||||
<p>Counter component</p>
|
||||
|
||||
<h2>See Also</h2>
|
||||
|
||||
<p><a href="counter2.htm"><b>Get</b></a>, <a href="counter3.htm"><b>Increment</b></a>, <a
|
||||
href="counter4.htm"><b>Remove</b></a> </p>
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Counters Component</title>
|
||||
</head>
|
||||
|
||||
<frameset FRAMEBORDER="1" FRAMESPACING="1" cols="320,*">
|
||||
<frame SRC="contents.htm" name="TOC" scrolling="auto" target="TEXT">
|
||||
<frame SRC="counter1.htm" name="TEXT" scrolling="auto">
|
||||
<noframes>
|
||||
<body>
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<%@ LANGUAGE="JSCRIPT" %>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
|
||||
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<TITLE>Document Title</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<h2>Demo of the Counters ASP Component</h2>
|
||||
|
||||
<%
|
||||
|
||||
var ObjCounter;
|
||||
var nCount;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
ObjCounter = Application("MSCounters");
|
||||
nCount = ObjCounter.Increment("NoOfHits") ;
|
||||
}
|
||||
catch (err)
|
||||
{
|
||||
Response.Write ("<P>Error: Could not get the instance of the Counters Object.<br> Error Code:" + err.errCode );
|
||||
Response.End();
|
||||
}
|
||||
Response.Write ("<h4><P>There have been <font color=RED>"+ nCount + "</font> visits to this Web page. Refresh this page to increment <br>the counter.</h4>");
|
||||
|
||||
%>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,31 @@
|
|||
<%@ LANGUAGE="VBSCRIPT" %>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
|
||||
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<TITLE>Document Title</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<h2>Demo of the Counters ASP Component</h2>
|
||||
|
||||
<%
|
||||
On Error Resume Next
|
||||
|
||||
Dim ObjCounter
|
||||
Dim nCount
|
||||
|
||||
|
||||
Set ObjCounter = Application("MSCounters")
|
||||
nCount = ObjCounter.Increment("NoOfHits")
|
||||
|
||||
|
||||
If (Err <> 0) then
|
||||
Response.Write ("<P>Error: Could not get the instance of the Counters Object.<br> Error Code:" + CStr(nErr) )
|
||||
Else
|
||||
Response.Write ("<h4><P>There have been <font color=RED>"+ CStr(nCount) + "</font> visits to this Web page. Refresh this page to increment <br>the counter.</h4>")
|
||||
End If
|
||||
%>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,41 @@
|
|||
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
|
||||
Option Explicit
|
||||
|
||||
Sub Application_OnStart
|
||||
On Error Resume Next
|
||||
Dim ObjCounter
|
||||
Dim strCounter
|
||||
|
||||
strCounter = "NoOfHits"
|
||||
Application("CounterName") = strCounter
|
||||
|
||||
Set ObjCounter = Server.CreateObject("MSWC.Counters")
|
||||
If (Err <> 0) Then
|
||||
Application("IsErr" ) = Err.Number
|
||||
Else
|
||||
Call ObjCounter.Set(strCounter, 1 )
|
||||
Set Application("MSCounters") = ObjCounter
|
||||
Application("IsErr") = 0
|
||||
End If
|
||||
|
||||
Err.Clear
|
||||
End Sub
|
||||
|
||||
|
||||
Sub Application_OnEnd
|
||||
On Error Resume Next
|
||||
Application("IsErr") = Nothing
|
||||
Application("MSCounters") = Nothing
|
||||
End Sub
|
||||
|
||||
|
||||
Sub Session_OnStart
|
||||
Err = 0
|
||||
End Sub
|
||||
|
||||
|
||||
Sub Session_OnEnd
|
||||
Err = 0
|
||||
End Sub
|
||||
|
||||
</SCRIPT>
|
|
@ -0,0 +1,2 @@
|
|||
<meta http-equiv="Refresh"
|
||||
content="0; URL=http://localhost/Counters/Counters.asp">
|
|
@ -0,0 +1,68 @@
|
|||
<%@ Language = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<%
|
||||
'Define constants.
|
||||
|
||||
Const FORREADING = 1
|
||||
Const FORWRITING = 2
|
||||
Const FORAPPENDING = 8
|
||||
%>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>FileSystem Component</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>FileSystem Component</B></FONT><BR>
|
||||
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
|
||||
<%
|
||||
Dim curDir
|
||||
Dim objScriptObject, objMyFile
|
||||
Dim x
|
||||
|
||||
'Map current path to physical path.
|
||||
|
||||
curDir = Server.MapPath("/components")
|
||||
|
||||
|
||||
'Create FileSytemObject component.
|
||||
|
||||
Set objScriptObject = Server.CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
|
||||
'Create and write to a file.
|
||||
|
||||
Set objMyFile = objScriptObject.CreateTextFile(curDir + "\" + "MyTextFile.txt", FORWRITING)
|
||||
|
||||
For x = 1 to 5
|
||||
objMyFile.WriteLine "Line number " & x & " was written on " & now & "<br>"
|
||||
Next
|
||||
|
||||
objMyfile.Close
|
||||
%>
|
||||
|
||||
<%
|
||||
'Read from file and output to screen.
|
||||
Set objMyFile = objScriptObject.OpenTextFile(curDir + "\" + "MyTextFile.txt", FORREADING)
|
||||
Response.Write objMyFile.ReadAll
|
||||
%>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -0,0 +1,38 @@
|
|||
<%@ Language = VBScript%>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Permission Checker</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Permission Checker</B></FONT><BR>
|
||||
|
||||
<%
|
||||
'Instantiate Permission Checker Component.
|
||||
|
||||
Dim objPermCheck
|
||||
Set objPermCheck = Server.CreateObject("MSWC.PermissionChecker")
|
||||
%>
|
||||
|
||||
<P>Verify current user's access to a sample file:
|
||||
|
||||
<P>Using Physical Path =
|
||||
<%= objPermCheck.HasAccess(".\PermissionCheck_VBScript.asp") %> <BR>
|
||||
|
||||
<P>Using Virtual Path =
|
||||
<%= objPermCheck.HasAccess("/iissamples/sdk/asp/components/PermissionCheck_VBScript.asp") %>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
12
aspclassiccompiler/Backup/AspWebApp/components/Tiprot.Txt
Normal file
12
aspclassiccompiler/Backup/AspWebApp/components/Tiprot.Txt
Normal file
|
@ -0,0 +1,12 @@
|
|||
%% #1
|
||||
Don't run with scissors.
|
||||
|
||||
%% #1
|
||||
%% // Additional line of comments
|
||||
%% // Yet another line of comments
|
||||
<FONT FACE="ARIAL,HELVETICA" SIZE="2">
|
||||
Let a <h1>smile</h1> be your umbrella.
|
||||
</FONT>
|
||||
|
||||
%% #1
|
||||
<IMG SRC="nts_iis.gif">
|
96
aspclassiccompiler/Backup/AspWebApp/components/Tools.Asp
Normal file
96
aspclassiccompiler/Backup/AspWebApp/components/Tools.Asp
Normal file
|
@ -0,0 +1,96 @@
|
|||
<%@ LANGUAGE = VBScript %>
|
||||
<% Option Explicit %>
|
||||
|
||||
<!*************************
|
||||
This sample is provided for educational purposes only. It is not intended to be
|
||||
used in a production environment, has not been tested in a production environment,
|
||||
and Microsoft will not provide technical support for it.
|
||||
*************************>
|
||||
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Tools Component</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
|
||||
|
||||
|
||||
<!-- Display header. -->
|
||||
|
||||
<FONT SIZE="4" FACE="ARIAL, HELVETICA">
|
||||
<B>Tools Component</B></FONT><BR>
|
||||
<HR SIZE="1" COLOR="#000000">
|
||||
|
||||
<%
|
||||
Dim objTools
|
||||
Dim FoundFile, blnFileExists, blnFileDoesNotExist, NotFoundFile
|
||||
Dim intRand, intRandPos, intRandBelow
|
||||
|
||||
'Create the Tools Object
|
||||
|
||||
Set objTools = Server.CreateObject("MSWC.Tools")
|
||||
%>
|
||||
|
||||
|
||||
<H3> FileExists Example </H3>
|
||||
<%
|
||||
FoundFile = "Tools_VBScript.asp"
|
||||
NotFoundFile = "blah.asp"
|
||||
|
||||
'Check if file exists.
|
||||
|
||||
blnFileExists = objTools.FileExists(FoundFile)
|
||||
|
||||
|
||||
'Output response appropriately.
|
||||
|
||||
If (blnFileExists) Then
|
||||
Response.Write "The File " & FoundFile & " Exists<BR>"
|
||||
Else
|
||||
Response.Write "The File " & FoundFile & " Does Not Exist<BR>"
|
||||
End If
|
||||
|
||||
|
||||
'Check if file exists.
|
||||
|
||||
blnFileDoesNotExist = objTools.FileExists(NotFoundFile)
|
||||
|
||||
|
||||
'Output response appropriately.
|
||||
|
||||
If (blnFileDoesNotExist) Then
|
||||
Response.Write "The File " & NotFoundFile & " Exists"
|
||||
Else
|
||||
Response.write "The File " & NotFoundFile & " Does Not Exist"
|
||||
End If
|
||||
%>
|
||||
|
||||
|
||||
<H3> Random Integer Example </H3>
|
||||
<%
|
||||
'Random integer.
|
||||
|
||||
intRand = objTools.Random
|
||||
Response.Write "Random integer: "
|
||||
Response.Write intRand
|
||||
Response.Write "<BR>"
|
||||
|
||||
|
||||
'Positive random integer.
|
||||
|
||||
intRandPos = Abs( objTools.Random )
|
||||
Response.Write "Positive random integer: "
|
||||
Response.Write intRandPos
|
||||
Response.Write "<BR>"
|
||||
|
||||
|
||||
'Positive random integer between 0 and 100.
|
||||
|
||||
intRandBelow = Abs( objTools.Random ) Mod 100
|
||||
Response.write "Random integer below 100: "
|
||||
Response.write intRandBelow
|
||||
Response.write "<BR>"
|
||||
%>
|
||||
</BODY>
|
||||
</HTML>
|
14
aspclassiccompiler/Backup/AspWebApp/components/adrot.txt
Normal file
14
aspclassiccompiler/Backup/AspWebApp/components/adrot.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
Redirect www.microsoft.com
|
||||
width 88
|
||||
height 31
|
||||
border 1
|
||||
*
|
||||
nts_iis.gif
|
||||
http://www.microsoft.com/ntserver/web/default.asp
|
||||
Microsoft Internet Information Services
|
||||
80
|
||||
ie.gif
|
||||
-
|
||||
Microsoft Internet Explorer
|
||||
20
|
||||
|
74
aspclassiccompiler/Backup/AspWebApp/components/clientcap.htm
Normal file
74
aspclassiccompiler/Backup/AspWebApp/components/clientcap.htm
Normal file
|
@ -0,0 +1,74 @@
|
|||
<HTML xmlns:MSIE="http://www.microsoft.com/ie">
|
||||
<HEAD>
|
||||
|
||||
<STYLE>
|
||||
@media all
|
||||
{
|
||||
MSIE\:CLIENTCAPS {behavior:url(#default#clientcaps)}
|
||||
}
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY onload="GetBrowsCap()">
|
||||
<MSIE:CLIENTCAPS ID="idClCap" />
|
||||
|
||||
<SCRIPT language="JavaScript">
|
||||
<!--
|
||||
function GetBrowsCap()
|
||||
{
|
||||
//The Width is the horizontal resolution of the screen, in pixels. The number should match the first number in the screen //resolution that you have set in your display settings. For example, if your screen resolution is 1152 x 864, the number //returned should be 1152.
|
||||
bcString = "width=" + idClCap.width;
|
||||
|
||||
//The Height is the vertical resolution of the screen, in pixels. The number should match the second number in the screen //resolution that you have set in your display settings. For example, if your screen resolution is 1152 x 864, the number //returned should be 864.
|
||||
bcString += "&height=" + idClCap.height;
|
||||
|
||||
//The available height is the height of the working area of the system's screen, in pixels, excluding the taskbar.
|
||||
bcString += "&availHeight=" + idClCap.availHeight;
|
||||
|
||||
//The available width is the width of the working area of the system's screen, in pixels, excluding the taskbar.
|
||||
bcString += "&availWidth=" + idClCap.availWidth;
|
||||
|
||||
//The Buffer Depth is the number of bits per pixel used for colors on the off-screen bitmap buffer.
|
||||
bcString += "&bufferDepth=" + idClCap.bufferDepth;
|
||||
|
||||
//The Color Depth is the number of bits per pixel used for colors on the destination device or buffer. The number should //match what you set in your Display settings, for example if you set your display to 16 bit, the number returned should be //16.
|
||||
bcString += "&colorDepth=" + idClCap.colorDepth;
|
||||
|
||||
//Java Enabled specifies whether Java is enabled or disabled in the browser.
|
||||
bcString += "&javaEnabled=" + idClCap.javaEnabled;
|
||||
|
||||
//CPU Class specifies the type of CPU of the client computer.
|
||||
bcString += "&cpuClass=" + idClCap.cpuClass;
|
||||
|
||||
//The System Language is the language that the system is running. For example if you are running the English version of //Windows 95, then the value returned should be english.
|
||||
bcString += "&systemLanguage="+ idClCap.systemLanguage;
|
||||
|
||||
//The User Language is the language that the current user is running. For example, if you have your language settings set to //English, then the value returned is En.
|
||||
bcString += "&userLanguage=" + idClCap.userLanguage;
|
||||
|
||||
//Platform specifies the platform on which the browser is running.
|
||||
bcString += "&platform=" + idClCap.platform;
|
||||
|
||||
//Connection Type specifies the type of internet connection currently in use.
|
||||
bcString += "&connectionType=" + idClCap.connectionType;
|
||||
|
||||
//This will query the client machine to find out if the JavaVM is installed or not.
|
||||
bcString += "&Java=" + idClCap.isComponentInstalled("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}","ComponentID");
|
||||
|
||||
|
||||
//get the version for java
|
||||
var java_version;
|
||||
var comp_version;
|
||||
java_version = idClCap.getComponentVersion("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}", "componentid");
|
||||
|
||||
//This will compare the version number of Java installed on the machine to the given version number.
|
||||
comp_version=idClCap.compareVersions(java_version,"5,0,3016,0");
|
||||
bcString += "&javaVersion=" + java_version;
|
||||
bcString += "&compVersion=" + (comp_version == 0 ? "True" : "False");
|
||||
|
||||
document.cookie = "BrowsCap=" + bcString;
|
||||
}
|
||||
-->
|
||||
</SCRIPT>
|
||||
</BODY></HTML>
|
||||
|
BIN
aspclassiccompiler/Backup/AspWebApp/components/ie.gif
Normal file
BIN
aspclassiccompiler/Backup/AspWebApp/components/ie.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
BIN
aspclassiccompiler/Backup/AspWebApp/components/nts_iis.gif
Normal file
BIN
aspclassiccompiler/Backup/AspWebApp/components/nts_iis.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
48
aspclassiccompiler/Backup/AspWebApp/default.htm
Normal file
48
aspclassiccompiler/Backup/AspWebApp/default.htm
Normal file
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<p>This project contains some ASP Classic Compiler Samples Pages</p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Folder</td>
|
||||
<td>File</td>
|
||||
<td>Comments</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="/components">Components</a></td>
|
||||
<td></td>
|
||||
<td>IIS 5 Platform SDK Sample. Need to install the COM components. Components like
|
||||
BrowserCap will not work because it requires the COM+ comtext to accesses the
|
||||
Request object. </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><a href="/components/FileSystem.asp">FileSystem.asp</a></td>
|
||||
<td>Works without registering any component. Need to grant ASP worker process account read/write access to the directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><a href="/components/Tools.asp">Tools.asp</a></td>
|
||||
<td>Tested in Windows XP. Failed to register the component in Vista.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="/Database">Database</a></td>
|
||||
<td></td>
|
||||
<td>IIS 5 Platform SDK Sample. Some the Access samples tested. Make sure that the OLEDB provider is installed. Need read/write access to the access.mdb in the directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="/Simple">Simple</a></td>
|
||||
<td></td>
|
||||
<td>IIS 5 Platform SDK Sample. All the samples tested.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="/test">test</a></td>
|
||||
<td></td>
|
||||
<td>Some small samples used during development.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<%=vbSunday %><BR/>
|
||||
<%=vbMonday %><BR/>
|
||||
<%=vbTuesday %><BR/>
|
||||
<%=vbWednesday %><BR/>
|
||||
<%=vbThursday %><BR/>
|
||||
<%=vbFriday %><BR/>
|
||||
<%=vbSaturday %><BR/>
|
||||
</body>
|
||||
</html>
|
15
aspclassiccompiler/Backup/AspWebApp/test/byref.asp
Normal file
15
aspclassiccompiler/Backup/AspWebApp/test/byref.asp
Normal file
|
@ -0,0 +1,15 @@
|
|||
<%
|
||||
sub main()
|
||||
dim a
|
||||
a = 2
|
||||
mysub a
|
||||
response.Write a
|
||||
end sub
|
||||
|
||||
sub mysub(a)
|
||||
a = a + 1
|
||||
response.Write a
|
||||
end sub
|
||||
|
||||
main
|
||||
%>
|
8
aspclassiccompiler/Backup/AspWebApp/test/byref2.asp
Normal file
8
aspclassiccompiler/Backup/AspWebApp/test/byref2.asp
Normal file
|
@ -0,0 +1,8 @@
|
|||
<%
|
||||
sub mysub(byval a)
|
||||
a = a + 1
|
||||
response.Write a
|
||||
end sub
|
||||
|
||||
mysub 5
|
||||
%>
|
12
aspclassiccompiler/Backup/AspWebApp/test/call.asp
Normal file
12
aspclassiccompiler/Backup/AspWebApp/test/call.asp
Normal file
|
@ -0,0 +1,12 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
Response.Write("Something")
|
||||
Response.Write(1)
|
||||
Response.Write " MORE"
|
||||
Call Response.Write(" CALL ")
|
||||
%>
|
||||
</body>
|
||||
</html>
|
11
aspclassiccompiler/Backup/AspWebApp/test/datatypes.asp
Normal file
11
aspclassiccompiler/Backup/AspWebApp/test/datatypes.asp
Normal file
|
@ -0,0 +1,11 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
Vartype of 123456 is <%=VarType(123456) %><BR/>
|
||||
Vartype of .23456 is <%=VarType(.23456) %><BR/>
|
||||
VarType of <%=Server.HtmlEncode("&hFFFFFF")%> is <%=VarType(&hFFFFFF) %><BR/>
|
||||
VarType of 1.23e-3 is <%=VarType(1.23e-3)%><BR/>
|
||||
VarType of #12/21/1999# is <%=VarType(#12/21/1999#)%><BR/>
|
||||
</body>
|
||||
</html>
|
25
aspclassiccompiler/Backup/AspWebApp/test/datetest.asp
Normal file
25
aspclassiccompiler/Backup/AspWebApp/test/datetest.asp
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" >
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<%= WeekdayName(Weekday(DateSerial(1963, 11, 22))) %>
|
||||
<%= WeekdayName(Weekday(DateSerial(1963, 10, 15))) %>
|
||||
<%= WeekdayName(Weekday(DateSerial(1995, 6, 2))) %>
|
||||
<%= WeekdayName(Weekday(DateSerial(1997, 5, 5))) %>
|
||||
<%
|
||||
setlocale(4100)
|
||||
for i = 1 to 7
|
||||
Response.Write(weekdayname(i) & "<BR/>")
|
||||
next
|
||||
%>
|
||||
<%
|
||||
for i = 1 to 12
|
||||
Response.Write(monthname(i) & "<BR/>")
|
||||
next
|
||||
%>
|
||||
<%=FormatDateTime(DateSerial(1997, 5, 5), 1) %>
|
||||
<%=FormatCurrency(10000000) %>
|
||||
</body>
|
||||
</html>
|
6
aspclassiccompiler/Backup/AspWebApp/test/extension.asp
Normal file
6
aspclassiccompiler/Backup/AspWebApp/test/extension.asp
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%
|
||||
option explicit
|
||||
dim s
|
||||
s = "111-222-3333"
|
||||
response.Write s.RemoveNonNumeric()
|
||||
%>
|
17
aspclassiccompiler/Backup/AspWebApp/test/forloop.asp
Normal file
17
aspclassiccompiler/Backup/AspWebApp/test/forloop.asp
Normal file
|
@ -0,0 +1,17 @@
|
|||
<%
|
||||
option explicit
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
dim i
|
||||
for i = 1 to 8
|
||||
response.write i
|
||||
next
|
||||
|
||||
response.write i
|
||||
%>
|
||||
</body>
|
||||
</html>
|
24
aspclassiccompiler/Backup/AspWebApp/test/function.asp
Normal file
24
aspclassiccompiler/Backup/AspWebApp/test/function.asp
Normal file
|
@ -0,0 +1,24 @@
|
|||
<%
|
||||
option explicit
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
sub printnum(n)
|
||||
response.write n
|
||||
for i = 1 to n
|
||||
response.write i
|
||||
next
|
||||
end sub
|
||||
|
||||
dim i
|
||||
|
||||
printnum 5
|
||||
|
||||
|
||||
|
||||
%>
|
||||
</body>
|
||||
</html>
|
24
aspclassiccompiler/Backup/AspWebApp/test/if.asp
Normal file
24
aspclassiccompiler/Backup/AspWebApp/test/if.asp
Normal file
|
@ -0,0 +1,24 @@
|
|||
<%
|
||||
option explicit
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
dim i, color
|
||||
|
||||
i = 3
|
||||
if i = 1 then
|
||||
color = "red"
|
||||
elseif i = 2 then
|
||||
color = "green"
|
||||
elseif i = 3 then
|
||||
color = "blue"
|
||||
else
|
||||
color = "blank"
|
||||
end if
|
||||
response.write color
|
||||
%>
|
||||
</body>
|
||||
</html>
|
10
aspclassiccompiler/Backup/AspWebApp/test/ifnull.asp
Normal file
10
aspclassiccompiler/Backup/AspWebApp/test/ifnull.asp
Normal file
|
@ -0,0 +1,10 @@
|
|||
<%
|
||||
option explicit
|
||||
Dim oConn
|
||||
Dim oRs
|
||||
oRs = "something"
|
||||
If oRs.EOF Then
|
||||
End If
|
||||
|
||||
|
||||
%>
|
12
aspclassiccompiler/Backup/AspWebApp/test/imports.asp
Normal file
12
aspclassiccompiler/Backup/AspWebApp/test/imports.asp
Normal file
|
@ -0,0 +1,12 @@
|
|||
<%
|
||||
imports system
|
||||
|
||||
dim sb
|
||||
|
||||
sb = new System.Text.StringBuilder()
|
||||
sb.append("this")
|
||||
sb.append(" is ")
|
||||
sb.append(" stringbuilder!")
|
||||
response.write sb.toString()
|
||||
|
||||
%>
|
12
aspclassiccompiler/Backup/AspWebApp/test/literals.asp
Normal file
12
aspclassiccompiler/Backup/AspWebApp/test/literals.asp
Normal file
|
@ -0,0 +1,12 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
Integer <%=123456 %><BR/>
|
||||
Floating Point <%=.23456 %><BR/>
|
||||
Hex <%=&hFFFFFF%><BR/>
|
||||
Oct <%=&123456& %><BR/>
|
||||
Exponent <%=1.23e-3%><BR/>
|
||||
Date <%=#12/21/1999#%><BR/>
|
||||
</body>
|
||||
</html>
|
20
aspclassiccompiler/Backup/AspWebApp/test/perftest.asp
Normal file
20
aspclassiccompiler/Backup/AspWebApp/test/perftest.asp
Normal file
|
@ -0,0 +1,20 @@
|
|||
<%
|
||||
option explicit
|
||||
|
||||
dim loops
|
||||
dim counter
|
||||
dim tickes
|
||||
|
||||
tickes = Timer()
|
||||
loops = 10000000
|
||||
counter = 0.0
|
||||
|
||||
while loops > 0
|
||||
loops = loops - 1
|
||||
counter = counter + 1.0
|
||||
wend
|
||||
|
||||
Response.Write("DoLoop result " & counter & "<BR/>")
|
||||
Response.Write("Executing the while loop took: " & ((Timer()-tickes) * 1000.0) & "ms" & "<BR/>")
|
||||
|
||||
%>
|
24
aspclassiccompiler/Backup/AspWebApp/test/perftest2.asp
Normal file
24
aspclassiccompiler/Backup/AspWebApp/test/perftest2.asp
Normal file
|
@ -0,0 +1,24 @@
|
|||
<%
|
||||
option explicit
|
||||
|
||||
perftest
|
||||
|
||||
sub perftest()
|
||||
dim loops
|
||||
dim counter
|
||||
dim tickes
|
||||
tickes = Timer()
|
||||
|
||||
loops = 10000000
|
||||
counter = 0.0
|
||||
|
||||
while loops > 0
|
||||
loops = loops - 1
|
||||
counter = counter + 1.0
|
||||
wend
|
||||
|
||||
Response.Write("DoLoop result " & counter & "<BR/>")
|
||||
Response.Write("Executing the while loop took: " & ((Timer()-tickes) * 1000.0) & "ms" & "<BR/>")
|
||||
end sub
|
||||
|
||||
%>
|
14
aspclassiccompiler/Backup/AspWebApp/test/servervars.asp
Normal file
14
aspclassiccompiler/Backup/AspWebApp/test/servervars.asp
Normal file
|
@ -0,0 +1,14 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
url = Request.ServerVariables("HTTP_URL")
|
||||
x = instr(1, url, "url=", 1)
|
||||
if x > 0 then
|
||||
url = Mid(url, x + 4)
|
||||
end if
|
||||
%>
|
||||
<%=url%>
|
||||
</body>
|
||||
</html>
|
15
aspclassiccompiler/Backup/AspWebApp/test/with.asp
Normal file
15
aspclassiccompiler/Backup/AspWebApp/test/with.asp
Normal file
|
@ -0,0 +1,15 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<% with response %>
|
||||
<%.Write vbSunday %><BR/>
|
||||
<%.Write vbMonday %><BR/>
|
||||
<%.Write vbTuesday %><BR/>
|
||||
<%.Write vbWednesday %><BR/>
|
||||
<%.Write vbThursday %><BR/>
|
||||
<%.Write vbFriday %><BR/>
|
||||
<%.Write vbSaturday %><BR/>
|
||||
<% end with %>
|
||||
</body>
|
||||
</html>
|
378
aspclassiccompiler/Backup/NerdDinnerAsp/Content/Site.css
Normal file
378
aspclassiccompiler/Backup/NerdDinnerAsp/Content/Site.css
Normal file
|
@ -0,0 +1,378 @@
|
|||
/*----------------------------------------------------------
|
||||
The base color for this template is #5c87b2. If you'd like
|
||||
to use a different color start by replacing all instances of
|
||||
#5c87b2 with your new color.
|
||||
----------------------------------------------------------*/
|
||||
body
|
||||
{
|
||||
background-color: #5c87b2;
|
||||
font-size: .75em;
|
||||
font-family: Verdana, Helvetica, Sans-Serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #696969;
|
||||
}
|
||||
|
||||
a:link
|
||||
{
|
||||
color: #034af3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:visited
|
||||
{
|
||||
color: #505abc;
|
||||
}
|
||||
a:hover
|
||||
{
|
||||
color: #1d60ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:active
|
||||
{
|
||||
color: #12eb87;
|
||||
}
|
||||
|
||||
p, ul
|
||||
{
|
||||
margin-bottom: 20px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
/* HEADINGS
|
||||
----------------------------------------------------------*/
|
||||
h1, h2, h3, h4, h5, h6
|
||||
{
|
||||
font-size: 1.5em;
|
||||
color: #000;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 2em;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
h2
|
||||
{
|
||||
padding: 0 0 10px 0;
|
||||
}
|
||||
h3
|
||||
{
|
||||
font-size: 1.2em;
|
||||
}
|
||||
h4
|
||||
{
|
||||
font-size: 1.1em;
|
||||
}
|
||||
h5, h6
|
||||
{
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* this rule styles <h2> tags that are the
|
||||
first child of the left and right table columns */
|
||||
.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2
|
||||
{
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* PRIMARY LAYOUT ELEMENTS
|
||||
----------------------------------------------------------*/
|
||||
|
||||
/* you can specify a greater or lesser percentage for the
|
||||
page width. Or, you can specify an exact pixel width. */
|
||||
.page
|
||||
{
|
||||
width: 90%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#header
|
||||
{
|
||||
position: relative;
|
||||
margin-bottom: 0px;
|
||||
color: #000;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#header h1
|
||||
{
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
border: none;
|
||||
line-height: 2em;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 32px !important;
|
||||
}
|
||||
|
||||
#main
|
||||
{
|
||||
padding: 30px 30px 15px 30px;
|
||||
background-color: #fff;
|
||||
margin-bottom: 30px;
|
||||
_height: 1px; /* only IE6 applies CSS properties starting with an underscrore */
|
||||
height: 590px;
|
||||
}
|
||||
|
||||
#footer
|
||||
{
|
||||
color: #999;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
margin: 0;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
/* TAB MENU
|
||||
----------------------------------------------------------*/
|
||||
ul#menu
|
||||
{
|
||||
border-bottom: 1px #5C87B2 solid;
|
||||
padding: 0 0 2px;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
ul#menu li
|
||||
{
|
||||
display: inline;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
ul#menu li#greeting
|
||||
{
|
||||
padding: 10px 20px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
line-height: 2.8em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
ul#menu li a
|
||||
{
|
||||
padding: 10px 20px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
line-height: 2.8em;
|
||||
background-color: #e8eef4;
|
||||
color: #034af3;
|
||||
}
|
||||
|
||||
ul#menu li a:hover
|
||||
{
|
||||
background-color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul#menu li a:active
|
||||
{
|
||||
background-color: #a6e2a6;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul#menu li.selected a
|
||||
{
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* FORM LAYOUT ELEMENTS
|
||||
----------------------------------------------------------*/
|
||||
|
||||
fieldset
|
||||
{
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
fieldset p
|
||||
{
|
||||
margin: 2px 12px 10px 10px;
|
||||
}
|
||||
|
||||
fieldset label
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
fieldset label.inline
|
||||
{
|
||||
display: inline;
|
||||
}
|
||||
|
||||
legend
|
||||
{
|
||||
font-size: 1.1em;
|
||||
font-weight: 600;
|
||||
padding: 2px 4px 8px 4px;
|
||||
}
|
||||
|
||||
input[type="text"]
|
||||
{
|
||||
width: 200px;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
input[type="password"]
|
||||
{
|
||||
width: 200px;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
/* TABLE
|
||||
----------------------------------------------------------*/
|
||||
|
||||
table
|
||||
{
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table td
|
||||
{
|
||||
padding: 5px;
|
||||
border: solid 1px #e8eef4;
|
||||
}
|
||||
|
||||
table th
|
||||
{
|
||||
padding: 6px 5px;
|
||||
text-align: left;
|
||||
background-color: #e8eef4;
|
||||
border: solid 1px #e8eef4;
|
||||
}
|
||||
|
||||
/* MISC
|
||||
----------------------------------------------------------*/
|
||||
.clear
|
||||
{
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.error
|
||||
{
|
||||
color:Red;
|
||||
}
|
||||
|
||||
#menucontainer
|
||||
{
|
||||
margin-top:40px;
|
||||
}
|
||||
|
||||
div#title
|
||||
{
|
||||
display:block;
|
||||
float:left;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
#logindisplay
|
||||
{
|
||||
font-size:1.1em;
|
||||
display:block;
|
||||
text-align:right;
|
||||
margin:10px;
|
||||
color:White;
|
||||
}
|
||||
|
||||
#logindisplay a:link
|
||||
{
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#logindisplay a:visited
|
||||
{
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#logindisplay a:hover
|
||||
{
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.field-validation-error
|
||||
{
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
.input-validation-error
|
||||
{
|
||||
border: 1px solid #ff0000;
|
||||
background-color: #ffeeee;
|
||||
}
|
||||
|
||||
.validation-summary-errors
|
||||
{
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
#dinnerform textarea
|
||||
{
|
||||
width:200px;
|
||||
height:70px;
|
||||
}
|
||||
|
||||
#dinnerDiv textarea
|
||||
{
|
||||
width:200px;
|
||||
height:70px;
|
||||
}
|
||||
|
||||
#rsvpmsg
|
||||
{
|
||||
color:Red;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
padding:0px, 10px, 0px, 10px;
|
||||
height:1px;
|
||||
}
|
||||
|
||||
#pagination
|
||||
{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#dinnerDiv {
|
||||
float: left;
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#mapDiv {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#mapDivLeft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#mapDivRight {
|
||||
padding: 30px 0px 0px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#dinnerList {
|
||||
padding:0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#searchBox {
|
||||
padding:0px 0px 10px 0px;
|
||||
}
|
||||
|
||||
#theMap {
|
||||
position: relative;
|
||||
width: 500px;
|
||||
height: 450px;
|
||||
}
|
BIN
aspclassiccompiler/Backup/NerdDinnerAsp/Content/nerd.jpg
Normal file
BIN
aspclassiccompiler/Backup/NerdDinnerAsp/Content/nerd.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -0,0 +1,297 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace NerdDinner.Controllers {
|
||||
|
||||
[HandleError]
|
||||
public class AccountController : Controller {
|
||||
|
||||
// This constructor is used by the MVC framework to instantiate the controller using
|
||||
// the default forms authentication and membership providers.
|
||||
|
||||
public AccountController()
|
||||
: this(null, null) {
|
||||
}
|
||||
|
||||
// This constructor is not used by the MVC framework but is instead provided for ease
|
||||
// of unit testing this type. See the comments at the end of this file for more
|
||||
// information.
|
||||
public AccountController(IFormsAuthentication formsAuth, IMembershipService service) {
|
||||
FormsAuth = formsAuth ?? new FormsAuthenticationService();
|
||||
MembershipService = service ?? new AccountMembershipService();
|
||||
}
|
||||
|
||||
public IFormsAuthentication FormsAuth {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public IMembershipService MembershipService {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ActionResult LogOn() {
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
|
||||
Justification = "Needs to take same parameter type as Controller.Redirect()")]
|
||||
public ActionResult LogOn(string userName, string password, bool rememberMe, string returnUrl) {
|
||||
|
||||
if (!ValidateLogOn(userName, password)) {
|
||||
ViewData["rememberMe"] = rememberMe;
|
||||
return View();
|
||||
}
|
||||
|
||||
FormsAuth.SignIn(userName, rememberMe);
|
||||
if (!String.IsNullOrEmpty(returnUrl)) {
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
else {
|
||||
return RedirectToAction("Index", "Home");
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult LogOff() {
|
||||
|
||||
FormsAuth.SignOut();
|
||||
|
||||
return RedirectToAction("Index", "Home");
|
||||
}
|
||||
|
||||
public ActionResult Register() {
|
||||
|
||||
ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
public ActionResult Register(string userName, string email, string password, string confirmPassword) {
|
||||
|
||||
ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
|
||||
|
||||
if (ValidateRegistration(userName, email, password, confirmPassword)) {
|
||||
// Attempt to register the user
|
||||
MembershipCreateStatus createStatus = MembershipService.CreateUser(userName, password, email);
|
||||
|
||||
if (createStatus == MembershipCreateStatus.Success) {
|
||||
FormsAuth.SignIn(userName, false /* createPersistentCookie */);
|
||||
return RedirectToAction("Index", "Home");
|
||||
}
|
||||
else {
|
||||
ModelState.AddModelError("_FORM", ErrorCodeToString(createStatus));
|
||||
}
|
||||
}
|
||||
|
||||
// If we got this far, something failed, redisplay form
|
||||
return View();
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult ChangePassword() {
|
||||
|
||||
ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
|
||||
Justification = "Exceptions result in password not being changed.")]
|
||||
public ActionResult ChangePassword(string currentPassword, string newPassword, string confirmPassword) {
|
||||
|
||||
ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
|
||||
|
||||
if (!ValidateChangePassword(currentPassword, newPassword, confirmPassword)) {
|
||||
return View();
|
||||
}
|
||||
|
||||
try {
|
||||
if (MembershipService.ChangePassword(User.Identity.Name, currentPassword, newPassword)) {
|
||||
return RedirectToAction("ChangePasswordSuccess");
|
||||
}
|
||||
else {
|
||||
ModelState.AddModelError("_FORM", "The current password is incorrect or the new password is invalid.");
|
||||
return View();
|
||||
}
|
||||
}
|
||||
catch {
|
||||
ModelState.AddModelError("_FORM", "The current password is incorrect or the new password is invalid.");
|
||||
return View();
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult ChangePasswordSuccess() {
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
protected override void OnActionExecuting(ActionExecutingContext filterContext) {
|
||||
if (filterContext.HttpContext.User.Identity is WindowsIdentity) {
|
||||
throw new InvalidOperationException("Windows authentication is not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
#region Validation Methods
|
||||
|
||||
private bool ValidateChangePassword(string currentPassword, string newPassword, string confirmPassword) {
|
||||
if (String.IsNullOrEmpty(currentPassword)) {
|
||||
ModelState.AddModelError("currentPassword", "You must specify a current password.");
|
||||
}
|
||||
if (newPassword == null || newPassword.Length < MembershipService.MinPasswordLength) {
|
||||
ModelState.AddModelError("newPassword",
|
||||
String.Format(CultureInfo.CurrentCulture,
|
||||
"You must specify a new password of {0} or more characters.",
|
||||
MembershipService.MinPasswordLength));
|
||||
}
|
||||
|
||||
if (!String.Equals(newPassword, confirmPassword, StringComparison.Ordinal)) {
|
||||
ModelState.AddModelError("_FORM", "The new password and confirmation password do not match.");
|
||||
}
|
||||
|
||||
return ModelState.IsValid;
|
||||
}
|
||||
|
||||
private bool ValidateLogOn(string userName, string password) {
|
||||
if (String.IsNullOrEmpty(userName)) {
|
||||
ModelState.AddModelError("username", "You must specify a username.");
|
||||
}
|
||||
if (String.IsNullOrEmpty(password)) {
|
||||
ModelState.AddModelError("password", "You must specify a password.");
|
||||
}
|
||||
if (!MembershipService.ValidateUser(userName, password)) {
|
||||
ModelState.AddModelError("_FORM", "The username or password provided is incorrect.");
|
||||
}
|
||||
|
||||
return ModelState.IsValid;
|
||||
}
|
||||
|
||||
private bool ValidateRegistration(string userName, string email, string password, string confirmPassword) {
|
||||
if (String.IsNullOrEmpty(userName)) {
|
||||
ModelState.AddModelError("username", "You must specify a username.");
|
||||
}
|
||||
if (String.IsNullOrEmpty(email)) {
|
||||
ModelState.AddModelError("email", "You must specify an email address.");
|
||||
}
|
||||
if (password == null || password.Length < MembershipService.MinPasswordLength) {
|
||||
ModelState.AddModelError("password",
|
||||
String.Format(CultureInfo.CurrentCulture,
|
||||
"You must specify a password of {0} or more characters.",
|
||||
MembershipService.MinPasswordLength));
|
||||
}
|
||||
if (!String.Equals(password, confirmPassword, StringComparison.Ordinal)) {
|
||||
ModelState.AddModelError("_FORM", "The new password and confirmation password do not match.");
|
||||
}
|
||||
return ModelState.IsValid;
|
||||
}
|
||||
|
||||
private static string ErrorCodeToString(MembershipCreateStatus createStatus) {
|
||||
// See http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus.aspx for
|
||||
// a full list of status codes.
|
||||
switch (createStatus) {
|
||||
case MembershipCreateStatus.DuplicateUserName:
|
||||
return "Username already exists. Please enter a different user name.";
|
||||
|
||||
case MembershipCreateStatus.DuplicateEmail:
|
||||
return "A username for that e-mail address already exists. Please enter a different e-mail address.";
|
||||
|
||||
case MembershipCreateStatus.InvalidPassword:
|
||||
return "The password provided is invalid. Please enter a valid password value.";
|
||||
|
||||
case MembershipCreateStatus.InvalidEmail:
|
||||
return "The e-mail address provided is invalid. Please check the value and try again.";
|
||||
|
||||
case MembershipCreateStatus.InvalidAnswer:
|
||||
return "The password retrieval answer provided is invalid. Please check the value and try again.";
|
||||
|
||||
case MembershipCreateStatus.InvalidQuestion:
|
||||
return "The password retrieval question provided is invalid. Please check the value and try again.";
|
||||
|
||||
case MembershipCreateStatus.InvalidUserName:
|
||||
return "The user name provided is invalid. Please check the value and try again.";
|
||||
|
||||
case MembershipCreateStatus.ProviderError:
|
||||
return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
|
||||
|
||||
case MembershipCreateStatus.UserRejected:
|
||||
return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
|
||||
|
||||
default:
|
||||
return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
// The FormsAuthentication type is sealed and contains static members, so it is difficult to
|
||||
// unit test code that calls its members. The interface and helper class below demonstrate
|
||||
// how to create an abstract wrapper around such a type in order to make the AccountController
|
||||
// code unit testable.
|
||||
|
||||
public interface IFormsAuthentication {
|
||||
void SignIn(string userName, bool createPersistentCookie);
|
||||
void SignOut();
|
||||
}
|
||||
|
||||
public class FormsAuthenticationService : IFormsAuthentication {
|
||||
public void SignIn(string userName, bool createPersistentCookie) {
|
||||
FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
|
||||
}
|
||||
public void SignOut() {
|
||||
FormsAuthentication.SignOut();
|
||||
}
|
||||
}
|
||||
|
||||
public interface IMembershipService {
|
||||
int MinPasswordLength { get; }
|
||||
|
||||
bool ValidateUser(string userName, string password);
|
||||
MembershipCreateStatus CreateUser(string userName, string password, string email);
|
||||
bool ChangePassword(string userName, string oldPassword, string newPassword);
|
||||
}
|
||||
|
||||
public class AccountMembershipService : IMembershipService {
|
||||
private MembershipProvider _provider;
|
||||
|
||||
public AccountMembershipService()
|
||||
: this(null) {
|
||||
}
|
||||
|
||||
public AccountMembershipService(MembershipProvider provider) {
|
||||
_provider = provider ?? Membership.Provider;
|
||||
}
|
||||
|
||||
public int MinPasswordLength {
|
||||
get {
|
||||
return _provider.MinRequiredPasswordLength;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ValidateUser(string userName, string password) {
|
||||
return _provider.ValidateUser(userName, password);
|
||||
}
|
||||
|
||||
public MembershipCreateStatus CreateUser(string userName, string password, string email) {
|
||||
MembershipCreateStatus status;
|
||||
_provider.CreateUser(userName, password, email, null, null, true, null, out status);
|
||||
return status;
|
||||
}
|
||||
|
||||
public bool ChangePassword(string userName, string oldPassword, string newPassword) {
|
||||
MembershipUser currentUser = _provider.GetUser(userName, true /* userIsOnline */);
|
||||
return currentUser.ChangePassword(oldPassword, newPassword);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,189 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using NerdDinner.Helpers;
|
||||
using NerdDinner.Models;
|
||||
|
||||
namespace NerdDinner.Controllers {
|
||||
|
||||
//
|
||||
// ViewModel Classes
|
||||
|
||||
public class DinnerFormViewModel {
|
||||
|
||||
// Properties
|
||||
public Dinner Dinner { get; private set; }
|
||||
public SelectList Countries { get; private set; }
|
||||
|
||||
// Constructor
|
||||
public DinnerFormViewModel(Dinner dinner) {
|
||||
Dinner = dinner;
|
||||
Countries = new SelectList(PhoneValidator.Countries, Dinner.Country);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Controller Class
|
||||
|
||||
[HandleError]
|
||||
public class DinnersController : Controller {
|
||||
|
||||
IDinnerRepository dinnerRepository;
|
||||
|
||||
//
|
||||
// Dependency Injection enabled constructors
|
||||
|
||||
public DinnersController()
|
||||
: this(new DinnerRepository()) {
|
||||
}
|
||||
|
||||
public DinnersController(IDinnerRepository repository) {
|
||||
dinnerRepository = repository;
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Dinners/
|
||||
// /Dinners/Page/2
|
||||
|
||||
public ActionResult Index(int? page) {
|
||||
|
||||
const int pageSize = 10;
|
||||
|
||||
var upcomingDinners = dinnerRepository.FindUpcomingDinners();
|
||||
var paginatedDinners = new PaginatedList<Dinner>(upcomingDinners, page ?? 0, pageSize);
|
||||
|
||||
return View(paginatedDinners);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Dinners/Details/5
|
||||
|
||||
public ActionResult Details(int id) {
|
||||
|
||||
Dinner dinner = dinnerRepository.GetDinner(id);
|
||||
|
||||
if (dinner == null)
|
||||
return View("NotFound");
|
||||
|
||||
return View(dinner);
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Dinners/Edit/5
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Edit(int id) {
|
||||
|
||||
Dinner dinner = dinnerRepository.GetDinner(id);
|
||||
|
||||
if (!dinner.IsHostedBy(User.Identity.Name))
|
||||
return View("InvalidOwner");
|
||||
|
||||
return View(new DinnerFormViewModel(dinner));
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Dinners/Edit/5
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post), Authorize]
|
||||
public ActionResult Edit(int id, FormCollection collection) {
|
||||
|
||||
Dinner dinner = dinnerRepository.GetDinner(id);
|
||||
|
||||
if (!dinner.IsHostedBy(User.Identity.Name))
|
||||
return View("InvalidOwner");
|
||||
|
||||
try {
|
||||
UpdateModel(dinner);
|
||||
|
||||
dinnerRepository.Save();
|
||||
|
||||
return RedirectToAction("Details", new { id=dinner.DinnerID });
|
||||
}
|
||||
catch {
|
||||
ModelState.AddModelErrors(dinner.GetRuleViolations());
|
||||
|
||||
return View(new DinnerFormViewModel(dinner));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /Dinners/Create
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Create() {
|
||||
|
||||
Dinner dinner = new Dinner() {
|
||||
EventDate = DateTime.Now.AddDays(7)
|
||||
};
|
||||
|
||||
return View(new DinnerFormViewModel(dinner));
|
||||
}
|
||||
|
||||
//
|
||||
// POST: /Dinners/Create
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post), Authorize]
|
||||
public ActionResult Create(Dinner dinner) {
|
||||
|
||||
if (ModelState.IsValid) {
|
||||
|
||||
try {
|
||||
dinner.HostedBy = User.Identity.Name;
|
||||
|
||||
RSVP rsvp = new RSVP();
|
||||
rsvp.AttendeeName = User.Identity.Name;
|
||||
dinner.RSVPs.Add(rsvp);
|
||||
|
||||
dinnerRepository.Add(dinner);
|
||||
dinnerRepository.Save();
|
||||
|
||||
return RedirectToAction("Details", new { id=dinner.DinnerID });
|
||||
}
|
||||
catch {
|
||||
ModelState.AddModelErrors(dinner.GetRuleViolations());
|
||||
}
|
||||
}
|
||||
|
||||
return View(new DinnerFormViewModel(dinner));
|
||||
}
|
||||
|
||||
//
|
||||
// HTTP GET: /Dinners/Delete/1
|
||||
|
||||
[Authorize]
|
||||
public ActionResult Delete(int id) {
|
||||
|
||||
Dinner dinner = dinnerRepository.GetDinner(id);
|
||||
|
||||
if (dinner == null)
|
||||
return View("NotFound");
|
||||
|
||||
if (!dinner.IsHostedBy(User.Identity.Name))
|
||||
return View("InvalidOwner");
|
||||
|
||||
return View(dinner);
|
||||
}
|
||||
|
||||
//
|
||||
// HTTP POST: /Dinners/Delete/1
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post), Authorize]
|
||||
public ActionResult Delete(int id, string confirmButton) {
|
||||
|
||||
Dinner dinner = dinnerRepository.GetDinner(id);
|
||||
|
||||
if (dinner == null)
|
||||
return View("NotFound");
|
||||
|
||||
if (!dinner.IsHostedBy(User.Identity.Name))
|
||||
return View("InvalidOwner");
|
||||
|
||||
dinnerRepository.Delete(dinner);
|
||||
dinnerRepository.Save();
|
||||
|
||||
return View("Deleted");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace NerdDinner.Controllers {
|
||||
|
||||
[HandleError]
|
||||
public class HomeController : Controller {
|
||||
|
||||
public ActionResult Index() {
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult About() {
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using NerdDinner.Models;
|
||||
|
||||
namespace NerdDinner.Controllers
|
||||
{
|
||||
public class RSVPController : Controller {
|
||||
|
||||
IDinnerRepository dinnerRepository;
|
||||
|
||||
//
|
||||
// Dependency Injection enabled constructors
|
||||
|
||||
public RSVPController()
|
||||
: this(new DinnerRepository()) {
|
||||
}
|
||||
|
||||
public RSVPController(IDinnerRepository repository) {
|
||||
dinnerRepository = repository;
|
||||
}
|
||||
|
||||
//
|
||||
// AJAX: /Dinners/Register/1
|
||||
|
||||
[Authorize, AcceptVerbs(HttpVerbs.Post)]
|
||||
public ActionResult Register(int id) {
|
||||
|
||||
Dinner dinner = dinnerRepository.GetDinner(id);
|
||||
|
||||
if (!dinner.IsUserRegistered(User.Identity.Name)) {
|
||||
|
||||
RSVP rsvp = new RSVP();
|
||||
rsvp.AttendeeName = User.Identity.Name;
|
||||
|
||||
dinner.RSVPs.Add(rsvp);
|
||||
dinnerRepository.Save();
|
||||
}
|
||||
|
||||
return Content("Thanks - we'll see you there!");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using NerdDinner.Models;
|
||||
|
||||
namespace NerdDinner.Controllers {
|
||||
|
||||
public class JsonDinner {
|
||||
public int DinnerID { get; set; }
|
||||
public string Title { get; set; }
|
||||
public double Latitude { get; set; }
|
||||
public double Longitude { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int RSVPCount { get; set; }
|
||||
}
|
||||
|
||||
public class SearchController : Controller {
|
||||
|
||||
IDinnerRepository dinnerRepository;
|
||||
|
||||
//
|
||||
// Dependency Injection enabled constructors
|
||||
|
||||
public SearchController()
|
||||
: this(new DinnerRepository()) {
|
||||
}
|
||||
|
||||
public SearchController(IDinnerRepository repository) {
|
||||
dinnerRepository = repository;
|
||||
}
|
||||
|
||||
//
|
||||
// AJAX: /Search/FindByLocation?longitude=45&latitude=-90
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
public ActionResult SearchByLocation(float latitude, float longitude) {
|
||||
|
||||
var dinners = dinnerRepository.FindByLocation(latitude, longitude);
|
||||
|
||||
var jsonDinners = from dinner in dinners
|
||||
select new JsonDinner {
|
||||
DinnerID = dinner.DinnerID,
|
||||
Latitude = dinner.Latitude,
|
||||
Longitude = dinner.Longitude,
|
||||
Title = dinner.Title,
|
||||
Description = dinner.Description,
|
||||
RSVPCount = dinner.RSVPs.Count
|
||||
};
|
||||
|
||||
return Json(jsonDinners.ToList());
|
||||
}
|
||||
}
|
||||
}
|
3
aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx
Normal file
3
aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NerdDinner._Default" %>
|
||||
|
||||
<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>
|
13
aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx.cs
Normal file
13
aspclassiccompiler/Backup/NerdDinnerAsp/Default.aspx.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace NerdDinner {
|
||||
public partial class _Default : Page {
|
||||
public void Page_Load(object sender, System.EventArgs e) {
|
||||
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
|
||||
IHttpHandler httpHandler = new MvcHttpHandler();
|
||||
httpHandler.ProcessRequest(HttpContext.Current);
|
||||
}
|
||||
}
|
||||
}
|
1
aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax
Normal file
1
aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax
Normal file
|
@ -0,0 +1 @@
|
|||
<%@ Application Codebehind="Global.asax.cs" Inherits="NerdDinner.MvcApplication" Language="C#" %>
|
37
aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax.cs
Normal file
37
aspclassiccompiler/Backup/NerdDinnerAsp/Global.asax.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Dlrsoft.Asp.Mvc;
|
||||
|
||||
namespace NerdDinner {
|
||||
|
||||
public class MvcApplication : System.Web.HttpApplication {
|
||||
|
||||
public void RegisterRoutes(RouteCollection routes) {
|
||||
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
routes.MapRoute(
|
||||
"UpcomingDinners",
|
||||
"Dinners/Page/{page}",
|
||||
new { controller = "Dinners", action = "Index" }
|
||||
);
|
||||
|
||||
routes.MapRoute(
|
||||
"Default", // Route name
|
||||
"{controller}/{action}/{id}", // URL with parameters
|
||||
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
|
||||
);
|
||||
}
|
||||
|
||||
void Application_Start() {
|
||||
RegisterRoutes(RouteTable.Routes);
|
||||
ViewEngines.Engines.Clear();
|
||||
ViewEngines.Engines.Add(new AspViewEngine());
|
||||
ViewEngines.Engines.Add(new WebFormViewEngine());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using NerdDinner.Models;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace NerdDinner.Helpers {
|
||||
|
||||
public static class ModelStateHelpers {
|
||||
|
||||
public static void AddModelErrors(this ModelStateDictionary modelState, IEnumerable<RuleViolation> errors) {
|
||||
|
||||
foreach (RuleViolation issue in errors) {
|
||||
modelState.AddModelError(issue.PropertyName, issue.ErrorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NerdDinner.Helpers {
|
||||
|
||||
public class PaginatedList<T> : List<T> {
|
||||
|
||||
public int PageIndex { get; private set; }
|
||||
public int PageSize { get; private set; }
|
||||
public int TotalCount { get; private set; }
|
||||
public int TotalPages { get; private set; }
|
||||
|
||||
public PaginatedList(IQueryable<T> source, int pageIndex, int pageSize) {
|
||||
PageIndex = pageIndex;
|
||||
PageSize = pageSize;
|
||||
TotalCount = source.Count();
|
||||
TotalPages = (int) Math.Ceiling(TotalCount / (double)PageSize);
|
||||
|
||||
this.AddRange(source.Skip(PageIndex * PageSize).Take(PageSize));
|
||||
}
|
||||
|
||||
public bool HasPreviousPage {
|
||||
get {
|
||||
return (PageIndex > 0);
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasNextPage {
|
||||
get {
|
||||
return (PageIndex+1 < TotalPages);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace NerdDinner.Helpers {
|
||||
|
||||
public class PhoneValidator {
|
||||
|
||||
static IDictionary<string, Regex> countryRegex = new Dictionary<string, Regex>()
|
||||
{
|
||||
{ "USA", new Regex("^[2-9]\\d{2}-\\d{3}-\\d{4}$")},
|
||||
{ "UK", new Regex("(^1300\\d{6}$)|(^1800|1900|1902\\d{6}$)|(^0[2|3|7|8]{1}[0-9]{8}$)|(^13\\d{4}$)|(^04\\d{2,3}\\d{6}$)")},
|
||||
{ "Netherlands", new Regex("(^\\+[0-9]{2}|^\\+[0-9]{2}\\(0\\)|^\\(\\+[0-9]{2}\\)\\(0\\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\\-\\s]{10}$)")},
|
||||
};
|
||||
|
||||
public static bool IsValidNumber(string phoneNumber, string country) {
|
||||
|
||||
if (country != null && countryRegex.ContainsKey(country))
|
||||
return countryRegex[country].IsMatch(phoneNumber);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> Countries {
|
||||
get {
|
||||
return countryRegex.Keys;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
56
aspclassiccompiler/Backup/NerdDinnerAsp/Models/Dinner.cs
Normal file
56
aspclassiccompiler/Backup/NerdDinnerAsp/Models/Dinner.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Data.Linq;
|
||||
using System.Web.Mvc;
|
||||
using NerdDinner.Helpers;
|
||||
|
||||
namespace NerdDinner.Models {
|
||||
|
||||
[Bind(Include="Title,Description,EventDate,Address,Country,ContactPhone,Latitude,Longitude")]
|
||||
public partial class Dinner {
|
||||
|
||||
public bool IsHostedBy(string userName) {
|
||||
return HostedBy.Equals(userName, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public bool IsUserRegistered(string userName) {
|
||||
return RSVPs.Any(r => r.AttendeeName.Equals(userName, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
|
||||
public bool IsValid {
|
||||
get { return (GetRuleViolations().Count() == 0); }
|
||||
}
|
||||
|
||||
public IEnumerable<RuleViolation> GetRuleViolations() {
|
||||
|
||||
if (String.IsNullOrEmpty(Title))
|
||||
yield return new RuleViolation("Title is required", "Title");
|
||||
|
||||
if (String.IsNullOrEmpty(Description))
|
||||
yield return new RuleViolation("Description is required", "Description");
|
||||
|
||||
if (String.IsNullOrEmpty(HostedBy))
|
||||
yield return new RuleViolation("HostedBy is required", "HostedBy");
|
||||
|
||||
if (String.IsNullOrEmpty(Address))
|
||||
yield return new RuleViolation("Address is required", "Address");
|
||||
|
||||
if (String.IsNullOrEmpty(Country))
|
||||
yield return new RuleViolation("Country is required", "Address");
|
||||
|
||||
if (String.IsNullOrEmpty(ContactPhone))
|
||||
yield return new RuleViolation("Phone# is required", "ContactPhone");
|
||||
|
||||
if (!PhoneValidator.IsValidNumber(ContactPhone, Country))
|
||||
yield return new RuleViolation("Phone# does not match country", "ContactPhone");
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
partial void OnValidate(ChangeAction action) {
|
||||
if (!IsValid)
|
||||
throw new ApplicationException("Rule violations prevent saving");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace NerdDinner.Models {
|
||||
|
||||
public class DinnerRepository : NerdDinner.Models.IDinnerRepository {
|
||||
|
||||
NerdDinnerDataContext db = new NerdDinnerDataContext();
|
||||
|
||||
//
|
||||
// Query Methods
|
||||
|
||||
public IQueryable<Dinner> FindAllDinners() {
|
||||
return db.Dinners;
|
||||
}
|
||||
|
||||
public IQueryable<Dinner> FindUpcomingDinners() {
|
||||
return from dinner in FindAllDinners()
|
||||
where dinner.EventDate > DateTime.Now
|
||||
orderby dinner.EventDate
|
||||
select dinner;
|
||||
}
|
||||
|
||||
public IQueryable<Dinner> FindByLocation(float latitude, float longitude) {
|
||||
var dinners = from dinner in FindUpcomingDinners()
|
||||
join i in db.NearestDinners(latitude, longitude)
|
||||
on dinner.DinnerID equals i.DinnerID
|
||||
select dinner;
|
||||
|
||||
return dinners;
|
||||
}
|
||||
|
||||
public Dinner GetDinner(int id) {
|
||||
return db.Dinners.SingleOrDefault(d => d.DinnerID == id);
|
||||
}
|
||||
|
||||
//
|
||||
// Insert/Delete Methods
|
||||
|
||||
public void Add(Dinner dinner) {
|
||||
db.Dinners.InsertOnSubmit(dinner);
|
||||
}
|
||||
|
||||
public void Delete(Dinner dinner) {
|
||||
db.RSVPs.DeleteAllOnSubmit(dinner.RSVPs);
|
||||
db.Dinners.DeleteOnSubmit(dinner);
|
||||
}
|
||||
|
||||
//
|
||||
// Persistence
|
||||
|
||||
public void Save() {
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace NerdDinner.Models {
|
||||
|
||||
public interface IDinnerRepository {
|
||||
|
||||
IQueryable<Dinner> FindAllDinners();
|
||||
IQueryable<Dinner> FindByLocation(float latitude, float longitude);
|
||||
IQueryable<Dinner> FindUpcomingDinners();
|
||||
Dinner GetDinner(int id);
|
||||
|
||||
void Add(Dinner dinner);
|
||||
void Delete(Dinner dinner);
|
||||
|
||||
void Save();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Database Name="NerdDinner" Class="NerdDinnerDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
|
||||
<Connection Mode="WebSettings" ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NerdDinner.mdf;Integrated Security=True;User Instance=True" SettingsObjectName="System.Configuration.ConfigurationManager.ConnectionStrings" SettingsPropertyName="NerdDinnerConnectionString" Provider="System.Data.SqlClient" />
|
||||
<Table Name="dbo.Dinners" Member="Dinners">
|
||||
<Type Name="Dinner">
|
||||
<Column Name="DinnerID" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
|
||||
<Column Name="Title" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
|
||||
<Column Name="EventDate" Type="System.DateTime" DbType="DateTime NOT NULL" CanBeNull="false" />
|
||||
<Column Name="Description" Type="System.String" DbType="NVarChar(256)" CanBeNull="true" />
|
||||
<Column Name="HostedBy" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
|
||||
<Column Name="ContactPhone" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
|
||||
<Column Name="Address" Type="System.String" DbType="NVarChar(50)" CanBeNull="true" />
|
||||
<Column Name="Country" Type="System.String" DbType="NVarChar(30)" CanBeNull="true" />
|
||||
<Column Name="Latitude" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" />
|
||||
<Column Name="Longitude" Type="System.Double" DbType="Float NOT NULL" CanBeNull="false" />
|
||||
<Association Name="Dinner_RSVP" Member="RSVPs" ThisKey="DinnerID" OtherKey="DinnerID" Type="RSVP" />
|
||||
</Type>
|
||||
</Table>
|
||||
<Table Name="dbo.RSVP" Member="RSVPs">
|
||||
<Type Name="RSVP">
|
||||
<Column Name="RsvpID" Type="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
|
||||
<Column Name="DinnerID" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
|
||||
<Column Name="AttendeeName" Type="System.String" DbType="NVarChar(50) NOT NULL" CanBeNull="false" />
|
||||
<Association Name="Dinner_RSVP" Member="Dinner" ThisKey="DinnerID" OtherKey="DinnerID" Type="Dinner" IsForeignKey="true" />
|
||||
</Type>
|
||||
</Table>
|
||||
<Function Name="dbo.NearestDinners" Method="NearestDinners" IsComposable="true">
|
||||
<Parameter Name="lat" Type="System.Single" DbType="Real" />
|
||||
<Parameter Name="long" Type="System.Single" DbType="Real" />
|
||||
<ElementType Name="NearestDinnersResult">
|
||||
<Column Name="DinnerID" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
|
||||
</ElementType>
|
||||
</Function>
|
||||
<Function Name="dbo.DistanceBetween" Method="DistanceBetween" IsComposable="true">
|
||||
<Parameter Name="Lat1" Parameter="lat1" Type="System.Single" DbType="Real" />
|
||||
<Parameter Name="Long1" Parameter="long1" Type="System.Single" DbType="Real" />
|
||||
<Parameter Name="Lat2" Parameter="lat2" Type="System.Single" DbType="Real" />
|
||||
<Parameter Name="Long2" Parameter="long2" Type="System.Single" DbType="Real" />
|
||||
<Return Type="System.Single" />
|
||||
</Function>
|
||||
</Database>
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 11, 8.5" name="NerdDinner">
|
||||
<DataContextMoniker Name="/NerdDinnerDataContext" />
|
||||
<nestedChildShapes>
|
||||
<classShape Id="ca99e816-22ab-4057-8941-43618a1b1c1d" absoluteBounds="0.5, 0.5, 2, 2.7324039713541666">
|
||||
<DataClassMoniker Name="/NerdDinnerDataContext/Dinner" />
|
||||
<nestedChildShapes>
|
||||
<elementListCompartment Id="99eef688-b088-4ab9-a645-4fdfa4cc3ee3" absoluteBounds="0.515, 0.96, 1.9700000000000002, 2.1724039713541665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
|
||||
</nestedChildShapes>
|
||||
</classShape>
|
||||
<classShape Id="7edca3c8-60ef-460d-8b99-e51fba7a1fb5" absoluteBounds="3.25, 1.125, 2, 1.3862939453124998">
|
||||
<DataClassMoniker Name="/NerdDinnerDataContext/RSVP" />
|
||||
<nestedChildShapes>
|
||||
<elementListCompartment Id="28a0ebc1-d495-475d-85e8-ab8851f3cbe0" absoluteBounds="3.265, 1.585, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
|
||||
</nestedChildShapes>
|
||||
</classShape>
|
||||
<associationConnector edgePoints="[(2.5 : 1.81814697265625); (3.25 : 1.81814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
|
||||
<AssociationMoniker Name="/NerdDinnerDataContext/Dinner/Dinner_RSVP" />
|
||||
<nodes>
|
||||
<classShapeMoniker Id="ca99e816-22ab-4057-8941-43618a1b1c1d" />
|
||||
<classShapeMoniker Id="7edca3c8-60ef-460d-8b99-e51fba7a1fb5" />
|
||||
</nodes>
|
||||
</associationConnector>
|
||||
</nestedChildShapes>
|
||||
</ordesignerObjectsDiagram>
|
583
aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.designer.cs
generated
Normal file
583
aspclassiccompiler/Backup/NerdDinnerAsp/Models/NerdDinner.designer.cs
generated
Normal file
|
@ -0,0 +1,583 @@
|
|||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.3521
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NerdDinner.Models
|
||||
{
|
||||
using System.Data.Linq;
|
||||
using System.Data.Linq.Mapping;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.ComponentModel;
|
||||
using System;
|
||||
|
||||
|
||||
[System.Data.Linq.Mapping.DatabaseAttribute(Name="NerdDinner")]
|
||||
public partial class NerdDinnerDataContext : System.Data.Linq.DataContext
|
||||
{
|
||||
|
||||
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
|
||||
|
||||
#region Extensibility Method Definitions
|
||||
partial void OnCreated();
|
||||
partial void InsertDinner(Dinner instance);
|
||||
partial void UpdateDinner(Dinner instance);
|
||||
partial void DeleteDinner(Dinner instance);
|
||||
partial void InsertRSVP(RSVP instance);
|
||||
partial void UpdateRSVP(RSVP instance);
|
||||
partial void DeleteRSVP(RSVP instance);
|
||||
#endregion
|
||||
|
||||
public NerdDinnerDataContext() :
|
||||
base(global::System.Configuration.ConfigurationManager.ConnectionStrings["NerdDinnerConnectionString"].ConnectionString, mappingSource)
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
public NerdDinnerDataContext(string connection) :
|
||||
base(connection, mappingSource)
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
public NerdDinnerDataContext(System.Data.IDbConnection connection) :
|
||||
base(connection, mappingSource)
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
public NerdDinnerDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
|
||||
base(connection, mappingSource)
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
public NerdDinnerDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
|
||||
base(connection, mappingSource)
|
||||
{
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<Dinner> Dinners
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<Dinner>();
|
||||
}
|
||||
}
|
||||
|
||||
public System.Data.Linq.Table<RSVP> RSVPs
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetTable<RSVP>();
|
||||
}
|
||||
}
|
||||
|
||||
[Function(Name="dbo.NearestDinners", IsComposable=true)]
|
||||
public IQueryable<NearestDinnersResult> NearestDinners([Parameter(DbType="Real")] System.Nullable<float> lat, [Parameter(Name="long", DbType="Real")] System.Nullable<float> @long)
|
||||
{
|
||||
return this.CreateMethodCallQuery<NearestDinnersResult>(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), lat, @long);
|
||||
}
|
||||
|
||||
[Function(Name="dbo.DistanceBetween", IsComposable=true)]
|
||||
public System.Nullable<float> DistanceBetween([Parameter(Name="Lat1", DbType="Real")] System.Nullable<float> lat1, [Parameter(Name="Long1", DbType="Real")] System.Nullable<float> long1, [Parameter(Name="Lat2", DbType="Real")] System.Nullable<float> lat2, [Parameter(Name="Long2", DbType="Real")] System.Nullable<float> long2)
|
||||
{
|
||||
return ((System.Nullable<float>)(this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), lat1, long1, lat2, long2).ReturnValue));
|
||||
}
|
||||
}
|
||||
|
||||
[Table(Name="dbo.Dinners")]
|
||||
public partial class Dinner : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private int _DinnerID;
|
||||
|
||||
private string _Title;
|
||||
|
||||
private System.DateTime _EventDate;
|
||||
|
||||
private string _Description;
|
||||
|
||||
private string _HostedBy;
|
||||
|
||||
private string _ContactPhone;
|
||||
|
||||
private string _Address;
|
||||
|
||||
private string _Country;
|
||||
|
||||
private double _Latitude;
|
||||
|
||||
private double _Longitude;
|
||||
|
||||
private EntitySet<RSVP> _RSVPs;
|
||||
|
||||
#region Extensibility Method Definitions
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnDinnerIDChanging(int value);
|
||||
partial void OnDinnerIDChanged();
|
||||
partial void OnTitleChanging(string value);
|
||||
partial void OnTitleChanged();
|
||||
partial void OnEventDateChanging(System.DateTime value);
|
||||
partial void OnEventDateChanged();
|
||||
partial void OnDescriptionChanging(string value);
|
||||
partial void OnDescriptionChanged();
|
||||
partial void OnHostedByChanging(string value);
|
||||
partial void OnHostedByChanged();
|
||||
partial void OnContactPhoneChanging(string value);
|
||||
partial void OnContactPhoneChanged();
|
||||
partial void OnAddressChanging(string value);
|
||||
partial void OnAddressChanged();
|
||||
partial void OnCountryChanging(string value);
|
||||
partial void OnCountryChanged();
|
||||
partial void OnLatitudeChanging(double value);
|
||||
partial void OnLatitudeChanged();
|
||||
partial void OnLongitudeChanging(double value);
|
||||
partial void OnLongitudeChanged();
|
||||
#endregion
|
||||
|
||||
public Dinner()
|
||||
{
|
||||
this._RSVPs = new EntitySet<RSVP>(new Action<RSVP>(this.attach_RSVPs), new Action<RSVP>(this.detach_RSVPs));
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[Column(Storage="_DinnerID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
|
||||
public int DinnerID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._DinnerID;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._DinnerID != value))
|
||||
{
|
||||
this.OnDinnerIDChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._DinnerID = value;
|
||||
this.SendPropertyChanged("DinnerID");
|
||||
this.OnDinnerIDChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_Title", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Title;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Title != value))
|
||||
{
|
||||
this.OnTitleChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Title = value;
|
||||
this.SendPropertyChanged("Title");
|
||||
this.OnTitleChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_EventDate", DbType="DateTime NOT NULL")]
|
||||
public System.DateTime EventDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._EventDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._EventDate != value))
|
||||
{
|
||||
this.OnEventDateChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._EventDate = value;
|
||||
this.SendPropertyChanged("EventDate");
|
||||
this.OnEventDateChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_Description", DbType="NVarChar(256)")]
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Description;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Description != value))
|
||||
{
|
||||
this.OnDescriptionChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Description = value;
|
||||
this.SendPropertyChanged("Description");
|
||||
this.OnDescriptionChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_HostedBy", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string HostedBy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._HostedBy;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._HostedBy != value))
|
||||
{
|
||||
this.OnHostedByChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._HostedBy = value;
|
||||
this.SendPropertyChanged("HostedBy");
|
||||
this.OnHostedByChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_ContactPhone", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string ContactPhone
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ContactPhone;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._ContactPhone != value))
|
||||
{
|
||||
this.OnContactPhoneChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._ContactPhone = value;
|
||||
this.SendPropertyChanged("ContactPhone");
|
||||
this.OnContactPhoneChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_Address", DbType="NVarChar(50)")]
|
||||
public string Address
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Address;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Address != value))
|
||||
{
|
||||
this.OnAddressChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Address = value;
|
||||
this.SendPropertyChanged("Address");
|
||||
this.OnAddressChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_Country", DbType="NVarChar(30)")]
|
||||
public string Country
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Country;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Country != value))
|
||||
{
|
||||
this.OnCountryChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Country = value;
|
||||
this.SendPropertyChanged("Country");
|
||||
this.OnCountryChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_Latitude", DbType="Float NOT NULL")]
|
||||
public double Latitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Latitude;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Latitude != value))
|
||||
{
|
||||
this.OnLatitudeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Latitude = value;
|
||||
this.SendPropertyChanged("Latitude");
|
||||
this.OnLatitudeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_Longitude", DbType="Float NOT NULL")]
|
||||
public double Longitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Longitude;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._Longitude != value))
|
||||
{
|
||||
this.OnLongitudeChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._Longitude = value;
|
||||
this.SendPropertyChanged("Longitude");
|
||||
this.OnLongitudeChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Association(Name="Dinner_RSVP", Storage="_RSVPs", ThisKey="DinnerID", OtherKey="DinnerID")]
|
||||
public EntitySet<RSVP> RSVPs
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._RSVPs;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._RSVPs.Assign(value);
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
private void attach_RSVPs(RSVP entity)
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
entity.Dinner = this;
|
||||
}
|
||||
|
||||
private void detach_RSVPs(RSVP entity)
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
entity.Dinner = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Table(Name="dbo.RSVP")]
|
||||
public partial class RSVP : INotifyPropertyChanging, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
|
||||
|
||||
private int _RsvpID;
|
||||
|
||||
private int _DinnerID;
|
||||
|
||||
private string _AttendeeName;
|
||||
|
||||
private EntityRef<Dinner> _Dinner;
|
||||
|
||||
#region Extensibility Method Definitions
|
||||
partial void OnLoaded();
|
||||
partial void OnValidate(System.Data.Linq.ChangeAction action);
|
||||
partial void OnCreated();
|
||||
partial void OnRsvpIDChanging(int value);
|
||||
partial void OnRsvpIDChanged();
|
||||
partial void OnDinnerIDChanging(int value);
|
||||
partial void OnDinnerIDChanged();
|
||||
partial void OnAttendeeNameChanging(string value);
|
||||
partial void OnAttendeeNameChanged();
|
||||
#endregion
|
||||
|
||||
public RSVP()
|
||||
{
|
||||
this._Dinner = default(EntityRef<Dinner>);
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
[Column(Storage="_RsvpID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
|
||||
public int RsvpID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._RsvpID;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._RsvpID != value))
|
||||
{
|
||||
this.OnRsvpIDChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._RsvpID = value;
|
||||
this.SendPropertyChanged("RsvpID");
|
||||
this.OnRsvpIDChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_DinnerID", DbType="Int NOT NULL")]
|
||||
public int DinnerID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._DinnerID;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._DinnerID != value))
|
||||
{
|
||||
if (this._Dinner.HasLoadedOrAssignedValue)
|
||||
{
|
||||
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
|
||||
}
|
||||
this.OnDinnerIDChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._DinnerID = value;
|
||||
this.SendPropertyChanged("DinnerID");
|
||||
this.OnDinnerIDChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Column(Storage="_AttendeeName", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
|
||||
public string AttendeeName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._AttendeeName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._AttendeeName != value))
|
||||
{
|
||||
this.OnAttendeeNameChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._AttendeeName = value;
|
||||
this.SendPropertyChanged("AttendeeName");
|
||||
this.OnAttendeeNameChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Association(Name="Dinner_RSVP", Storage="_Dinner", ThisKey="DinnerID", OtherKey="DinnerID", IsForeignKey=true)]
|
||||
public Dinner Dinner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Dinner.Entity;
|
||||
}
|
||||
set
|
||||
{
|
||||
Dinner previousValue = this._Dinner.Entity;
|
||||
if (((previousValue != value)
|
||||
|| (this._Dinner.HasLoadedOrAssignedValue == false)))
|
||||
{
|
||||
this.SendPropertyChanging();
|
||||
if ((previousValue != null))
|
||||
{
|
||||
this._Dinner.Entity = null;
|
||||
previousValue.RSVPs.Remove(this);
|
||||
}
|
||||
this._Dinner.Entity = value;
|
||||
if ((value != null))
|
||||
{
|
||||
value.RSVPs.Add(this);
|
||||
this._DinnerID = value.DinnerID;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._DinnerID = default(int);
|
||||
}
|
||||
this.SendPropertyChanged("Dinner");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangingEventHandler PropertyChanging;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void SendPropertyChanging()
|
||||
{
|
||||
if ((this.PropertyChanging != null))
|
||||
{
|
||||
this.PropertyChanging(this, emptyChangingEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SendPropertyChanged(String propertyName)
|
||||
{
|
||||
if ((this.PropertyChanged != null))
|
||||
{
|
||||
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NearestDinnersResult
|
||||
{
|
||||
|
||||
private int _DinnerID;
|
||||
|
||||
public NearestDinnersResult()
|
||||
{
|
||||
}
|
||||
|
||||
[Column(Storage="_DinnerID", DbType="Int NOT NULL")]
|
||||
public int DinnerID
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._DinnerID;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._DinnerID != value))
|
||||
{
|
||||
this._DinnerID = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace NerdDinner.Models {
|
||||
|
||||
public class RuleViolation {
|
||||
|
||||
public string ErrorMessage { get; private set; }
|
||||
public string PropertyName { get; private set; }
|
||||
|
||||
public RuleViolation(string errorMessage) {
|
||||
ErrorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public RuleViolation(string errorMessage, string propertyName) {
|
||||
ErrorMessage = errorMessage;
|
||||
PropertyName = propertyName;
|
||||
}
|
||||
}
|
||||
}
|
215
aspclassiccompiler/Backup/NerdDinnerAsp/NerdDinnerAsp.csproj
Normal file
215
aspclassiccompiler/Backup/NerdDinnerAsp/NerdDinnerAsp.csproj
Normal file
|
@ -0,0 +1,215 @@
|
|||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{328C148C-DBEE-41A4-B1C7-104CBB216556}</ProjectGuid>
|
||||
<ProjectTypeGuids>{603c0e0b-db56-11dc-be95-000d561079b0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>NerdDinner</RootNamespace>
|
||||
<AssemblyName>NerdDinner</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Dlrsoft.Asp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\asp\bin\Release\Dlrsoft.Asp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Assemblies\System.Web.Abstractions.dll</HintPath>
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Assemblies\System.Web.Mvc.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Assemblies\System.Web.Routing.dll</HintPath>
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.Mobile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controllers\AccountController.cs" />
|
||||
<Compile Include="Controllers\DinnersController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Controllers\SearchController.cs" />
|
||||
<Compile Include="Controllers\RSVPController.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Default.aspx.cs">
|
||||
<DependentUpon>Default.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\ControllerHelpers.cs" />
|
||||
<Compile Include="Helpers\PaginatedList.cs" />
|
||||
<Compile Include="Helpers\PhoneValidator.cs" />
|
||||
<Compile Include="Models\Dinner.cs" />
|
||||
<Compile Include="Models\DinnerRepository.cs" />
|
||||
<Compile Include="Models\IDinnerRepository.cs" />
|
||||
<Compile Include="Models\NerdDinner.designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>NerdDinner.dbml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\RuleViolation.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App_Data\NerdDinner.mdf">
|
||||
</Content>
|
||||
<Content Include="App_Data\NerdDinner_log.ldf">
|
||||
<DependentUpon>NerdDinner.mdf</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Content\nerd.jpg" />
|
||||
<Content Include="Default.aspx" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Scripts\Map.js" />
|
||||
<None Include="Views\Dinners\DinnerForm.asc" />
|
||||
<None Include="Views\Dinners\DinnerForm.ascx.bak" />
|
||||
<None Include="Views\Dinners\EditAndDeleteLinks.asc" />
|
||||
<None Include="Views\Dinners\EditAndDeleteLinks.ascx.bak" />
|
||||
<None Include="Views\Dinners\RSVPStatus.asc" />
|
||||
<Content Include="Views\Dinners\Map.asp" />
|
||||
<Content Include="Views\Dinners\Index.asp" />
|
||||
<None Include="Views\Dinners\RSVPStatus.ascx.bak">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</None>
|
||||
<None Include="Views\Dinners\Map.ascx.bak" />
|
||||
<Content Include="Views\Dinners\Edit.asp" />
|
||||
<Content Include="Views\Dinners\Create.asp" />
|
||||
<Content Include="Views\Dinners\Details.asp" />
|
||||
<Content Include="Views\Dinners\Delete.asp" />
|
||||
<Content Include="Views\Dinners\InvalidOwner.asp" />
|
||||
<Content Include="Views\Dinners\NotFound.asp" />
|
||||
<Content Include="Views\Dinners\Deleted.asp" />
|
||||
<Content Include="Views\Home\Index.asp" />
|
||||
<Content Include="Views\Home\About.asp" />
|
||||
<Content Include="Views\Shared\header.asp" />
|
||||
<Content Include="Views\Shared\template.asp" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Content\Site.css" />
|
||||
<Content Include="Scripts\jquery-1.2.6.js" />
|
||||
<Content Include="Scripts\jquery-1.2.6.min.js" />
|
||||
<Content Include="Scripts\jquery-1.2.6-vsdoc.js" />
|
||||
<Content Include="Scripts\jquery-1.2.6.min-vsdoc.js" />
|
||||
<Content Include="Scripts\MicrosoftAjax.js" />
|
||||
<Content Include="Scripts\MicrosoftAjax.debug.js" />
|
||||
<Content Include="Scripts\MicrosoftMvcAjax.js" />
|
||||
<Content Include="Scripts\MicrosoftMvcAjax.debug.js" />
|
||||
<Content Include="Views\Account\ChangePassword.aspx" />
|
||||
<Content Include="Views\Account\ChangePasswordSuccess.aspx" />
|
||||
<Content Include="Views\Account\LogOn.aspx" />
|
||||
<Content Include="Views\Account\Register.aspx" />
|
||||
<Content Include="Views\Shared\Error.aspx" />
|
||||
<Content Include="Views\Shared\LoginStatus.ascx" />
|
||||
<Content Include="Views\Shared\Site.Master" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Models\NerdDinner.dbml">
|
||||
<Generator>MSLinqToSQLGenerator</Generator>
|
||||
<LastGenOutput>NerdDinner.designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Models\NerdDinner.dbml.layout">
|
||||
<DependentUpon>NerdDinner.dbml</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target> -->
|
||||
<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>60848</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
|
@ -0,0 +1,35 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("NerdDinner")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NerdDinner")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("3f961952-a5a3-4ca2-bc29-5b46b500177d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.2.32072")]
|
138
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/Map.js
Normal file
138
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/Map.js
Normal file
|
@ -0,0 +1,138 @@
|
|||
/// <reference path="jquery-1.2.6.js" />
|
||||
|
||||
var map = null;
|
||||
var points = [];
|
||||
var shapes = [];
|
||||
var center = null;
|
||||
|
||||
function LoadMap(latitude, longitude, onMapLoaded) {
|
||||
map = new VEMap('theMap');
|
||||
options = new VEMapOptions();
|
||||
options.EnableBirdseye = false;
|
||||
|
||||
// Makes the control bar less obtrusize.
|
||||
map.SetDashboardSize(VEDashboardSize.Small);
|
||||
|
||||
if (onMapLoaded != null)
|
||||
map.onLoadMap = onMapLoaded;
|
||||
|
||||
if (latitude != null && longitude != null) {
|
||||
center = new VELatLong(latitude, longitude);
|
||||
}
|
||||
|
||||
map.LoadMap(center, null, null, null, null, null, null, options);
|
||||
}
|
||||
|
||||
function LoadPin(LL, name, description) {
|
||||
var shape = new VEShape(VEShapeType.Pushpin, LL);
|
||||
|
||||
//Make a nice Pushpin shape with a title and description
|
||||
shape.SetTitle("<span class=\"pinTitle\"> " + escape(name) + "</span>");
|
||||
if (description !== undefined) {
|
||||
shape.SetDescription("<p class=\"pinDetails\">" +
|
||||
escape(description) + "</p>");
|
||||
}
|
||||
map.AddShape(shape);
|
||||
points.push(LL);
|
||||
shapes.push(shape);
|
||||
}
|
||||
|
||||
function FindAddressOnMap(where) {
|
||||
var numberOfResults = 20;
|
||||
var setBestMapView = true;
|
||||
var showResults = true;
|
||||
|
||||
map.Find("", where, null, null, null,
|
||||
numberOfResults, showResults, true, true,
|
||||
setBestMapView, callbackForLocation);
|
||||
}
|
||||
|
||||
function callbackForLocation(layer, resultsArray, places,
|
||||
hasMore, VEErrorMessage) {
|
||||
|
||||
clearMap();
|
||||
|
||||
if (places == null)
|
||||
return;
|
||||
|
||||
//Make a pushpin for each place we find
|
||||
$.each(places, function(i, item) {
|
||||
var description = "";
|
||||
if (item.Description !== undefined) {
|
||||
description = item.Description;
|
||||
}
|
||||
var LL = new VELatLong(item.LatLong.Latitude,
|
||||
item.LatLong.Longitude);
|
||||
|
||||
LoadPin(LL, item.Name, description);
|
||||
});
|
||||
|
||||
//Make sure all pushpins are visible
|
||||
if (points.length > 1) {
|
||||
map.SetMapView(points);
|
||||
}
|
||||
|
||||
//If we've found exactly one place, that's our address.
|
||||
if (points.length === 1) {
|
||||
$("#Latitude").val(points[0].Latitude);
|
||||
$("#Longitude").val(points[0].Longitude);
|
||||
}
|
||||
}
|
||||
|
||||
function clearMap() {
|
||||
map.Clear();
|
||||
points = [];
|
||||
shapes = [];
|
||||
}
|
||||
|
||||
function FindDinnersGivenLocation(where) {
|
||||
map.Find("", where, null, null, null, null, null, false,
|
||||
null, null, callbackUpdateMapDinners);
|
||||
}
|
||||
|
||||
function callbackUpdateMapDinners(layer, resultsArray, places, hasMore, VEErrorMessage) {
|
||||
$("#dinnerList").empty();
|
||||
clearMap();
|
||||
var center = map.GetCenter();
|
||||
|
||||
$.post("/Search/SearchByLocation", { latitude: center.Latitude,
|
||||
longitude: center.Longitude
|
||||
}, function(dinners) {
|
||||
$.each(dinners, function(i, dinner) {
|
||||
|
||||
var LL = new VELatLong(dinner.Latitude, dinner.Longitude, 0, null);
|
||||
|
||||
var RsvpMessage = "";
|
||||
|
||||
if (dinner.RSVPCount == 1)
|
||||
RsvpMessage = "" + dinner.RSVPCount + " RSVP";
|
||||
else
|
||||
RsvpMessage = "" + dinner.RSVPCount + " RSVPs";
|
||||
|
||||
// Add Pin to Map
|
||||
LoadPin(LL, '<a href="/Dinners/Details/' + dinner.DinnerID + '">'
|
||||
+ dinner.Title + '</a>',
|
||||
"<p>" + dinner.Description + "</p>" + RsvpMessage);
|
||||
|
||||
//Add a dinner to the <ul> dinnerList on the right
|
||||
$('#dinnerList').append($('<li/>')
|
||||
.attr("class", "dinnerItem")
|
||||
.append($('<a/>').attr("href",
|
||||
"/Dinners/Details/" + dinner.DinnerID)
|
||||
.html(dinner.Title)).append(" ("+RsvpMessage+")"));
|
||||
});
|
||||
|
||||
// Adjust zoom to display all the pins we just added.
|
||||
if (points.length > 1) {
|
||||
map.SetMapView(points);
|
||||
}
|
||||
|
||||
// Display the event's pin-bubble on hover.
|
||||
$(".dinnerItem").each(function(i, dinner) {
|
||||
$(dinner).hover(
|
||||
function() { map.ShowInfoBox(shapes[i]); },
|
||||
function() { map.HideInfoBox(shapes[i]); }
|
||||
);
|
||||
});
|
||||
}, "json");
|
||||
}
|
6850
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftAjax.debug.js
vendored
Normal file
6850
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftAjax.debug.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
7
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftAjax.js
vendored
Normal file
7
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftAjax.js
vendored
Normal file
File diff suppressed because one or more lines are too long
337
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftMvcAjax.debug.js
vendored
Normal file
337
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftMvcAjax.debug.js
vendored
Normal file
|
@ -0,0 +1,337 @@
|
|||
//----------------------------------------------------------
|
||||
// Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
//----------------------------------------------------------
|
||||
// MicrosoftMvcAjax.js
|
||||
|
||||
Type.registerNamespace('Sys.Mvc');
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sys.Mvc.AjaxOptions
|
||||
|
||||
Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; }
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sys.Mvc.InsertionMode
|
||||
|
||||
Sys.Mvc.InsertionMode = function() {
|
||||
/// <field name="replace" type="Number" integer="true" static="true">
|
||||
/// </field>
|
||||
/// <field name="insertBefore" type="Number" integer="true" static="true">
|
||||
/// </field>
|
||||
/// <field name="insertAfter" type="Number" integer="true" static="true">
|
||||
/// </field>
|
||||
};
|
||||
Sys.Mvc.InsertionMode.prototype = {
|
||||
replace: 0,
|
||||
insertBefore: 1,
|
||||
insertAfter: 2
|
||||
}
|
||||
Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sys.Mvc.AjaxContext
|
||||
|
||||
Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) {
|
||||
/// <param name="request" type="Sys.Net.WebRequest">
|
||||
/// </param>
|
||||
/// <param name="updateTarget" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <param name="loadingElement" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
|
||||
/// </param>
|
||||
/// <field name="_insertionMode" type="Sys.Mvc.InsertionMode">
|
||||
/// </field>
|
||||
/// <field name="_loadingElement" type="Object" domElement="true">
|
||||
/// </field>
|
||||
/// <field name="_response" type="Sys.Net.WebRequestExecutor">
|
||||
/// </field>
|
||||
/// <field name="_request" type="Sys.Net.WebRequest">
|
||||
/// </field>
|
||||
/// <field name="_updateTarget" type="Object" domElement="true">
|
||||
/// </field>
|
||||
this._request = request;
|
||||
this._updateTarget = updateTarget;
|
||||
this._loadingElement = loadingElement;
|
||||
this._insertionMode = insertionMode;
|
||||
}
|
||||
Sys.Mvc.AjaxContext.prototype = {
|
||||
_insertionMode: 0,
|
||||
_loadingElement: null,
|
||||
_response: null,
|
||||
_request: null,
|
||||
_updateTarget: null,
|
||||
|
||||
get_data: function Sys_Mvc_AjaxContext$get_data() {
|
||||
/// <value type="String"></value>
|
||||
if (this._response) {
|
||||
return this._response.get_responseData();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() {
|
||||
/// <value type="Sys.Mvc.InsertionMode"></value>
|
||||
return this._insertionMode;
|
||||
},
|
||||
|
||||
get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() {
|
||||
/// <value type="Object" domElement="true"></value>
|
||||
return this._loadingElement;
|
||||
},
|
||||
|
||||
get_response: function Sys_Mvc_AjaxContext$get_response() {
|
||||
/// <value type="Sys.Net.WebRequestExecutor"></value>
|
||||
return this._response;
|
||||
},
|
||||
set_response: function Sys_Mvc_AjaxContext$set_response(value) {
|
||||
/// <value type="Sys.Net.WebRequestExecutor"></value>
|
||||
this._response = value;
|
||||
return value;
|
||||
},
|
||||
|
||||
get_request: function Sys_Mvc_AjaxContext$get_request() {
|
||||
/// <value type="Sys.Net.WebRequest"></value>
|
||||
return this._request;
|
||||
},
|
||||
|
||||
get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() {
|
||||
/// <value type="Object" domElement="true"></value>
|
||||
return this._updateTarget;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sys.Mvc.AsyncHyperlink
|
||||
|
||||
Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() {
|
||||
}
|
||||
Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) {
|
||||
/// <param name="anchor" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <param name="evt" type="Sys.UI.DomEvent">
|
||||
/// </param>
|
||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
||||
/// </param>
|
||||
evt.preventDefault();
|
||||
Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sys.Mvc.MvcHelpers
|
||||
|
||||
Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() {
|
||||
}
|
||||
Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) {
|
||||
/// <param name="form" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <returns type="String"></returns>
|
||||
var formElements = form.elements;
|
||||
var formBody = new Sys.StringBuilder();
|
||||
var count = formElements.length;
|
||||
for (var i = 0; i < count; i++) {
|
||||
var element = formElements[i];
|
||||
var name = element.name;
|
||||
if (!name || !name.length) {
|
||||
continue;
|
||||
}
|
||||
var tagName = element.tagName.toUpperCase();
|
||||
if (tagName === 'INPUT') {
|
||||
var inputElement = element;
|
||||
var type = inputElement.type;
|
||||
if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) {
|
||||
formBody.append(encodeURIComponent(name));
|
||||
formBody.append('=');
|
||||
formBody.append(encodeURIComponent(inputElement.value));
|
||||
formBody.append('&');
|
||||
}
|
||||
}
|
||||
else if (tagName === 'SELECT') {
|
||||
var selectElement = element;
|
||||
var optionCount = selectElement.options.length;
|
||||
for (var j = 0; j < optionCount; j++) {
|
||||
var optionElement = selectElement.options[j];
|
||||
if (optionElement.selected) {
|
||||
formBody.append(encodeURIComponent(name));
|
||||
formBody.append('=');
|
||||
formBody.append(encodeURIComponent(optionElement.value));
|
||||
formBody.append('&');
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tagName === 'TEXTAREA') {
|
||||
formBody.append(encodeURIComponent(name));
|
||||
formBody.append('=');
|
||||
formBody.append(encodeURIComponent((element.value)));
|
||||
formBody.append('&');
|
||||
}
|
||||
}
|
||||
return formBody.toString();
|
||||
}
|
||||
Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) {
|
||||
/// <param name="url" type="String">
|
||||
/// </param>
|
||||
/// <param name="verb" type="String">
|
||||
/// </param>
|
||||
/// <param name="body" type="String">
|
||||
/// </param>
|
||||
/// <param name="triggerElement" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
||||
/// </param>
|
||||
if (ajaxOptions.confirm) {
|
||||
if (!confirm(ajaxOptions.confirm)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ajaxOptions.url) {
|
||||
url = ajaxOptions.url;
|
||||
}
|
||||
if (ajaxOptions.httpMethod) {
|
||||
verb = ajaxOptions.httpMethod;
|
||||
}
|
||||
if (body.length > 0 && !body.endsWith('&')) {
|
||||
body += '&';
|
||||
}
|
||||
body += 'X-Requested-With=XMLHttpRequest';
|
||||
var requestBody = '';
|
||||
if (verb.toUpperCase() === 'GET' || verb.toUpperCase() === 'DELETE') {
|
||||
if (url.indexOf('?') > -1) {
|
||||
if (!url.endsWith('&')) {
|
||||
url += '&';
|
||||
}
|
||||
url += body;
|
||||
}
|
||||
else {
|
||||
url += '?';
|
||||
url += body;
|
||||
}
|
||||
}
|
||||
else {
|
||||
requestBody = body;
|
||||
}
|
||||
var request = new Sys.Net.WebRequest();
|
||||
request.set_url(url);
|
||||
request.set_httpVerb(verb);
|
||||
request.set_body(requestBody);
|
||||
if (verb.toUpperCase() === 'PUT') {
|
||||
request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;';
|
||||
}
|
||||
request.get_headers()['X-Requested-With'] = 'XMLHttpRequest';
|
||||
var updateElement = null;
|
||||
if (ajaxOptions.updateTargetId) {
|
||||
updateElement = $get(ajaxOptions.updateTargetId);
|
||||
}
|
||||
var loadingElement = null;
|
||||
if (ajaxOptions.loadingElementId) {
|
||||
loadingElement = $get(ajaxOptions.loadingElementId);
|
||||
}
|
||||
var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode);
|
||||
var continueRequest = true;
|
||||
if (ajaxOptions.onBegin) {
|
||||
continueRequest = ajaxOptions.onBegin(ajaxContext) !== false;
|
||||
}
|
||||
if (loadingElement) {
|
||||
Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true);
|
||||
}
|
||||
if (continueRequest) {
|
||||
request.add_completed(Function.createDelegate(null, function(executor) {
|
||||
Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext);
|
||||
}));
|
||||
request.invoke();
|
||||
}
|
||||
}
|
||||
Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) {
|
||||
/// <param name="request" type="Sys.Net.WebRequest">
|
||||
/// </param>
|
||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
||||
/// </param>
|
||||
/// <param name="ajaxContext" type="Sys.Mvc.AjaxContext">
|
||||
/// </param>
|
||||
ajaxContext.set_response(request.get_executor());
|
||||
if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) {
|
||||
return;
|
||||
}
|
||||
var statusCode = ajaxContext.get_response().get_statusCode();
|
||||
if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) {
|
||||
if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) {
|
||||
var contentType = ajaxContext.get_response().getResponseHeader('Content-Type');
|
||||
if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) {
|
||||
eval(ajaxContext.get_data());
|
||||
}
|
||||
else {
|
||||
Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data());
|
||||
}
|
||||
}
|
||||
if (ajaxOptions.onSuccess) {
|
||||
ajaxOptions.onSuccess(ajaxContext);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ajaxOptions.onFailure) {
|
||||
ajaxOptions.onFailure(ajaxContext);
|
||||
}
|
||||
}
|
||||
if (ajaxContext.get_loadingElement()) {
|
||||
Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false);
|
||||
}
|
||||
}
|
||||
Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) {
|
||||
/// <param name="target" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
|
||||
/// </param>
|
||||
/// <param name="content" type="String">
|
||||
/// </param>
|
||||
if (target) {
|
||||
switch (insertionMode) {
|
||||
case Sys.Mvc.InsertionMode.replace:
|
||||
target.innerHTML = content;
|
||||
break;
|
||||
case Sys.Mvc.InsertionMode.insertBefore:
|
||||
if (content && content.length > 0) {
|
||||
target.innerHTML = content + target.innerHTML.trimStart();
|
||||
}
|
||||
break;
|
||||
case Sys.Mvc.InsertionMode.insertAfter:
|
||||
if (content && content.length > 0) {
|
||||
target.innerHTML = target.innerHTML.trimEnd() + content;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Sys.Mvc.AsyncForm
|
||||
|
||||
Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() {
|
||||
}
|
||||
Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) {
|
||||
/// <param name="form" type="Object" domElement="true">
|
||||
/// </param>
|
||||
/// <param name="evt" type="Sys.UI.DomEvent">
|
||||
/// </param>
|
||||
/// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
|
||||
/// </param>
|
||||
evt.preventDefault();
|
||||
var body = Sys.Mvc.MvcHelpers._serializeForm(form);
|
||||
Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions);
|
||||
}
|
||||
|
||||
|
||||
Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');
|
||||
Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');
|
||||
Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');
|
||||
Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
|
||||
|
||||
// ---- Do not remove this footer ----
|
||||
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
|
||||
// -----------------------------------
|
19
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftMvcAjax.js
vendored
Normal file
19
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/MicrosoftMvcAjax.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};}
|
||||
Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2}
|
||||
Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;}
|
||||
Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}}
|
||||
Sys.Mvc.AsyncHyperlink=function(){}
|
||||
Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$1(anchor.href,'post','',anchor,ajaxOptions);}
|
||||
Sys.Mvc.MvcHelpers=function(){}
|
||||
Sys.Mvc.MvcHelpers.$0=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $3=0;$3<$2;$3++){var $4=$0[$3];var $5=$4.name;if(!$5||!$5.length){continue;}var $6=$4.tagName.toUpperCase();if($6==='INPUT'){var $7=$4;var $8=$7.type;if(($8==='text')||($8==='password')||($8==='hidden')||((($8==='checkbox')||($8==='radio'))&&$4.checked)){$1.append(encodeURIComponent($5));$1.append('=');$1.append(encodeURIComponent($7.value));$1.append('&');}}else if($6==='SELECT'){var $9=$4;var $A=$9.options.length;for(var $B=0;$B<$A;$B++){var $C=$9.options[$B];if($C.selected){$1.append(encodeURIComponent($5));$1.append('=');$1.append(encodeURIComponent($C.value));$1.append('&');}}}else if($6==='TEXTAREA'){$1.append(encodeURIComponent($5));$1.append('=');$1.append(encodeURIComponent(($4.value)));$1.append('&');}}return $1.toString();}
|
||||
Sys.Mvc.MvcHelpers.$1=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0='';if($p1.toUpperCase()==='GET'||$p1.toUpperCase()==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$0=$p2;}var $1=new Sys.Net.WebRequest();$1.set_url($p0);$1.set_httpVerb($p1);$1.set_body($0);if($p1.toUpperCase()==='PUT'){$1.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$1.get_headers()['X-Requested-With']='XMLHttpRequest';var $2=null;if($p4.updateTargetId){$2=$get($p4.updateTargetId);}var $3=null;if($p4.loadingElementId){$3=$get($p4.loadingElementId);}var $4=new Sys.Mvc.AjaxContext($1,$2,$3,$p4.insertionMode);var $5=true;if($p4.onBegin){$5=$p4.onBegin($4)!==false;}if($3){Sys.UI.DomElement.setVisible($4.get_loadingElement(),true);}if($5){$1.add_completed(Function.createDelegate(null,function($p1_0){
|
||||
Sys.Mvc.MvcHelpers.$2($1,$p4,$4);}));$1.invoke();}}
|
||||
Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}}
|
||||
Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}}
|
||||
Sys.Mvc.AsyncForm=function(){}
|
||||
Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=Sys.Mvc.MvcHelpers.$0(form);Sys.Mvc.MvcHelpers.$1(form.action,form.method||'post',$0,form,ajaxOptions);}
|
||||
Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
|
||||
// ---- Do not remove this footer ----
|
||||
// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
|
||||
// -----------------------------------
|
5367
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6-vsdoc.js
vendored
Normal file
5367
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6-vsdoc.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
3566
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6.js
vendored
Normal file
3566
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
5367
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6.min-vsdoc.js
vendored
Normal file
5367
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6.min-vsdoc.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
49
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6.min.js
vendored
Normal file
49
aspclassiccompiler/Backup/NerdDinnerAsp/Scripts/jquery-1.2.6.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,42 @@
|
|||
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
|
||||
<asp:Content ID="title" ContentPlaceHolderID="TitleContent" runat="server">
|
||||
Change Password
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="changePasswordContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h2>Change Password</h2>
|
||||
<p>
|
||||
Use the form below to change your password.
|
||||
</p>
|
||||
<p>
|
||||
New passwords are required to be a minimum of <%=Html.Encode(ViewData["PasswordLength"])%> characters in length.
|
||||
</p>
|
||||
<%= Html.ValidationSummary() %>
|
||||
|
||||
<% using (Html.BeginForm()) { %>
|
||||
<div>
|
||||
<fieldset>
|
||||
<legend>Account Information</legend>
|
||||
<p>
|
||||
<label for="currentPassword">Current password:</label>
|
||||
<%= Html.Password("currentPassword") %>
|
||||
<%= Html.ValidationMessage("currentPassword") %>
|
||||
</p>
|
||||
<p>
|
||||
<label for="newPassword">New password:</label>
|
||||
<%= Html.Password("newPassword") %>
|
||||
<%= Html.ValidationMessage("newPassword") %>
|
||||
</p>
|
||||
<p>
|
||||
<label for="confirmPassword">Confirm new password:</label>
|
||||
<%= Html.Password("confirmPassword") %>
|
||||
<%= Html.ValidationMessage("confirmPassword") %>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Change Password" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
<% } %>
|
||||
</asp:Content>
|
|
@ -0,0 +1,12 @@
|
|||
<%@Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
|
||||
<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
|
||||
Change Password
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="changePasswordSuccessContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h2>Change Password</h2>
|
||||
<p>
|
||||
Your password has been changed successfully.
|
||||
</p>
|
||||
</asp:Content>
|
|
@ -0,0 +1,37 @@
|
|||
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
|
||||
|
||||
<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
|
||||
Log On
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h2>Log On</h2>
|
||||
<p>
|
||||
Please enter your username and password. <%= Html.ActionLink("Register", "Register") %> if you don't have an account.
|
||||
</p>
|
||||
<%= Html.ValidationSummary() %>
|
||||
|
||||
<% using (Html.BeginForm()) { %>
|
||||
<div>
|
||||
<fieldset>
|
||||
<legend>Account Information</legend>
|
||||
<p>
|
||||
<label for="username">Username:</label>
|
||||
<%= Html.TextBox("username") %>
|
||||
<%= Html.ValidationMessage("username") %>
|
||||
</p>
|
||||
<p>
|
||||
<label for="password">Password:</label>
|
||||
<%= Html.Password("password") %>
|
||||
<%= Html.ValidationMessage("password") %>
|
||||
</p>
|
||||
<p>
|
||||
<%= Html.CheckBox("rememberMe") %> <label class="inline" for="rememberMe">Remember me?</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Log On" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
<% } %>
|
||||
</asp:Content>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue