none
Need some rookie help please RRS feed

  • Question

  • Morning everyone,

    I'll be glad to take the heat for this newb question, but I've been researching for hours, and I need to get this done and move on.  So I'm very new to the coding world, but I'm enjoying the process of learning.  Currently I'm trying to pass a few parameters of data that I successfully passed through an endpoint of a small website project I'm practicing on, a few words of data, to my azure account, super excited stuff to finally get a button and a few placeholders to actually do something.  So, to my problem, I need to have that little bit of info come back to the endpoint it was sent from for storage, as the premise of said site is for users to be able to see this data after it's been sent to the database.  Even if you make fun of me for 20 minutes, as long as I get schooled on how to get this data back to the front end so I can display it to the user, well worth it.  I'm currently using C# via Visual Studios.

    Thanks for any help I can get

    Have a blessed day

    Jeremy 

    • Moved by CoolDadTx Sunday, July 9, 2017 10:11 PM ASP.NET related
    Sunday, July 9, 2017 8:48 AM

All replies

  • Hello,

    So those who may assist will want to know what type of service you are writing and perhaps see a small segment of code (make sure to use the code button).


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, July 9, 2017 9:06 AM
  • $('#reportform').submit(clickSubmit);
    function clickSubmit(e) {
        e.preventDefault();
        var report = {
            fullname: $('#FullName').val(),
            category: $("#category option:selected").text(),
            comment: $('#comment').val()
        };
        $.ajax({
            url: 'http://localhost:52328/api/karma',
            type: 'POST',
            contentType: 'application/json',
            dataType: 'json',
            data: JSON.stringify(report),
            success: function (data) {
                console.log(data);
            }
        });
    }
    

    namespace karmaKalculator.Models
    {
        public class KarmaModel
        {
            public string FullName { get; set; }
            public string Category { get; set; }
            public string Comment { get; set; }
            public string Id { get; set; }

        }
    }

    There is my Model

    There is the JS, I'll send some of the C# in a second.  This is an app that will allow communication
    between co-workers for the hopefully betterment of morale, sort of like a secret compliment giver for
    a job well done.

    So, I'm sure it's a simple code process to get this collection information back to the front end for
    display by the users. I have just been up all night, and I am ready for a nudge in the right direction.
    I have a lot of return(null) and


    Sunday, July 9, 2017 9:24 AM
  • I'm sure it's something simple that I need to construct in my Controller.cs that I could use a GET, along with the
    file ID number that populates every time I push to Azure, but I'm just out of gas, been@it for almost 2 days straight.  I've made a ton of great progress, just bowing out to this little speed-bump.  any help would be great.

    Jeremy

    Sunday, July 9, 2017 9:28 AM
  • <form id="reportform" class="row">
            <div class="row">
                <input class="col-12" id="FullName" type="text" required placeholder="Full Name (Max Characters of 80)" maxlength="80" />
            </div>
            <div class="row">
                <select id="category" class="col-12">
                    <option value="Accounting">Accounting</option>
                    <option value="Assistant Director">Assistant Director</option>
                    <option value="Banquets">Banquets</option>
                    <option value="Bellman">Bellman</option>
                    <option value="Call Center">Call Center</option>
                    <option value="Captain">Captain</option>
                    <option value="Coast">Coast</option>
                    <option value="Guest Relations">Guest Relations</option>
                    <option value="Concierge">Concierge</option>
                    <option value="Contractor">Contractor</option>
                    <option value="Culinarians">Culinarians</option>
                    <option value="Director">Director</option>
                    <option value="Doorman">Doorman</option>
                    <option value="Engineering">Engineering</option>
                    <option value="Executive">Executive</option>
                    <option value="Front Desk">Front Desk</option>
                    <option value="Housekeeping">Housekeeping</option>
                    <option value="Human Resources">Human Resources</option>
                    <option value="Laundry">Laundry</option>
                    <option value="Lobby Lounge">Lobby Lounge</option>
                    <option value="Loss Prevention">Loss Prevention</option>
                    <option value="Manager">Manager</option>
                    <option value="MSE">MSE</option>
                    <option value="Ocean Bar">Ocean Bar</option>
                    <option value="Purchasing">Purchasing</option>
                    <option value="RC Club">RC Club</option>
                    <option value="Recreation">Recreation</option>
                    <option value="Retail">Retail</option>
                    <option value="Salt">Salt</option>
                    <option value="Spa">Spa</option>
                    <option value="Supervisor">Supervisor</option>
                    <option value="Stewarding">Stewarding</option>
                    <option value="Supervisor">Supervisor</option>
                    <option value="The Pub">The Pub</option>
                    <option value="Turndown">Turndown</option>
                    <option value="Valet">Valet</option>
                </select>
            </div>
            <div class="row">
                <textarea id="comment" class="col-12" placeholder="Description of Request (Max Characters of 1000)" maxlength="1000" required></textarea>
            </div>
            <div class="row">
                <button class="col-12 karmabutton" id="submitreport" type="submit">Report</button>
            </div>
    </form>

    ....and the C#

    Any nudges in the right direction will be enough for a second wind to get this properly done.

    Sunday, July 9, 2017 9:42 AM
  • Your question is related to web development. Unfortunately we don't provide that support here. Please ask your question in the ASP.NET forums. That is the dedicated forums for web development questions. Unfortunately we cannot, at this time, move your post over there as they are separate systems.
    Sunday, July 9, 2017 10:11 PM