and save it using the Umbraco interface, then the file disappears from the file system. I've reduced this to the simplest case possible, but you can see why this might cause problems in a site with templates disappearing!
Any ideas on what's going on here, and should I be logging this as a bug?
I cant answer why it's causing your file to disappear, but my suspicion is it's because Umbraco is getting confused because you've included WebForms mark-up.
There's no runat=server in MVC!
Instead you would use a helper method
You first start by opening a code block...
@{ ..... }
Inside the block add @Umbraco.Field("fieldName")
You write razor (a form of C#) in MVC so you'll need to do some tutorials on the programming methodologies and syntax.
Thanks for the response, makes perfect sense. I'm just converting some existing web forms templates to MVC which is why I've got this - will take a bit of getting used to the syntax.
However, still doesn't explain why the template disappears from the file system, which seems like a major issue to me.
If you have a mix of MVC and Webforms (masterpages) in your build and they happen to have the same alias (effectively filename in your filesystem). One will cancel the other out.
Although I cant remember which one bites the dust! MVC or WF lol.
Makes sense, but not what's going on for me at the moment. I'm copying templates from a web forms build into a separate MVC Umbraco project. Seems weird that having a runat="server" would just cause the template to disappear completely. I suppose it keeps things interesting ;)
Saving a template in v6.1.6 with umbraco item causes template to disappear from file system
Hi all,
A strange one, this. If I create a template called "test" with this content via the Umbraco interface:
a test.cshtml file is created in /Views/ folder in my Umbraco site (as expected). If I then update the contents to this:
and save it using the Umbraco interface, then the file disappears from the file system. I've reduced this to the simplest case possible, but you can see why this might cause problems in a site with templates disappearing!
Any ideas on what's going on here, and should I be logging this as a bug?
Thanks,
David
Hi David
I cant answer why it's causing your file to disappear, but my suspicion is it's because Umbraco is getting confused because you've included WebForms mark-up.
There's no runat=server in MVC!
Instead you would use a helper method
You first start by opening a code block...
@{ ..... }
Inside the block add @Umbraco.Field("fieldName")
You write razor (a form of C#) in MVC so you'll need to do some tutorials on the programming methodologies and syntax.
Regards
M.
Hi Martin,
Thanks for the response, makes perfect sense. I'm just converting some existing web forms templates to MVC which is why I've got this - will take a bit of getting used to the syntax.
However, still doesn't explain why the template disappears from the file system, which seems like a major issue to me.
Cheers!
David
If you have a mix of MVC and Webforms (masterpages) in your build and they happen to have the same alias (effectively filename in your filesystem). One will cancel the other out.
Although I cant remember which one bites the dust! MVC or WF lol.
Regards
Martin
Makes sense, but not what's going on for me at the moment. I'm copying templates from a web forms build into a separate MVC Umbraco project. Seems weird that having a runat="server" would just cause the template to disappear completely. I suppose it keeps things interesting ;)
is working on a reply...