Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Doing 4 .aspx tasks, in one .aspx. Final. help!

    http://media.bloomu.edu/watch/?id=4fa81566ec488

    The part I need help with start at 1:08.

    This is for my final. I am completely stumped on how to go about this... I only know how to make separate .aspx files with separate links. Can anyone give me some help on how to essentially "merge" them to do 4 things without the user clicking anything?



    UPDATE: This table of data is what I need to work off of.

    EmpName EmpGender Salary
    Ginny F $100,000.00
    Carl M $90,000.00
    Chrissy F $90,000.00
    Rose F $45,000.00
    Joe M $30,000.00
    Last edited by oddish; 05-09-2012 at 07:06 PM.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,869
    Thanks
    79
    Thanked 4,421 Times in 4,386 Posts
    Since he says you must do all the operations with no interaction from the user, I would simply have JavaScript "push" a button that causes the next action to happen.

    So think of it as a single ASP.NET page with 3 or 4 buttons, each with an ASP.NET server-side ONCLICK handler. And then have JavaScript code that, after a delay, pushes the next button in sequence, effectively causing the page to post back to the server with that button clicked.

    You could also do it with AJAX. But I think that violates the spirit of the "one single page" that your instructor wants.

    If you haven't yet created an ASP.NET page (one single page) that can react to any one of several button clicks, then it's time to get started creating one, ASAP. (It's really trivial...If you use Visual Studio it will lead you by the hand and help you do it.)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,755
    Thanks
    41
    Thanked 191 Times in 190 Posts
    i think the automating it is really stupid-
    I would make it 'the easy way' which would be to have a grid that onload populates from your database...
    then essentially have 3 buttons
    Button1: Add new record
    Button2: Update a record
    Button3: Delete a record

    let them act as normal <asp:Button/>'s- they will do a postback of the page and if you have your page load correct for the grid it will populate accordingly...
    you can then have a javascript with a 20second time fire a button based off a cookie or something so it will essentially 'click' each button in sequence after a particular delay.

    there didn't seem to be any real 'guidelines' so you could 'cheat' as well (I say cheat but if you know how to do it then you are past the basic concepts that he is trying to drive)....

    since he is "not going to touch the keyboard again" don't ever do a postback...
    create three global datatables
    onpageload initialize each one of them to your fist call... in two of them add a record, and in one of those two change a record (you now have all the 'views' you will need). bind each of those to a differend gridview and have each grid be in a seperate div... onpageload divA is display:block, others are display:none;.... then step through a timer and essentially change the displays of each one- you will never have a post back

    you will be proving that you get those concepts bc you have gone past what point he is trying to drive- my opinion anyways.... and based on his requirements that is acceptable (but that could all change pending the rules/regulations)....

    I think though that the most important point is to make sure you have key concepts down...

    the first and obvious is that you know how to get/pass data to a database... that is the entire point of that exercise. Selecting data, inserting data, updating data, deleting data

    the next point that he seems to be driving is utilizing javascript to fire events automatically.

    I would practice what you are weakest on- me I am strong on backend- I wouldn't need to check DB back and forth at all- but I am not strong on javascript- hardly ever do it...
    I would practice by making a ton of different event listeners... do keyup event checks, do time loops that check variables in the DOM and if they are met do something- fire postbacks, fire redirects, fire asp functions, etc.... coding is all practice practice practice... I think the key here is not so much prepping for the final in the sense he told you what it 'was going to be' but prepping for the final so that you understand the concepts that they are driving.

    *just my opinion

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,869
    Thanks
    79
    Thanked 4,421 Times in 4,386 Posts
    Heh...but since Thursday is today, I suspect your advice (and even mine) is likely too late for him, Alykins.

    But I'm glad to see you agree with my suggest methodology. Essentially, do it as you would a manual page and only use the JS to automatically push the buttons.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •