Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Axel 68 posts 96 karma points
    Apr 30, 2014 @ 15:34
    Axel
    0

    Runat Server Error by using Custom Control

    Hi, i put in the Masterpage template the following Code<umbraco:Macro Alias="MyLogin" runat="server" />i got the information how to use the customcontrol from this videohttp://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/using-net-user-controls/TVPlayer(Attemtion i directly create the usercontrol through VS 2013 (open umbraco as website) under Usercontrols)but when i run the sample page i got the following errorTo use the SetFocus () - or the Focus property must be on the side of a form tag with runat = server to be present.in my usercontrol i have the following codeIf Not Page.IsPostBack Then             username.Focus()on the ascx file i have<%@ Control Language="VB" AutoEventWireup="false" CodeFile="myLogin.ascx.vb" Inherits="UserControlsmyLogin" %><asp:TextBox ID="username" runat="server" Width="144px" CssClass="mf-input" ></asp:TextBox>Currently i user Umbraco V7.x

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 30, 2014 @ 15:40
    Jan Skovgaard
    0

    Hi Axel

    Have you setup your Umbraco 7 installation to run webforms instead of MVC?

    /Jan

  • Axel 68 posts 96 karma points
    Apr 30, 2014 @ 15:52
    Axel
    0

    I did it now in the umbracoSettings.config

    <defaultRenderingEngine>WebForms</defaultRenderingEngine>
    but still the same error ..

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 30, 2014 @ 16:45
    Jan Skovgaard
    0

    Hi Axel

    Also make sure that you have a surrounding server form tag in your master-template, that wraps your content.

    Hope this helps.

    /Jan

  • Axel 68 posts 96 karma points
    Apr 30, 2014 @ 19:01
    Axel
    0

    Hi Jan, thanks the error has gone. But now i have an other issue. Please take a look on the picture.

    Seems that the Page now not complete rendered.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 30, 2014 @ 19:05
    Jan Skovgaard
    0

    Hi Axel

    That's probably because you're using some MVC/Razor stuff that is not supported when running webforms. You can't mix and match like that.

    If you're running MVC mode you can use Razor in the templates since they're views and you can use partial view macroes.

    If you want to use Razor when running webforms you need to create them like "Scripting files" in the developer section.

    So what is it you're trying to achieve by making a user control? You should probably go back to using MVC and then create a surfacecontroller instead to achieve the same thing?

    /Jan

  • Axel 68 posts 96 karma points
    Apr 30, 2014 @ 19:15
    Axel
    0

    Hi Jan, sounds all very complicated. I told you whats my background. i will use most of our exists intranet. i will also use our custom membership provider. first i would try made our exists login custom control to use in umbraco. thats what i try above.

    i create the usercontrol as webform (as i usually done) .
    or how can i use usercontrols with umbraco 7 ? or did i create the control as mvc control ? (is there a tutorial how? )

    Or whats the Background to use Usercontrols in Umbraco 7 as Macro ? Or did it not anymore supported?

     

    Best regards

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 30, 2014 @ 20:05
    Jan Skovgaard
    0

    Hi Axel

    You can indeed use usercontrols in Umbraco 7 when you're running webforms mode.

    But in your templates you're having code from an MVC template rather than a master template.

    A masterpage template could look like this in webforms

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
      <!-- Your code here -->
    </asp:Content>
    

    Does that make sense?

    In this documentation it shows how a masterpage is converted to a view - what you need to do is reverse http://our.umbraco.org/documentation/Cheatsheets/masterpagestoviews

    Hope this helps.

    /Jan

  • Axel 68 posts 96 karma points
    Apr 30, 2014 @ 21:12
    Axel
    0

    Hi jan, thats the reason (i think). i have installed the

    Txt Starter Kit For Umbraco Released

     

    In all it's MVC Views goodness

     

     

    i think its the easiest way (and if how?) to get a webform sample kit (is this possible with umbraco 7 ?)

    or did you say with umbraco 7 not use webforms?

    axel

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 30, 2014 @ 21:19
    Jan Skovgaard
    0

    Hi Axel

    Aaaah, yes then that's the reason.

    I have not seen any starter kits for Webforms in v7...

    But if you're just playing around with Umbraco then you should be able to make a new installation of Umbraco and then in the process make sure to hit the "Customize" link and choose not to install a starter kit.

    After the installation you change the installation to run webforms mode and then you go back into the backoffice and create a simple document type called "Master". When you do you keep the checkmark in "Create template"...if you need some properties on the document type then create them and in the "Structure" tab place a checkmark in "Allow at root node".

    Then you need to create your user control based macro in the developer section again and then go to the "Master" template and add the macro again...and remember to wrap it all in the

    Then finally go to "Content" and create a document based on the "Master" document type...now you sould be able to see your macro work...

    Hope this helps! :)

    /Jan

  • Axel 68 posts 96 karma points
    Apr 30, 2014 @ 21:31
    Axel
    0

    Hi jan (thanks for the fast answers). but is this your recommended to proceed ? should i try you described or should i use with umbraco 7 only mcv and try to create my  user control with mcv ?

    but then i must all my other asp.net pages convert to mvc (but my experiences with mvc are very poor)

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 30, 2014 @ 22:25
    Jan Skovgaard
    0

    Hi Alex

    You're very welcome.

    When you say your experience with MVC is poor...is that because you have had bad experiences using it? Or is it because you have never really used it before so you lack some experience using it?

    The future in Umbraco land is going to be MVC and Angular...so it's worthwhile learning it. on umbraco.tv there are some tutorials covering how to use MVC and on asp.net there are some general tutorials on using MVC.

    But I can see that it will perhaps be a bit inconvenient to have to learn MVC when converting the site. But in the long term it might be worth the challenge you're facing right now since it's not sure Umbraco will keep supporting webforms (I'm not saying it won't be we don't know if it will). So perhaps at some point you won't be able to upgrade to a new version before converting it. But then you can of course take the time to convert it if that time should come.

    But can you tell us a bit more about the current functionality that you need to convert currently? You can of course still use webforms in v7 - It requires, as mentioned, that you change the engine to run on webforms.

    Then you can create your templates and macroes based on masterpages and user controls. And when you need to create a Razor macro you can create scripting files. But tell us a bit more about the site you're going to convert and then it will be easier to advise you further.

    Btw...if it all feels a bit scary some of the community members have created this nice guide on create your first basic site using Umbraco 7 and MVC - Perhaps it helps to read this? http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/

    I hope the above is not too confusing - but please let me know if I lost you at some point and then I'll try to explain again :)

    Cheers, Jan

  • Axel 68 posts 96 karma points
    May 01, 2014 @ 19:50
    Axel
    0

    Hi Jan,

    >When you say your experience with MVC is poor...is that because you have had bad experiences using it? Or is it because you have never really used it before so >you lack some experience using it?
    I have only some experiences. But not yet done a real project.

    >you're facing right now since it's not sure Umbraco will keep supporting webforms (I'm not saying it won't be we don't know if it will). So perhaps at some point you >won't be able to upgrade to a new version before converting it.
    Okay, thats no problem. But at the moment i think i drive better with Webforms.

     

    >But can you tell us a bit more about the current functionality that you need to convert currently? You can of course still use webforms in v7 - It requires, as >mentioned, that you change the engine to run on webforms.

    >Then you can create your templates and macroes based on masterpages and user controls. And when you need to create a Razor macro you can create scripting >files. But tell us a bit more about the site you're going to convert and then it will be easier to advise you further.

    i have an exists company intranet complete written by myself. i use iis,asp.net,webforms,sql server,my custom membership provider, use 3rd party controls from infragistics (webgrid and others)
    everything is written by myself . for example employee list (where i get from a sql table ->datatable) , calendar, food menu plan, employee fast search and display data with jquery. infragistics webmenu (items will show depends from user rights)
    user  can create news and this 5 last news will display on the startpage (with news archiv) .
    what about this feature, is this possible with umbraco too?


    user's can upload documents and this are downloadable in a document library (is this also possible with Umbraco?)

    later i will build up an other document folder where i can place different documents (like pdf,word,excel) and this should be indexing and searchable.

    thats at the moment some features i will try to do with umbraco. i hope this all are possible. I'm sure many many more to come ask me
    best regards axel

     


     

     

     


     

     

  • Axel 68 posts 96 karma points
    May 01, 2014 @ 21:19
    Axel
    0

    Hi jan, i have now made from the scratch a new umbraco site. build in the usercontrol in the master template

    But when i show the page only the content of the usercontrol will be shown and not the test text of test page 1

    which based on the above master template

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 01, 2014 @ 21:27
    Jan Skovgaard
    0

    Hi Axel

    Ok, in short - all of the above things you mention are possible. You should see Umbraco as a framework that is very good a handling content and, which you can use to build your system upon without having to worry about delivering stuff like "Create page", "Publish", "Sort"....etc.

    When you refer to users I suppose those users have been able to upload files using the website - In Umbraco that would be referred to as "members" since "users" are those who login to the Umbraco backoffice where members can be setup to access restricted areas of the website.

    Even though it's all possible I'm afraid I don't have all the answers on how to do it since my area of expertise is frontend development. However there are many other bright minds in this community and I'm sure they will be happy to help you out as well.

    In regards to your last post...could you show a screendump of your content section in Umbraco displaying the node you're trying to see data from? You need to render the content using a macro or umbraco:Items before they will show on your page (Don't worry to much about how to create them yet - first please post the screendump) :).

    /Jan

  • Axel 68 posts 96 karma points
    May 02, 2014 @ 20:39
    Axel
    0

    Hi Jan,

    >When you refer to users I suppose those users have been able to upload files using the website - In Umbraco that would be referred to as "members" since "users" are those who login to the Umbraco backoffice where members can be setup to access restricted areas of the website.

    Yes that i mean :)

    >...could you show a screendump of your content section in Umbraco displaying the node you're trying to see data from?
    Yes here is


    Best regards Axel

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 02, 2014 @ 22:34
    Jan Skovgaard
    0

    Hi Axel

    Ok...in the settings section on your "Master" template, which you showed in the previous post you can see a toolbar where you can insert different stuff. There is also a toolbar that allows you to insert property values into your template - it's those that are called

    Try inserting some of the properties by using this - do you see the values?

    Ideally you would use Razor or XSLT based macroes but for taking the first steps into learning I think this is useful.

    Hope this makes sense.

    /Jan

  • Axel 68 posts 96 karma points
    May 03, 2014 @ 21:39
    Axel
    0

    Hi Jan, iam not clear what you mean.

    >see a toolbar where you can insert different stuff. There is also a toolbar that allows you to insert property values into your template - it's those that are called.

    >Try inserting some of the properties by using this - do you see the values?

    >Ideally you would use Razor or XSLT based macroes but for taking the first steps into learning I think this is useful.


    i really don't understand why my other conten will not be shown.

    i have created the usercontrol from this manual
    http://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/using-net-user-controls/TVPlayer

    best regards axel

Please Sign in or register to post replies

Write your reply to:

Draft