asp.net-webpages

InvalidCastException is thrown after installing ASP.NET MVC 4 Beta

試著忘記壹切 提交于 2019-11-30 01:06:39
I get the following exception after installing ASP.NET MVC 4 Beta on a machine with ASP.NET MVC 3. System.InvalidCastException was unhandled by user code Message=[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates

Win32Exception (0x80004005): The wait operation timed out

帅比萌擦擦* 提交于 2019-11-29 22:49:28
I'm running an ASP.NET Web Pages page that upon initial load pulls a list of items from a SQL server. This query runs in a second or so and loads the page within 2 seconds. The return is about a 1000 records, give or take. I'm pulling Hostnames from a Service Manager SQL database along with some other information. Within this page, I have a search built in that essentially runs the exact same query but runs it with a LIKE based on hostname. This loads the same page with all hostnames that are contain part of the search query. The query generally runs within SQL Management Studio in under a

Conflicting versions of ASP.NET Web Pages detected: specified version is “1.0.0.0”, but the version in bin is “2.0.0.0”

拥有回忆 提交于 2019-11-29 00:53:24
This error appears after updating ASP.NET Web Helpers Library today to version 2.0 which was apparently released today. I updated by mistake, however would like to resolve this now, if possible. Conflicting versions of ASP.NET Web Pages detected: specified version is "1.0.0.0", but the version in bin is "2.0.0.0". To continue, remove files from the application's bin directory or remove the version specification in web.config. Apparently this is the problem in web.config: <add key="webpages:Version" value="1.0.0.0" /> Does anyone even have any information about this ASP.NET Web Helpers Library

Win32Exception (0x80004005): The wait operation timed out

拈花ヽ惹草 提交于 2019-11-28 18:23:58
问题 I'm running an ASP.NET Web Pages page that upon initial load pulls a list of items from a SQL server. This query runs in a second or so and loads the page within 2 seconds. The return is about a 1000 records, give or take. I'm pulling Hostnames from a Service Manager SQL database along with some other information. Within this page, I have a search built in that essentially runs the exact same query but runs it with a LIKE based on hostname. This loads the same page with all hostnames that are

Conflicting versions of ASP.NET Web Pages detected: specified version is “1.0.0.0”, but the version in bin is “2.0.0.0”

大兔子大兔子 提交于 2019-11-27 15:26:57
问题 This error appears after updating ASP.NET Web Helpers Library today to version 2.0 which was apparently released today. I updated by mistake, however would like to resolve this now, if possible. Conflicting versions of ASP.NET Web Pages detected: specified version is "1.0.0.0", but the version in bin is "2.0.0.0". To continue, remove files from the application's bin directory or remove the version specification in web.config. Apparently this is the problem in web.config: <add key="webpages

Using a Razor @functions in several webpages (.cshtml files)

浪尽此生 提交于 2019-11-27 14:39:51
I have the below function that I would like to be available to several .cshtml views in my asp.net web pages 2 application. How can I make this function available to any view in the application (as opposed to just one). @functions { public bool DisplayButton(String startDate, String endDate) { return Convert.ToDateTime(startDate) < DateTime.Now && Convert.ToDateTime(endDate) > DateTime.Now; } } Create a file called Functions.cshtml in App_Code and then paste the code you have into the file. Then you can call the DisplayButton method in any .cshtml file by prefixing it with the file name: var

Using a Razor @functions in several webpages (.cshtml files)

让人想犯罪 __ 提交于 2019-11-26 18:26:41
问题 I have the below function that I would like to be available to several .cshtml views in my asp.net web pages 2 application. How can I make this function available to any view in the application (as opposed to just one). @functions { public bool DisplayButton(String startDate, String endDate) { return Convert.ToDateTime(startDate) < DateTime.Now && Convert.ToDateTime(endDate) > DateTime.Now; } } 回答1: Create a file called Functions.cshtml in App_Code and then paste the code you have into the