webmatrix

ASP.NET Razor/Webmatrix sites logout user too quickly. How to change?

╄→гoц情女王★ 提交于 2020-01-04 09:57:11
问题 The WebSecurity component in Webmatrix is pretty slick, but users' sessions expire too quickly for me. It seems like it's measured in hours and I'd like the session timeout to be more in terms of days. How do I change the session timeout? 回答1: In answer to your question, you can set any value for session timeout in your web.config: <configuration> <system.web> <sessionState timeout="value_in_minutes"></sessionState> </system.web> </configuration> By default, sessions expire 20 minutes after

ASP.NET Razor/Webmatrix sites logout user too quickly. How to change?

主宰稳场 提交于 2020-01-04 09:56:26
问题 The WebSecurity component in Webmatrix is pretty slick, but users' sessions expire too quickly for me. It seems like it's measured in hours and I'd like the session timeout to be more in terms of days. How do I change the session timeout? 回答1: In answer to your question, you can set any value for session timeout in your web.config: <configuration> <system.web> <sessionState timeout="value_in_minutes"></sessionState> </system.web> </configuration> By default, sessions expire 20 minutes after

Install Entity Framewok v5 in Webmatrix 2 RC

允我心安 提交于 2019-12-25 07:58:38
问题 I'm working on a project with Entity Framework in Webmatrix 2 RC, so I need to use Entity Framework v.5 RC because of conflicts between previous versions and .NET Framework 4.5. The two ways I know to install NuGet packages in Webmatrix are from the NuGet Gallery on the Webmatrix ribbon and from the package manager in ASP.NET Web Pages Administration: either solution proposes only Entity Framework v4.3.1. I have downloaded Entity Framework v.5 RC with the Package Manager Console of Visual Web

CascadingDropDowns Webmatrix

╄→гoц情女王★ 提交于 2019-12-25 02:25:48
问题 So i was following this tutorial http://www.mikesdotnetting.com/Article/196/WebMatrix-jQuery-Cascading-Dropdown-Lists Everything works nice, but when i save to the database the first dropdown, pass me the ID and i can't figure it out how to pass the name instead of the ID. <select id="categoryId" name="categoryId"> <option value="">-- Select Category --</option> @foreach(var category in categories){ <option value="@category.CategoryId">@category.CategoryName</option> } </select> I know that

Php tags in .html files don't work in WebMatrix

我与影子孤独终老i 提交于 2019-12-24 13:27:43
问题 I've been learning web development and the book I am learning from is using php tags within html files but they don't work for me, here is my header page: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title><?php echo $page_title; ?></title> <style type="text/css" media="all">@import "./includes/layout.css";</style> </head> <body> <a href="index.php" class="logo"> <img src="Includes/Images/NameIconSplash.png" /></a> <div id

WebSecurity.CreateAccount fails for MySQL

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 08:28:48
问题 I am using WebMatrix and stuck at the first place while trying to create users in MySQL database. The error message is in line: var token = WebSecurity.CreateAccount(email, password, requireEmailConfirmation); Error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[UserId] FROM [UserProfile] WHERE (UPPER([Email]) = 'TE3ST@TEST.DE')' I can fully understand that the server is trying to use SQL

Add a column to an IEnumerable in c# such that it works with WebGrid

爷,独闯天下 提交于 2019-12-24 07:39:19
问题 In this question, Add a column to IEnumerable in C#, I got the following code: var db = Database.Open("LOS"); var ie = db.Query(sqlAssignments); // make a new ie2 that has an extra calculated field var ie2 = processes.Select( e => new { e.ACCT, e.RefID, color = e.RefID + 9000000 }); var grid = new WebGrid(ie2.ToList(), rowsPerPage : 50, ajaxUpdateContainerId : "grid" ); The data correctly shows up, however the grid no longer sorts. It sorts fine if you pass ie, instead of ie2. It has the

WebMatrix ASP.NET Web Pages vs ASP.NET MVC 3

烂漫一生 提交于 2019-12-24 03:03:32
问题 I've looked at WebMatrix 2 and it seems simple and fun to play with. I play mainly with ASP.NET MVC 3 in C# with VS2010 Premium. I'd like to know what's the pros and cons of using ASP.NET Web Pages, against using ASP.NET MVC 3. And I'd like to know what's the pros and cons of WebMatrix too. Thanks! 回答1: Web Pages is a much lighter-weight development model than MVC. You would use it when testability and code separation is not needed - proof of concept stuff perhaps, or just a relatively simple

How to add parameters to WebMatrix Database.Query?

浪尽此生 提交于 2019-12-23 19:14:34
问题 Using Database.Query has has made a huge improvement on readability in my code: String Select = 'sp_getAllUsers'; WebMatrix.Data.Database DB = WebMatrix.Data.Database.Open(MyConString); var data = DB.Query(Select); I'd like to switch to a non-stored procedure query. The MSDN says there's an optional parameter to the Query Method, Object[] , that can be passed as SQL parameters, however they don't have any further information about it. So I have two questions: How can I create a Object[] ?

The name 'Database' does not exist in the current context?

半城伤御伤魂 提交于 2019-12-21 04:37:09
问题 I am getting this error when I try to launch my website using WebMatrix. I have a .cs file which makes a call var db = Database.Open("dbase"); . I have a database in my project called "dbase". I have no web.config file and no imports for using WebMatrix packages since I am launching the site using WebMatrix, so I don't believe I should need them. Do I need to wrap the code in Razor tags, like @{var db = Database.Open("dbase"); } ? This causes an error for me too. What could be causing this?