I am a newbie in web developing with VS (Visual Studio). I have the following problem and would appreciate it very much if you could share your view on this.
PROBLEM:PageMethods works OK if I create a new website in VS via [File] - [New Web Site] - [ASP.NET Empty Web Site] as per the files given below. But if I create a new website in VS via [File] - [New Project] - [Visual C# ASP.NET
Web Application] then PageMethods do NOT work as per the files given below. Moreover, I can not run any method created in aspx.cs files!
Obviously, I am missing a basic step/concept but I can not see it unfortunately!
<?xml version="1.0"?><!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
--><configuration><configSections><!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --><sectionname="entityFramework"type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"requirePermission="false"/></configSections><connectionStrings><addname="DefaultConnection"connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-ETDBWebApplication1-20200211070838.mdf;Initial Catalog=aspnet-ETDBWebApplication1-20200211070838;Integrated Security=True"providerName="System.Data.SqlClient"/></connectionStrings><!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5.2" />
</system.Web>
--><system.web><customErrorsmode="Off"/><authenticationmode="None"/><compilationdebug="false"targetFramework="4.5.2"/><httpRuntimetargetFramework="4.5.2"/><pagescontrolRenderingCompatibilityVersion="4.0"><namespaces><addnamespace="System.Web.Optimization"/><addnamespace="Microsoft.AspNet.Identity"/></namespaces><controls><addassembly="Microsoft.AspNet.Web.Optimization.WebForms"namespace="Microsoft.AspNet.Web.Optimization.WebForms"tagPrefix="webopt"/></controls></pages><membership><providers><!--
ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
--><clear/></providers></membership><profile><providers><!--
ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
--><clear/></providers></profile><roleManager><!--
ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
--><providers><clear/></providers></roleManager><!--
If you are deploying to a cloud environment that has multiple web server instances,
you should change session state mode from "InProc" to "Custom". In addition,
change the connection string named "DefaultConnection" to connect to an instance
of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
--><sessionStatemode="InProc"customProvider="DefaultSessionProvider"><providers><addname="DefaultSessionProvider"type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"connectionStringName="DefaultConnection"/></providers></sessionState><httpModules><addname="ApplicationInsightsWebTracking"type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/></httpModules></system.web><system.webServer><modules><removename="FormsAuthentication"/><removename="ApplicationInsightsWebTracking"/><addname="ApplicationInsightsWebTracking"type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"preCondition="managedHandler"/></modules><validationvalidateIntegratedModeConfiguration="false"/></system.webServer><runtime><assemblyBindingxmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentityname="Newtonsoft.Json"culture="neutral"publicKeyToken="30ad4fe6b2a6aeed"/><bindingRedirectoldVersion="0.0.0.0-9.0.0.0"newVersion="9.0.0.0"/></dependentAssembly><dependentAssembly><assemblyIdentityname="WebGrease"culture="neutral"publicKeyToken="31bf3856ad364e35"/><bindingRedirectoldVersion="0.0.0.0-1.5.2.14234"newVersion="1.5.2.14234"/></dependentAssembly><dependentAssembly><assemblyIdentityname="EntityFramework"publicKeyToken="b77a5c561934e089"/><bindingRedirectoldVersion="0.0.0.0-6.0.0.0"newVersion="6.0.0.0"/></dependentAssembly><dependentAssembly><assemblyIdentityname="Microsoft.Owin"culture="neutral"publicKeyToken="31bf3856ad364e35"/><bindingRedirectoldVersion="0.0.0.0-3.0.1.0"newVersion="3.0.1.0"/></dependentAssembly><dependentAssembly><assemblyIdentityname="Microsoft.Owin.Security.OAuth"culture="neutral"publicKeyToken="31bf3856ad364e35"/><bindingRedirectoldVersion="0.0.0.0-3.0.1.0"newVersion="3.0.1.0"/></dependentAssembly><dependentAssembly><assemblyIdentityname="Microsoft.Owin.Security.Cookies"culture="neutral"publicKeyToken="31bf3856ad364e35"/><bindingRedirectoldVersion="0.0.0.0-3.0.1.0"newVersion="3.0.1.0"/></dependentAssembly><dependentAssembly><assemblyIdentityname="Microsoft.Owin.Security"culture="neutral"publicKeyToken="31bf3856ad364e35"/><bindingRedirectoldVersion="0.0.0.0-3.0.1.0"newVersion="3.0.1.0"/></dependentAssembly></assemblyBinding></runtime><entityFramework><defaultConnectionFactorytype="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"><parameters><parametervalue="mssqllocaldb"/></parameters></defaultConnectionFactory><providers><providerinvariantName="System.Data.SqlClient"type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/></providers></entityFramework><system.codedom><compilers><compilerlanguage="c#;cs;csharp"extension=".cs"type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"warningLevel="4"compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/><compilerlanguage="vb;vbs;visualbasic;vbscript"extension=".vb"type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"warningLevel="4"compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/></compilers></system.codedom></configuration>
None
0 Points
1 Post
PageMethods not working if the website is created as a Visual C# ASP.Net Web Application in VS201...
Jun 01, 2020 05:13 PM|ccamkoy|LINK
I am a newbie in web developing with VS (Visual Studio). I have the following problem and would appreciate it very much if you could share your view on this.
PROBLEM: PageMethods works OK if I create a new website in VS via [File] - [New Web Site] - [ASP.NET Empty Web Site] as per the files given below. But if I create a new website in VS via [File] - [New Project] - [Visual C# ASP.NET Web Application] then PageMethods do NOT work as per the files given below. Moreover, I can not run any method created in aspx.cs files!
Obviously, I am missing a basic step/concept but I can not see it unfortunately!
ASPX File:
ASPX.CS FILE (CODEBEHIND):
Web.Config:
Many thanks in advance.
Cenk