Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2964163

Browse files
intial files
1 parent 1e3af6e commit 2964163

File tree

89 files changed

+79577
-0
lines changed

Some content is hidden

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

89 files changed

+79577
-0
lines changed

‎AJAXCalls/AJAXCalls.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.21005.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AJAXCalls", "AJAXCalls\AJAXCalls.csproj", "{226837E7-A0CF-4CCC-8028-218CAC937658}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{226837E7-A0CF-4CCC-8028-218CAC937658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{226837E7-A0CF-4CCC-8028-218CAC937658}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{226837E7-A0CF-4CCC-8028-218CAC937658}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{226837E7-A0CF-4CCC-8028-218CAC937658}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

‎AJAXCalls/AJAXCalls.v12.suo

61 KB
Binary file not shown.

‎AJAXCalls/AJAXCalls/AJAXCalls.csproj

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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>{226837E7-A0CF-4CCC-8028-218CAC937658}</ProjectGuid>
11+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
12+
<OutputType>Library</OutputType>
13+
<AppDesignerFolder>Properties</AppDesignerFolder>
14+
<RootNamespace>AJAXCalls</RootNamespace>
15+
<AssemblyName>AJAXCalls</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+
<Reference Include="System.Web.Razor">
61+
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
62+
</Reference>
63+
<Reference Include="System.Web.Webpages">
64+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.0.0\lib\net45\System.Web.Webpages.dll</HintPath>
65+
</Reference>
66+
<Reference Include="System.Web.Webpages.Deployment">
67+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.0.0\lib\net45\System.Web.Webpages.Deployment.dll</HintPath>
68+
</Reference>
69+
<Reference Include="System.Web.Webpages.Razor">
70+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.0.0\lib\net45\System.Web.Webpages.Razor.dll</HintPath>
71+
</Reference>
72+
<Reference Include="System.Web.Helpers">
73+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
74+
</Reference>
75+
<Reference Include="System.Web.Mvc">
76+
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
77+
</Reference>
78+
</ItemGroup>
79+
<ItemGroup>
80+
<Content Include="facebook.png" />
81+
<Content Include="facebook1.png" />
82+
<Content Include="Global.asax" />
83+
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
84+
<Content Include="Scripts\jquery-1.10.2.js" />
85+
<Content Include="Scripts\jquery-1.10.2.min.js" />
86+
<None Include="Scripts\jquery.validate-vsdoc.js" />
87+
<Content Include="Scripts\jquery.validate.js" />
88+
<Content Include="Scripts\jquery.validate.min.js" />
89+
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
90+
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
91+
<Content Include="Web.config" />
92+
<Content Include="Scripts\jquery-1.10.2.min.map" />
93+
<Content Include="Views\_ViewStart.cshtml" />
94+
<Content Include="Views\Shared\_Layout.cshtml" />
95+
<Content Include="Views\Home\ShowCategoryProducts.cshtml" />
96+
</ItemGroup>
97+
<ItemGroup>
98+
<Compile Include="App_Start\RouteConfig.cs" />
99+
<Compile Include="Controllers\HomeController.cs" />
100+
<Compile Include="Global.asax.cs">
101+
<DependentUpon>Global.asax</DependentUpon>
102+
</Compile>
103+
<Compile Include="Models\Product.cs" />
104+
<Compile Include="Properties\AssemblyInfo.cs" />
105+
</ItemGroup>
106+
<ItemGroup>
107+
<Content Include="Views\web.config" />
108+
<Content Include="packages.config" />
109+
<None Include="Web.Debug.config">
110+
<DependentUpon>Web.config</DependentUpon>
111+
</None>
112+
<None Include="Web.Release.config">
113+
<DependentUpon>Web.config</DependentUpon>
114+
</None>
115+
</ItemGroup>
116+
<ItemGroup>
117+
<Folder Include="App_Data\" />
118+
</ItemGroup>
119+
<PropertyGroup>
120+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
121+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
122+
</PropertyGroup>
123+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
124+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
125+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
126+
<ProjectExtensions>
127+
<VisualStudio>
128+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
129+
<WebProjectProperties>
130+
<UseIIS>True</UseIIS>
131+
<AutoAssignPort>True</AutoAssignPort>
132+
<DevelopmentServerPort>51765</DevelopmentServerPort>
133+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
134+
<IISUrl>http://localhost:51765/</IISUrl>
135+
<NTLMAuthentication>False</NTLMAuthentication>
136+
<UseCustomServer>False</UseCustomServer>
137+
<CustomServerUrl>
138+
</CustomServerUrl>
139+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
140+
</WebProjectProperties>
141+
</FlavorProperties>
142+
</VisualStudio>
143+
</ProjectExtensions>
144+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
145+
Other similar extension points exist, see Microsoft.Common.targets.
146+
<Target Name="BeforeBuild">
147+
</Target>
148+
<Target Name="AfterBuild">
149+
</Target>
150+
-->
151+
</Project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
5+
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
6+
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
7+
<WebStackScaffolding_LayoutPageFile />
8+
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
9+
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
10+
<ProjectView>ShowAllFiles</ProjectView>
11+
</PropertyGroup>
12+
<ProjectExtensions>
13+
<VisualStudio>
14+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
15+
<WebProjectProperties>
16+
<StartPageUrl>
17+
</StartPageUrl>
18+
<StartAction>CurrentPage</StartAction>
19+
<AspNetDebugging>True</AspNetDebugging>
20+
<SilverlightDebugging>False</SilverlightDebugging>
21+
<NativeDebugging>False</NativeDebugging>
22+
<SQLDebugging>False</SQLDebugging>
23+
<ExternalProgram>
24+
</ExternalProgram>
25+
<StartExternalURL>
26+
</StartExternalURL>
27+
<StartCmdLineArguments>
28+
</StartCmdLineArguments>
29+
<StartWorkingDirectory>
30+
</StartWorkingDirectory>
31+
<EnableENC>True</EnableENC>
32+
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
33+
</WebProjectProperties>
34+
</FlavorProperties>
35+
</VisualStudio>
36+
</ProjectExtensions>
37+
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace AJAXCalls
9+
{
10+
public class RouteConfig
11+
{
12+
public static void RegisterRoutes(RouteCollection routes)
13+
{
14+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15+
16+
routes.MapRoute(
17+
name: "Default",
18+
url: "{controller}/{action}/{id}",
19+
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20+
);
21+
}
22+
}
23+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Data.SqlClient;
4+
using System.Linq;
5+
using System.Web;
6+
using System.Web.Mvc;
7+
using AJAXCalls.Models;
8+
9+
namespace AJAXCalls.Controllers
10+
{
11+
public class HomeController : Controller
12+
{
13+
//
14+
// GET: /Home/
15+
public ActionResult Index()
16+
{
17+
return RedirectToAction("ShowCategoryProducts");
18+
19+
}
20+
21+
public ActionResult ShowCategoryProducts()
22+
{
23+
List<SelectListItem> items = new List<SelectListItem>();
24+
25+
items.Add(new SelectListItem
26+
{
27+
Text = "Select Category",
28+
Value = "0",
29+
Selected = true
30+
});
31+
32+
items.Add(new SelectListItem { Text = "Beverages", Value = "1" });
33+
34+
items.Add(new SelectListItem { Text = "Condiments", Value = "2" });
35+
36+
items.Add(new SelectListItem { Text = "Confections", Value = "3" });
37+
38+
items.Add(new SelectListItem { Text = "Dairy Products", Value = "4" });
39+
40+
items.Add(new SelectListItem { Text = "Grains/Cereals", Value = "5" });
41+
42+
items.Add(new SelectListItem { Text = "Meat/Poultry", Value = "6" });
43+
44+
items.Add(new SelectListItem { Text = "Produce", Value = "7" });
45+
46+
items.Add(new SelectListItem { Text = "Seafood", Value = "8" });
47+
48+
ViewBag.CategoryType = items;
49+
50+
return View();
51+
}
52+
53+
public JsonResult GetProducts(string id)
54+
{
55+
List<Product> products = new List<Product>();
56+
57+
string query = string.Format("SELECT [ProductID], [ProductName], [QuantityPerUnit],[UnitPrice],[UnitsInStock],[ReorderLevel] " +
58+
" FROM [Northwind].[dbo].[Products] WHERE CategoryID = {0}",id);
59+
60+
using (SqlConnection con = new SqlConnection("Data Source=AADITYA-PC;Initial Catalog=Northwind;Integrated Security=True"))
61+
{
62+
using (SqlCommand cmd = new SqlCommand(query, con))
63+
{
64+
con.Open();
65+
SqlDataReader reader = cmd.ExecuteReader();
66+
67+
while (reader.Read())
68+
{
69+
products.Add(
70+
new Product
71+
{
72+
ProductID = reader.GetValue(0).ToString(),
73+
ProductName = reader.GetString(1),
74+
QuantityPerUnit = reader.GetString(2),
75+
UnitPrice = reader.GetValue(3).ToString(),
76+
UnitsInStock = reader.GetValue(4).ToString(),
77+
ReorderLevel = reader.GetValue(5).ToString()
78+
}
79+
);
80+
}
81+
}
82+
}
83+
84+
return Json(products, JsonRequestBehavior.AllowGet);
85+
}
86+
87+
}
88+
}

‎AJAXCalls/AJAXCalls/Global.asax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="AJAXCalls.MvcApplication" Language="C#" %>

‎AJAXCalls/AJAXCalls/Global.asax.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace AJAXCalls
9+
{
10+
public class MvcApplication : System.Web.HttpApplication
11+
{
12+
protected void Application_Start()
13+
{
14+
AreaRegistration.RegisterAllAreas();
15+
RouteConfig.RegisterRoutes(RouteTable.Routes);
16+
}
17+
}
18+
}

‎AJAXCalls/AJAXCalls/Models/Product.cs

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+
6+
namespace AJAXCalls.Models
7+
{
8+
public class Product
9+
{
10+
public string ProductID { get; set; }
11+
12+
public string ProductName { get; set; }
13+
14+
public string QuantityPerUnit { get; set; }
15+
16+
public string UnitPrice { get; set; }
17+
18+
public string UnitsInStock { get; set; }
19+
20+
public string ReorderLevel { get; set; }
21+
22+
}
23+
24+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /