How to set dynamic home page link in image logo? - c#

MySite.com
when I click site logo, wanna appear sitefinity home page. how to set href atrribute in sitefinity as sitefinity CMS is dynamic home page?

there are several ways to achieve this, depending on how you have your logo setup on the page.
Your home page is usually setup to load when you visit the top level domain, which is at the root of your site.
If this is the case and you have your logo defined in a .master page, you can easily set the link to be the root, like
<img />
If, on the otherhand, you have the image on a sitefinity page or template, you need to make sure that you're adding the image inside a ContentBlock, and not the Image widget from the sidebar. This widget is only used to disaply an image, not link one.
by adding the image to the content block, you can then select it and add a link from the radeditor toolbar to the home page (or any other page)
hope this is helfpul!

Another, rather easy way of doing this would be using your url http://www.mysite.com as href for the logo, which is not too bad either (Although not as dynamic anymore)
But still helpful, especially if you are using some code in your print.css that looks like this:
a:link:after,
a:visited:after {
content: " (" attr(href) ") ";
font-size: 90%;
}
and renders href links after your actual links on printed pages.
This would result in something like the below:
[your company logo] http://www.mysite.com

Related

Open new page outside masterdetailpage

I just new to Xamarin.Form with Prism. I want to load the page in different behavior. The first one I achieve already is in image below.
But I want to do a behavior like below image. Load a new page outside master detail page. How can I do it in prism?
You have figured out how to display the "Hamburger" icon as well as title by doing the following.
NavigationService.NavigateAsync("MasterPage/NavigationPage/DetailsPage")
If a user makes a selection from the actions listed on the master page. For Example, let's say settings.
You have a couple of options here, you can do navigate relatively
NavigationService.NavigateAsync("Settings")
This will navigate to the settings page. This will also display the back button as the second image. Your current page path will be
MasterPage/NavigationPage/DetailsPage/Settings
Now let's say you want the settings page to be the top details page. You have to navigate to it via an absolute path.
MasterPage/NavigationPage/Settings
NavigationService.NavigateAsync("MasterPage/NavigationPage/Settings")
You need to add a new page to the stack, page over existing one. To do that you should do navigation like this:
navigationService.NavigateAsync("Settings")

Can we use HttpHandler and HttpModule to change the content page div from the Master page?

In my application i create a navigation menu dynamically. When I click on the anchor tags that refer to various content page I want to capture the anchor tags' text and display it in a div in the content page.
How can i possibly achieve this?
Can it be done through HttpHandlers? or do I need to look into something else??? Please help.
Assuming that you want your div to look different or be positioned in different places for each content page and all you want to display in that div is the page URL you can solve this using a simple script that you can add in your master page:
document.onload = function()
{
var titleDiv = document.getElementById("titleDiv");
titleDiv.innerText = window.url;
}
The only constraint is that your div must have the same id in all the content pages.

Make a page printer friendly aspx page?

I'm making a pretty simple site using a masterpage and a header and left menu user control. When a user prints the page, I want it to only print the content. Is there a more efficient solution than creating a version of the page that isn't registered to the master page & user controls? Thanks!
CSS media queries with "print" selectors is one common option.
#media print {
.header
{
display:none
}
}
Check out documentation for details w3c, MSDN #media rule, MDN

How can i print a page in asp.net without master page and to change color schemes of the page?

i have made a page in asp.net, i have a costing calculator which has more than 50 fields, dependent on each other, one is the result of previous two and like that, i want my page to be printed in a well manner, and the header of the page which is in master page should not be in print, also the color schemes i want to adjust, let me know the best solution for this which .net provides
Put the content inside <div id="divid">YOUR CONTENT NEEDS TO BE PRINTED</div>
Then call the javascript function on button click which will print the selected area or only html of div. pass the id of div on calling javascript function.
function CallPrint(var strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=10,top=10,width="450",height="250",toolbar=1,scrollbars=1,status=0');
WinPrint.document.write("<html><head><LINK rel=\"stylesheet\" type\"text/css\" href=\"css/print.css\" media=\"print\"><LINK rel=\"stylesheet\" type\"text/css\" href=\"css/print.css\" media=\"screen\"></head><body>");
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.write("</body></html>");
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
return false;
}
Call CallPrint('DivGrid');" on onclick() of button or use below: but.Attributes.Add("OnClick", "return CallPrint('DivGrid');");
Nothing to do with .Net and everything to do with a print stylesheet. You can create a stylesheet which will only work for when the page is printed. And you can change everything from what displays to postion to colours.
Use:
<LINK rel="stylesheet" type"text/css" href="print.css" media="print">
Note media="print" means it'll be used for printed pages.
I know that question has been asked a long time ago, however there is no accepted suggestion. So here my approach for friendly print version when using Master page.
Create an empty master page (PrintVersion.Master) to serv as print version. Add what ever you need to be print (like logos) if anything to that master page.
from your content page, add a print link with target blank. Make the href to load the current page. From the href add a querystring so you can capture it from your content page preinit event.
From your content page preinit event detect if the querystring to print exists, then specify the blank master page like: MasterPageFile = "~/Ful/Path/of/your/PrintVersion.Master"
Optional, on the PrintVersion.Master on document.ready call: window.print(); The browser print dialog will automatically open.
You can make a new printable page version, which doesn't include a header. This version can also have the layout you need.

Adding Images to an ASPX page

I have an aspx page which I am pasting the code from. This page is a preview gallery which when I create a new gallery in my admin panel it auto updates to this page and places the text name I assign in the admin and assigns a page link which takes users to the actual gallery page for that preview... for instance I log in as admin and select manage free gallery.. enter the gallery name (for example" free preview") upload 8 or 9 images and a slideshow then hit submit. The gallery is then created and a link to that gallery is placed on my page for all free galleries. I want to not only have a link but an actual thumbnail image for these.. how would I do this given the code I am pasting below? I would also be willing to just eliminate the text link and go with a clickable thumbnail with a short description under it which actually would probably look better anyway. Pasted ASPX Code follows:
ok so I cant post the code because I am new... any suggestions??? I can email code or post else where if anyone has some help info.
Thanks
How do you create your text link? I assume you're using a asp:Hyperlink control and you're just setting its Text and NavigateUrl properties?
Then you can do the same thing and also set the control's ImageUrl property to the URL path of the image.

Categories

Resources