How To create Custom Action - sharepoint-2010

I want to create one custom action such that on that custom action page one button is available,on that button event i want to show hello word on same custom page

Custom Actions generally are used to link to Application Pages which will do the work.
You can include customactions to the Ribbon, to context menus (ECB), or to the Site Settings pages (as well as Central Administration).
The custom action will typically be a custom section with a link to an application page, and within that page you will perform whatever logic you require. You can pass tokens through to the querystring by enclosing them in parenthesis { } such as <UrlAction Url="/_layouts/MyApplicationPage.aspx?ListItem={ItemId}" />
Here's a link to a tutorial on how to create a custom action to appear in the Site Settings page. Google around for simliar tutorials on how to get a custom action to appear in other areas, such as the Ribbon or the ECB.

Related

WKWebView - replace web action

Inside my app, I'm using the WKWebView to display a website. My goal is, when user is pressing a button on this website, I want to stop an action linked to this event and replace it with my own, natively made (custom action outside the WKWebView). I've been trying to search for any solution to fetch mentioned event but unsuccessful. What more came to my mind, if there is a way to fetch a JavaScript in WKWebView, I have a possibility to add some JS script code to this site (not to delete the action I want to block). Thank you for any help.
First, do you have a permission to mess with this web site's behaviour? I assume you do, otherwise it is likely illegal.
Second, try using Safari Web Inspector with a device/simulator, and use the DOM tree and console tools to find out what is the HTML/javascript that is involved with this action on this site.
If you can't find what happens in HTML/JS yourself, feel free to post a new separate question on SO with your target URL, some HTML/JS code, and which link/action you want to replace. Tag the question with "javascript" and ask if it is possible to write some javascript to replace that particular action to some custom JS code.
Usually there are 2 types of actions: either it is something that provokes AJAX calls to a server API triggered by an event handler, or it is a plain HTML link that results in a web navigation. For both cases it is possible to write a JS script that overrides the action.
Finally, use WKUserScript to inject javascript into the page, and override the action. Use window.webkit.messageHandlers to send an event from your custom action to the app side. Use WKScriptMessageHandler to process the event in the Objective-C or Swift code.
See an example here: http://nshipster.com/wkwebkit/

How to add a custom TPL on whmcs cart

We are trying to add a new .TPL file inside our Cart Template, we already did everything but when we try acessing:
site.com/cart?a=newfile
It does not work, is there any way to make WHMCS see the new file as part of the template in question?
I trying to create a custom register page to my template.
Thank you
If your aim is to create a custom registration page, I suggest you to continue with whmcs default templates instead of creating your own template.
In your custom registration page :
-if you want to customize the style,
you can do that by just editing css and html within viewcart.tpl.
-if you want to addcustom field and inputs into your custom registration form,
using in Admin area of whmcs Setup-> Custom Client Fields section,
you can add various of inputs with validation.
-if you want to some action on the registration event,
use this hook to catch the event and take your action,
it will fire whenever someone registers from your website :
http://docs.whmcs.com/Hooks:ClientAreaRegister

How to use/handle a loader in an MVC app?

in a ASP.NET MVC application that I am currently working there are multiple places in a single page that the user can click. So there is a main menu that's in _layout and for each inidividual page there can be links associated with that page.
I am trying to use a loader which will be shown on every click, mainly where the response takes time but for now it's for every click.
For example in the home page, from the main menu the user can click Students and the loader should come up and hide when the page loads completely. On the students page there can be an ajax call that gets data and binds it to the grid.
So from the time the user clicks on a menu link and the page loads the loader is active/shown. It's hidden once the page loads completely.
The grid can have editing functionality and when the user clicks on any of the CRUD links the loader should show and hide.
I am looking at suggestions on implementing this requirement.
If I can hookup any of the MVC events, that would be cool as I want less of Javascript/jQuery stuff but if Javascript/jQuery is the way then that's fine too.
Currently I don't have anything so anypointers are appreciated.
Assuming AJAX is being used
I don't see a way to keep this server-side without a middle page with a redirect being used (which would just be unnecessary bloat). And, since you're not opposed, you can implement this fairly easily using jQuery and something like blockUI.
I'll let you play with refining the binding to only links you care about, but for now we'll assume all links. Also, MVC should be using jQuery for things like Ajax.Actionlink so we can hijack events like $.ajaxStart and $.ajaxStop:
function showLoadingScreen(enabled){
return enabled ? $.blockUI() : $.unblockUI();
}
$(document).ajaxStart(function(){
showLoadingScreen(true);
}).ajaxStop(function(){
showLoadingScreen(false);
});
Later on you can maybe apply classes to the links you care about and just bind to them (instead of $.ajaxStart) but I'll leave that up to you.

Why is WinJS.UI.processAll() called automatically for you in Page Controls but not elsewhere?

The MSDN Documentation explains when to call WinJS.UI.processAll() yourself in your apps and when it's done for you automatically:
If you aren't using the Blank Application template or if you're adding
the control to a page that you created yourself, you might need to add
a call to WinJS.UI.processAll.
If you added the control to your app's home page (which is usually the default.html file), add a call to WinJS.UI.processAll in your onactivated event handler, as shown in the previous example.
If you added the control to a Page control, you don't need to add a call to WinJS.UI.processAll because the Page control does that for you automatically.
If you added the control to another page that is not your app's home page, handle the DOMContentLoaded event and use the handler to call WinJS.UI.processAll.
What's the reasoning behind the system calling WinJS.UI.processAll() automatically for you inside Page Controls, but not elsewhere?
It's also because the Navigation template (and the Grid template which is derives from the Navigation template) includes at least one data-win-control element so it needs to be processed to function.
We (Microsoft) don't want to put too much in the blank project template because after all it is "blank". So the blank project template just gives you the single page, no navigation, no controls, and thus no need for any processing. You can decide to add that on your own.

How to change global navigation of a web page but not the site in SharePoint 2010?

I created a web page with a custom page layout, the site the page is within has global navigation set to "Display the same navigation items as the parent site" and it was all good. I have now got the requirement to change the items in the global navigation for the page but keep the old setting for the site, how can I achieve this?
For a site I can go to site settings -> navigation and change the links as I like but the page is dependent on the site it is within. I don't have to start over and create a new site do I (instead of a simple page)?
Thanks in advance.
Unless you do some kind of trickery (like Javascript embedded in the page) to do otherwise, the navigation settings are shared for all pages within the site.
If you wanted to get rid of global navigation for a particular page, you could customize your master page to put a special CSS class on the element wrapping it, and use some CSS inline on that page (ie. in a content editor webpart) to hide it.