Skip to content

Commit fee10bb

Browse files
committed
ASP html and web controls
1 parent 3fc0637 commit fee10bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2259
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProductVersion>
8+
</ProductVersion>
9+
<SchemaVersion>2.0</SchemaVersion>
10+
<ProjectGuid>{305B365F-2027-4E32-BD61-56F941D5D0EA}</ProjectGuid>
11+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
12+
<OutputType>Library</OutputType>
13+
<AppDesignerFolder>Properties</AppDesignerFolder>
14+
<RootNamespace>_01.RandomNumberGenerator</RootNamespace>
15+
<AssemblyName>01.RandomNumberGenerator</AssemblyName>
16+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
17+
<UseIISExpress>true</UseIISExpress>
18+
<IISExpressSSLPort />
19+
<IISExpressAnonymousAuthentication />
20+
<IISExpressWindowsAuthentication />
21+
<IISExpressUseClassicPipelineMode />
22+
</PropertyGroup>
23+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
24+
<DebugSymbols>true</DebugSymbols>
25+
<DebugType>full</DebugType>
26+
<Optimize>false</Optimize>
27+
<OutputPath>bin\</OutputPath>
28+
<DefineConstants>DEBUG;TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
33+
<DebugType>pdbonly</DebugType>
34+
<Optimize>true</Optimize>
35+
<OutputPath>bin\</OutputPath>
36+
<DefineConstants>TRACE</DefineConstants>
37+
<ErrorReport>prompt</ErrorReport>
38+
<WarningLevel>4</WarningLevel>
39+
</PropertyGroup>
40+
<ItemGroup>
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Web.DynamicData" />
43+
<Reference Include="System.Web.Entity" />
44+
<Reference Include="System.Web.ApplicationServices" />
45+
<Reference Include="System.ComponentModel.DataAnnotations" />
46+
<Reference Include="System" />
47+
<Reference Include="System.Data" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Data.DataSetExtensions" />
50+
<Reference Include="System.Web.Extensions" />
51+
<Reference Include="System.Xml.Linq" />
52+
<Reference Include="System.Drawing" />
53+
<Reference Include="System.Web" />
54+
<Reference Include="System.Xml" />
55+
<Reference Include="System.Configuration" />
56+
<Reference Include="System.Web.Services" />
57+
<Reference Include="System.EnterpriseServices" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<Content Include="Generator.aspx" />
61+
<Content Include="Global.asax" />
62+
<Content Include="Web.config" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="Generator.aspx.cs">
66+
<DependentUpon>Generator.aspx</DependentUpon>
67+
<SubType>ASPXCodeBehind</SubType>
68+
</Compile>
69+
<Compile Include="Generator.aspx.designer.cs">
70+
<DependentUpon>Generator.aspx</DependentUpon>
71+
</Compile>
72+
<Compile Include="Global.asax.cs">
73+
<DependentUpon>Global.asax</DependentUpon>
74+
</Compile>
75+
<Compile Include="Properties\AssemblyInfo.cs" />
76+
</ItemGroup>
77+
<ItemGroup>
78+
<None Include="Web.Debug.config">
79+
<DependentUpon>Web.config</DependentUpon>
80+
</None>
81+
<None Include="Web.Release.config">
82+
<DependentUpon>Web.config</DependentUpon>
83+
</None>
84+
</ItemGroup>
85+
<ItemGroup>
86+
<Folder Include="App_Data\" />
87+
<Folder Include="Models\" />
88+
</ItemGroup>
89+
<PropertyGroup>
90+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
91+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
92+
</PropertyGroup>
93+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
94+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
95+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
96+
<ProjectExtensions>
97+
<VisualStudio>
98+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
99+
<WebProjectProperties>
100+
<UseIIS>True</UseIIS>
101+
<AutoAssignPort>True</AutoAssignPort>
102+
<DevelopmentServerPort>38685</DevelopmentServerPort>
103+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
104+
<IISUrl>http://localhost:38685/</IISUrl>
105+
<NTLMAuthentication>False</NTLMAuthentication>
106+
<UseCustomServer>False</UseCustomServer>
107+
<CustomServerUrl>
108+
</CustomServerUrl>
109+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
110+
</WebProjectProperties>
111+
</FlavorProperties>
112+
</VisualStudio>
113+
</ProjectExtensions>
114+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
115+
Other similar extension points exist, see Microsoft.Common.targets.
116+
<Target Name="BeforeBuild">
117+
</Target>
118+
<Target Name="AfterBuild">
119+
</Target>
120+
-->
121+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Generator.aspx.cs" Inherits="_01.RandomNumberGenerator.Generator" %>
2+
3+
<!DOCTYPE html>
4+
5+
<html xmlns="http://www.w3.org/1999/xhtml">
6+
<head runat="server">
7+
<title></title>
8+
</head>
9+
<body>
10+
<form runat="server">
11+
<input type="text" id="topBorder" runat="server" />
12+
<input type="text" id="bottomBorder" runat="server" />
13+
<input type="button" runat="server" value="Generate" OnServerClick="GenerateHandler"/>
14+
<input type="text" id="res" runat="server" />
15+
</form>
16+
</body>
17+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.UI;
6+
using System.Web.UI.WebControls;
7+
8+
namespace _01.RandomNumberGenerator
9+
{
10+
public partial class Generator : System.Web.UI.Page
11+
{
12+
protected void GenerateHandler(object sender, EventArgs e)
13+
{
14+
var firstNum = int.Parse(this.bottomBorder.Value);
15+
var secondNum = int.Parse(this.topBorder.Value);
16+
var min = Math.Min(firstNum, secondNum);
17+
var max = Math.Max(firstNum, secondNum);
18+
Random rand = new Random();
19+
var num = rand.Next(min, max);
20+
21+
this.res.Value = num.ToString();
22+
}
23+
}
24+
}

ASP.NET Web Forms/HtmlWebControls/01.RandomNumberGenerator/Generator.aspx.designer.cs

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="_01.RandomNumberGenerator.Global" Language="C#" %>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Security;
6+
using System.Web.SessionState;
7+
8+
namespace _01.RandomNumberGenerator
9+
{
10+
public class Global : System.Web.HttpApplication
11+
{
12+
13+
protected void Application_Start(object sender, EventArgs e)
14+
{
15+
16+
}
17+
18+
protected void Session_Start(object sender, EventArgs e)
19+
{
20+
21+
}
22+
23+
protected void Application_BeginRequest(object sender, EventArgs e)
24+
{
25+
26+
}
27+
28+
protected void Application_AuthenticateRequest(object sender, EventArgs e)
29+
{
30+
31+
}
32+
33+
protected void Application_Error(object sender, EventArgs e)
34+
{
35+
36+
}
37+
38+
protected void Session_End(object sender, EventArgs e)
39+
{
40+
41+
}
42+
43+
protected void Application_End(object sender, EventArgs e)
44+
{
45+
46+
}
47+
}
48+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("_01.RandomNumberGenerator")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("_01.RandomNumberGenerator")]
13+
[assembly: AssemblyCopyright("Copyright © 2013")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("d684f3d6-77f3-4a3a-b706-fbc6691ee804")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Revision and Build Numbers
33+
// by using the '*' as shown below:
34+
[assembly: AssemblyVersion("1.0.0.0")]
35+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
4+
5+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
6+
<!--
7+
In the example below, the "SetAttributes" transform will change the value of
8+
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
9+
finds an attribute "name" that has a value of "MyDB".
10+
11+
<connectionStrings>
12+
<add name="MyDB"
13+
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
14+
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
15+
</connectionStrings>
16+
-->
17+
<system.web>
18+
<!--
19+
In the example below, the "Replace" transform will replace the entire
20+
<customErrors> section of your web.config file.
21+
Note that because there is only one customErrors section under the
22+
<system.web> node, there is no need to use the "xdt:Locator" attribute.
23+
24+
<customErrors defaultRedirect="GenericError.htm"
25+
mode="RemoteOnly" xdt:Transform="Replace">
26+
<error statusCode="500" redirect="InternalError.htm"/>
27+
</customErrors>
28+
-->
29+
</system.web>
30+
</configuration>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
4+
5+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
6+
<!--
7+
In the example below, the "SetAttributes" transform will change the value of
8+
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
9+
finds an attribute "name" that has a value of "MyDB".
10+
11+
<connectionStrings>
12+
<add name="MyDB"
13+
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
14+
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
15+
</connectionStrings>
16+
-->
17+
<system.web>
18+
<compilation xdt:Transform="RemoveAttributes(debug)" />
19+
<!--
20+
In the example below, the "Replace" transform will replace the entire
21+
<customErrors> section of your web.config file.
22+
Note that because there is only one customErrors section under the
23+
<system.web> node, there is no need to use the "xdt:Locator" attribute.
24+
25+
<customErrors defaultRedirect="GenericError.htm"
26+
mode="RemoteOnly" xdt:Transform="Replace">
27+
<error statusCode="500" redirect="InternalError.htm"/>
28+
</customErrors>
29+
-->
30+
</system.web>
31+
</configuration>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
For more information on how to configure your ASP.NET application, please visit
4+
http://go.microsoft.com/fwlink/?LinkId=169433
5+
-->
6+
<configuration>
7+
<system.web>
8+
<compilation debug="true" targetFramework="4.5" />
9+
<httpRuntime targetFramework="4.5" />
10+
</system.web>
11+
</configuration>

0 commit comments

Comments
 (0)