I'm trying to call dnn modal on click of a link by passing string query parameter to the link in other to retreive from information from the page linking to. here is my href code:
Click Me!
modal appear without any content. and if i point my mouse to the link, this is the url that its showing
javascript:dnnModal.show(''?popUp=true,false,550,950,true)
Please is there anyone that can help. thank you
First of all check in the html page that the required URL was actually rendered, if it's not try the '<%= instead of '<%#
Also, try to call the NavigateURL method by providing the tabId (the page id) without any other params like this:
DotNetNuke.Common.Globals.NavigateURL(tabId)
this dhould get you to the default page
And finally, the popup JS call:
var url= ...
dnnModal.show(url + '?popUp=true', /*showReturn*/false, 550, 950, true, '');
Related
I'm developing a site in angular and suppose I have navigated to iphone detail page and its current url is "localhost:8080/iphone/details" .
Now I have to implement a new functionality of applying coupons.In this suppose user clicks on some hyperlink from external site,
"localhost:8080/iphone/details?promotionalCode=12345"
User will land on that page(page will load after that modal will pop up) and a modal pop's up . And here details of promo code i will fetch from query parameter.
But my requirement is if i click cross (dismiss modal) ,and modal closes and state of url should be changed to localhost:8080/iphone/details .
What i have done till now .
I have used $location.search().promocode to fetch promocode if this is valid than modal will pop up and on dismiss modal i'm calling function in which i'm resetting state using $window.location.href , but this is making the whole page getting refreshed. Any suggestion on this ?
You will need to use $location.search().
To get the query parameter ?promotionalCode=12345, you will need to do $location.search('promotionalCode',12345).
Please see: AngularJS Documentation for $location
You can use $stateProvider for this just give the state
Example: .state('app.page', {
url: 'iphone/details',
title: 'Coupon Applied', })
I need to display or load a HTML page within another HTML page on a button click.I need this in a popup with the main html page as the background..pls can any tell me proper suggestions.
Take a look at the Facebox jQuery plugin. It does pretty much exactly what you're asking for. For example you can have a link like this to some remote page like so
text
then just call the facebox plugin when your content is loaded like so
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
});
and your content will render in a modal window. You can also take a look at Fancybox or ThickBox which provide very similar functionality.
try using windows.open() function.
for Example
var strWindowFeatures = "location=yes,height=570,width=520,scrollbars=yes,status=yes";
var URL = "https://www.linkedin.com/cws/share?mini=true&url=" + location.href;
var win = window.open(URL, "_blank", strWindowFeatures);
I have created one button. I want to redirect to another page by clicking on it in backbone. How can i do that?
I tried following code but it does not work:
router.navigate("/file:///code/order/table.html",true);
Using JavaScript:
window.location.href = 'file:///code/order/table.html';
But I would suggest to use relative path and simple anchor tag:
Table
the backbone router usage is wrong here. from the doc router.navigate(fragment, [options]) this is the function usage, the 1st argument should be fragment, which is registered via the router.routes.
if you would like to navigate to the other file, you may consider the window.location.href
I am using angularjs framework. I have ng-grid having a column containing link text. On that link click, I want to navigate to different page within the same application. I wanted to pass some parameters to another page, so I used ng-click and then method name. So, my code is like this:
<div class="ngCellText"><a data-ng-click="methodName(parameters)"> Go to Page2 </a>
Inside method:
document.location.href = '/Home/page2/
I used target=_blank but it did not work. Any suggestions ?
Thanks.
You need to use window.open method
$window.open('/Home/page2/');
I am triggering a URL change using $location.path with parameters, however those parameters are NOT getting passed to the target page.
My source page is sidebar.html, and my target page is dashboard.html.
In my sidebar.html I render a Kendo UI treeview widget as follows :
<span id="treeview" kendo-tree-view="tree"
style="color:white;"
k-template="vm.treeItemTemplate"
k-options="vm.treeOptions"
k-data-source="vm.reportsTree"
k-on-change="vm.onTreeSelect(kendoEvent)">
</span>
and in my sidebar.js I set vm.treeItemTemplate with a click event:
vm.treeItemTemplate = "<a href='\' ng-click='vm.treeItemClick(this)'> {{dataItem.text}} </a>";
then once I click on the treeview item in the browser, I trigger the vm.treeItemClick event to change the URL and eimit the "reptname" parameter:
vm.treeItemClick = function (item) {
console.log("tree view clicked !");
$location.path('/index.html').search({reptname:'MTM'});
}
This is quite painful, and I would appreciate some advice.
I need use the Kendo treeview object in my left nav bar to allow the user to select a variety of report options, which in turn will redirect to the dashboard.html with specific "reptname" parameter values.
Now when I break on $location.path() inside sidebar.js (using Chrome dev tools), I clearly see the correct URL property on the $location object.
$location
LocationHashbangUrl {$$protocol: "http", $$host: "localhost", $$port: 49479, $$parse: function, $$compose: function…}
$$absUrl: "http://localhost:49479/index.html#/index.html?reptname=MTM"
$$host: "localhost"
$$parse: function (url) {
$$path: "/index.html"
$$protocol: "http"
$$replace: false
$$rewrite: function (url) {
$$search: Object
$$url: "/index.html?reptname=MTM"
__proto__: Object
However, once it's REDIRECTED to dashboard.html (which is defined in my routes as url:"/"), I DO NOT see the parameter list in the $location object, nor in the $routeParams object.
This is where I'm stuck !
----- UPDATE -------
When I manually refresh the index.html page with parameters, the $location object contains the parameters.
ex/ URL: Link entered manually
However if I redirect from sidebar.js using $location.path('/index.html').search({reptname:'MTM'}); , I get nothing !
If you see the parameter in the console but not in your executing code, it might be because Chrome tends to evaluate the console.log with a bit of delay, enought for the async requests to finish and have the data populated, therefor it's not a reliable way of debugging.
Can you listen for the $viewContentLoaded event to be fired and then check the path? That is the view is fully loaded and all variables should be set (including $location.path())
I'm not getting any real answers on this issue, so I ended up solving it this way:
In the Source page, sidebar.js, I have defined the treeview's onSelect event() :
function onTreeSelect(e) {
vm.selectedReport = e.sender._current.text();
$location.url('index.html#/?reptname=' + vm.selectedReport);
}
and on the target page, dashboard.js i read the query string using the hash() method:
vm.reptNameParam = $location.$$hash.split("=");
It seems that $location.url() is the ONLY way I can successfully redirect with a parameters list. Using $location.path() does NOT work for me; meaning, I cannot read the query string in my target page using $location.hash() or any other method as it returns an empty string.