webmatrix

How can I delete a folder from my WebMatrix project?

偶尔善良 提交于 2019-12-11 06:38:26
问题 The default setup for a project in WebMatrix contains an "Account" folder with many files such as Login.cshtml, Logout.cshtml, Register.cshtml, etc. I do not need/want login capability for the site I'm currently building. So, I removed references to such in the various pages, but when I try to delete the folder itself, the screen flashes but nothing seems to happen. So how can I get rid of this unneeded "baggage"? The same goes for StarterSite.sdf - trying to delete it just causes a "screen

How to use XML with WebMatrix razor (C#)

泄露秘密 提交于 2019-12-11 06:36:58
问题 I need to know how to use (specifically just read) XML with at least one of the languages I use (preferably this would be WebMatrix C#), but I have tried to do this with JavaScript several times in the past, but no online example (in StackOverflow or otherwise) is ever complete enough to get it working for me (keep in mind I have no actual XML experience, I have of course done the simple tutorials on XPath, XML, and such, but we all know how brief and incomplete these tutorials can be). I now

Trying to work with Request.Files in WebMatrix

强颜欢笑 提交于 2019-12-11 06:25:33
问题 everyone, I am trying to work with uploading images to my site, and I have successfully gotten it to work, however, I need to extend the functionality beyond that of one simple image. The examples I have seen use the WebMatrix File Helper (File Helper? Is that right? Oh well, it's a helper of some kind that auto plots the html necessary for the input=type"file" field). The line of code I have in the form: @FileUpload.GetHtml(initialNumberOfFiles:1, allowMoreFilesToBeAdded:false,

Web Matrix Error “No default document”

时光总嘲笑我的痴心妄想 提交于 2019-12-11 06:24:10
问题 I'm new to Web matrix and Razor Syntax indeed. But unfortunately I have an error that appears in the browser when I try to run a test website. and this is the error "HTTP Error 404.20 - Not Found No default document." but when I open any pages in the site through Right Click + Lunch in browser it runs properly. There are some suggested solutions that appeared in the browser but I couldnt benefit from them {Most likely causes: A default document is not configured for the site. The URL contains

Calculate TotalAmount from all Rows in Table

[亡魂溺海] 提交于 2019-12-11 05:48:32
问题 Can you please help me with this? I am trying to calculate the total of all the rows in my Price Table, but the values never add up, and now it doesn't seem to calculate anymore either. I have the following: @{ decimal money = 0.00m; var prices = "SELECT Price, SUM(Price) FROM PriceTable GROUP BY Price"; var database = Database.Open("MYDB"); database.QuerySingle(prices); money = prices.AsDecimal(); } And somewhere in my HTML I type: @money // to display the totalAmount Am I doing it right? I

Hosting WebMatrix Page

纵饮孤独 提交于 2019-12-11 04:18:47
问题 What exactly do I need from a host for my webmatrix project to work? I know Scott Hanselman from Microsoft gave out a few nice host sites but I was just wondering for fun. 回答1: In order to publish to a host from WebMatrix using Web Deploy, the host needs to be in a compliant state. First of all, it has to run WebDeploy and the remote service WMSvc has to be in a desired state (enabled and started). Delegation rules have to be set up, so that the user has permissions and the right scope to

WebMatrix Helper controlled table showing wrong time in Password Change Date field

∥☆過路亽.° 提交于 2019-12-11 02:49:41
问题 everyone, I have a quick question. Can anyone tell me why the field "PasswordChangeDate" in the helper controlled table "webpages_Membership" (automatically filled using the Web.Security Helper, I'm pretty sure) is logging a date/time that is 5 hours off? I just changed my password and looked at the field and saw that while I had changed my password at 10:50 AM, it showed 3:50 PM. Is there a setting somewhere (possibly for time zone, etc.) that I need to adjust within the Web.Security helper?

There was an error parsing the query. [ Token line number = 1,Token line offset = 52,Token in error = ) ]

余生长醉 提交于 2019-12-11 02:22:11
问题 While trying to insert data to my SQl db i get the following error System.Data.SqlServerCe.SqlCeException: There was an error parsing the query. [ Token line number = 1,Token line offset = 52,Token in error = ) ] my lines of code to enter the data are the following: @{ var db= Database.Open("Games"); var sqlQ = "SELECT * FROM Games"; var data = db.Query(sqlQ); } @{ if (IsPost) { var fileData = Request.Files[0]; var fileName = Path.GetFileName(fileData.FileName); var fileSavePath = Server

How do I get a single json value using Webmatrix / razor?

好久不见. 提交于 2019-12-11 02:20:56
问题 I am trying to grab just a single value from some json and am using Chrome's javascript console to try and debug it. I have tried Request["id"], and Request.Params["id"] and it doesn't grab anything. I have verified via the chrome javascript debugger that the value is going across but I can't pull the value out using webmatrix. Can anybody please help? code from Default.cshtml $.ajax({ type: 'POST', data: encodedItemId, //looks like { id : value } dataType: 'json', url: '/actions/act

Using row.ColumnName on a column with spaces, after a select query generated by C# in WebMatrix

一曲冷凌霜 提交于 2019-12-11 00:55:40
问题 I have compiled a string that queries a database like so: stringCompiler = "SELECT * FROM SomeTable"; The problem is that some of the columns have spaces in their names (i.e., "City Tag Number"). How can I call this later after I use the db.Query statement. Example: foreach(var row in db.Query(stringCompiler)) { var someVariable = row.Column With Spaces; } Obviously the above code would produce an error. I could go through each column instead of using ' * ', all the while assigning aliases to