Forum Index

No notifications
Notifications

Favorites

No favorites found
Ask the community Need help to achieve something? - Ask the Community
Join the Conversation > Ask the community > Performing events when a form is loaded View modes: 
User avatar
KnowledgeKube Staff
KnowledgeKube Staff
nicola.collins - 01/12/2016 08:56:18
   
RE:Performing events when a form is loaded

Hi Scot
Please can you provide us with some more information to help us investigate the issue you are having.


Is this the first time you have loaded your homepage since making the changes to the HTML page content mentioned below


User avatar
Advanced member
Advanced member
scot.jones - 30/11/2016 11:27:34
   
RE:Performing events when a form is loaded

Hi,  

I've just come to impliment the above, however i notice the homepage for my sandbox is not functioning. MyPage.onknowledgekubesandbox.co.uk/error500?aspxerrorpath=/corepages/cdspage.aspx throws an error.

Unrelated I imagine but could we check its functioning, i dont think ive broken it.  I may well be wrong though...


User avatar
KnowledgeKube Staff
KnowledgeKube Staff
Burns - 10/11/2016 11:37:58
   
RE:Performing events when a form is loaded

Hi M1afy!

There is a way to do this!

It will require you to add an inline script into your masterpage HTML Page Content, then reference the script key in a style class on the Navigation Button or Button that contains the ShowForm function.

To do this,

  1. Open up Content Delivery by clicking the Content Delivery Tab
  2. Underneath basicsite click the Master Pages Tile
  3. Double-Click Your Master Page used with that Model
  4. Select the Tab HTML Page Content
  5. Scroll to the very bottom and paste the below script
  6. Click Save at the bottom-right of the page
  7. Click Cancel
  8. Click Publish (Last icon underneath Tools at the top of the page)
  9. Inside your model find the Navigation Button that is using the ShowForm Function
  10. Add a Style Class Attribute with the value of kk_ScrollReset

Here is the script:

<script>

    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args) {
        if (args.get_error() == undefined) {
            SetClientBindings();
        }                   
    }

    function SetClientBindings() {
        jQuery(document).ready(function ($) {
            $('.kk_ScrollReset').click( function() {
                $(window).scrollTop(0);
            });
        });
    }

    SetClientBindings();

</script>

This should have the desired effect.

If you have any issues with this please let us know.

Kind Regards

Burns


1 2 3 4
RSS Feed