webmatrix

XML sitemap remove xmlns from url tag

旧城冷巷雨未停 提交于 2020-05-29 06:48:25
问题 I am using the below lines to generate sitemap but google says there is an error. I know the error but i am unable to figure out how to remove the tag. THe code @using System.Xml.Linq; @{ Layout = null; var urls = new List<string>{ "1", "2", "3" }; XNamespace ns = "http://www.sitemaps.org/schemas/sitemap/0.9"; var baseurl = "http://www.myurl.in/{0}"; var sitemap = new XDocument( new XDeclaration("1.0", "utf-8", "yes"), new XElement(ns + "urlset", from url in urls select new XElement("url",

jQuery/Ajax simple form post in webmatrix

≯℡__Kan透↙ 提交于 2020-01-16 19:37:27
问题 Can someone please tell me the code I need, so that this form updates the database without needing a refresh? @{ Layout = "~/_template1.cshtml"; var db = Database.Open("stayinflorida"); var CurrentUser = WebSecurity.CurrentUserId; var userdetails = ("SELECT * from UserProfile WHERE UserId='8'"); var quserdetails = db.QuerySingle(userdetails, CurrentUser); if (IsPost){ var updateuserdetails = "UPDATE UserProfile SET FirstName = @0, LastName = @1 WHERE UserID='8'"; db.Execute(updateuserdetails,

jQuery/Ajax simple form post in webmatrix

南笙酒味 提交于 2020-01-16 19:36:49
问题 Can someone please tell me the code I need, so that this form updates the database without needing a refresh? @{ Layout = "~/_template1.cshtml"; var db = Database.Open("stayinflorida"); var CurrentUser = WebSecurity.CurrentUserId; var userdetails = ("SELECT * from UserProfile WHERE UserId='8'"); var quserdetails = db.QuerySingle(userdetails, CurrentUser); if (IsPost){ var updateuserdetails = "UPDATE UserProfile SET FirstName = @0, LastName = @1 WHERE UserID='8'"; db.Execute(updateuserdetails,

Search refinement for WebMatrix site

核能气质少年 提交于 2020-01-16 03:18:46
问题 I've been asking a few questions on this site, and have answers to lots of little bits, but I am now trying to piece the whole thing together. I have a page where it shows all the properties I have in my database. I need to find a way to refine those results though, so for example, to only show properties that have 4 bedrooms etc. The problem is, I don't know how many variables I might have in the search term yet. So here's an example. a user may want to see ALL properties that just have 4

Webmatrix 2: Storing static values

删除回忆录丶 提交于 2020-01-11 09:26:06
问题 Where would be the best place to store static values. And how would I access it. I want to be able to access static values from any page. But only have to define them in one place. For example 'email' and 'phoneNumber' I have tried things like Session and PageData , and defining the variables in my header (used by all pages) but this does not work. The partial is initialised after the page, so it either doesnt work at all, or doesnt work on first time load. E.g. First time Load: Page Loaded <

ASP WebMail: Set up SMTP authentication?

大憨熊 提交于 2020-01-06 15:44:15
问题 I'm developing web pages using Razor C# language in WebMatrix. I have a hosted website, I'm trying to incorporate an email system into it. As per this article on WebMail I have set up the WebMail settings in my _AppStart.cshtml page. I've got my settings from my service provider. He's provided me a sample code using CDO object: dim config, sch set config = CreateObject("CDO.Configuration") sch = "http://schemas.microsoft.com/cdo/configuration/" with config.Fields .item(sch & "sendusing") = 2

ASP WebMail: Set up SMTP authentication?

人盡茶涼 提交于 2020-01-06 15:44:08
问题 I'm developing web pages using Razor C# language in WebMatrix. I have a hosted website, I'm trying to incorporate an email system into it. As per this article on WebMail I have set up the WebMail settings in my _AppStart.cshtml page. I've got my settings from my service provider. He's provided me a sample code using CDO object: dim config, sch set config = CreateObject("CDO.Configuration") sch = "http://schemas.microsoft.com/cdo/configuration/" with config.Fields .item(sch & "sendusing") = 2

paths need to start with / (ArgumentError)

China☆狼群 提交于 2020-01-06 08:45:08
问题 This question is similar to that of Neil Hoff's post from a few days ago. I downloaded Ruby On Rails using Helicon Zoo's ruby package. I am running this on Windows 7 using IIS Express & WebMatrix. Like, the other question when I browse to the site, I am getting the following: [tid-12570000] paths need to start with / (ArgumentError) C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/urlmap.rb:33:in `block in remap' C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.3.6/lib/rack/urlmap.rb:25:in

Razor web pages: How do I create variable that is available to all pages?

我怕爱的太早我们不能终老 提交于 2020-01-05 08:04:52
问题 I have a lot of pages that is using the same variables. I would like to create these in a single page so I dont have to type them over and over again. How do I do this? I tried both _appStart.cshtml and _PageStart.cshtml, but when i run my content page i get error "the name selectedData does not exist in the current context" Here is my _PageStart.cshtml: (tried _appstart.cshtml too) @{ var db = Database.Open("razortest"); var selectQueryString = "SELECT * FROM tbl_stasjon ORDER BY nr"; var

Razor web pages: How do I create variable that is available to all pages?

人走茶凉 提交于 2020-01-05 08:03:43
问题 I have a lot of pages that is using the same variables. I would like to create these in a single page so I dont have to type them over and over again. How do I do this? I tried both _appStart.cshtml and _PageStart.cshtml, but when i run my content page i get error "the name selectedData does not exist in the current context" Here is my _PageStart.cshtml: (tried _appstart.cshtml too) @{ var db = Database.Open("razortest"); var selectQueryString = "SELECT * FROM tbl_stasjon ORDER BY nr"; var