Copied to clipboard

Flag this post as spam?

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


  • Steve 472 posts 1216 karma points
    Jan 26, 2016 @ 17:18
    Steve
    0

    User Control to Post Form Data

    I am using Umbraco v. 6.1.6 and webforms. Trying to create a user control with form fields that could be submitted as an email to a recipient or posted to an SQL data base. Here is my .ascx

    <script src="/scripts/cookies.js"></script>
    
    
    <div id=newUserForm">
        <p>Name: <asp:TextBox ID="user" runat="server" OnTextChanged="user_TextChanged"></asp:TextBox></p>
        <p>Year of High School Graduation: <asp:TextBox ID="year" runat="server" OnTextChanged="year_TextChanged"></asp:TextBox></p>
        <asp:Button ID="Submit" runat="server" OnClientClick="Submit" Text="Submit" />
    </div>
    

    I don't know how to post the data from the textBoxes when "OnClientClick", there just isn't any documentation out there on the methods needed. I guess I need help with the CodeBehind for the post.

    Also, would like to only make the form visible after a cookie check. I've got the Javascript for the cookie check, but not sure how to implement it with the user control.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 26, 2016 @ 18:24
    Dennis Aaen
    0

    Hi Steve,

    I was thinking if you could use a custom table and save data into this. If this could be a possible solution for you, try see this video from Aptitude

    https://www.aptitude.co.uk/videos/using-custom-tables-data-in-umbraco/

    /Dennis

  • Steve 472 posts 1216 karma points
    Jan 26, 2016 @ 19:53
    Steve
    0

    We aren't using Mvc, so this is not an option. Thanks though.

Please Sign in or register to post replies

Write your reply to:

Draft