Set the home page and favorites in Asp.net

Source: Internet
Author: User

<A href = "#" onclick = "this. style. behavior = 'url (# default # homepage) '; this. setHomePage ('website address'); "> set to homepage </a>
<A href = "#" onclick = "javascript: window. External. AddFavorite ('website address', 'website name')"> Add to favorites </a>

 

 


Image Link
<A style = "cursor: Hand" onclick = "This. style. Behavior = 'url (# default # homepage )';
This. setHomePage ('www .sccvtc.net '); ">

<U> set as home page </u> </a>


1. Text Type:
<A onclick = "this. style. behavior = 'url (# default # homepage) '; this. setHomePage ('HTTP: // www.sccvtc.net '); "href =" # "> set as homepage </a>
Example:
Set as Homepage

2. Button type:
<Input type = "button" value = "set as Homepage" onclick = "this. style. behavior = 'url (# default # homepage) '; this. setHomePage ('HTTP: // www.sccvtc.net '); "href =" # ">


When you leave, the system automatically prompts you to set it to the homepage.

<Body onUnload = "basebody. style. Behavior = 'url (# default # homepage) '; If (! (Basebody. ishomepage ('HTTP: // www.sccvtc.net ') basebody. setHomePage ('HTTP: // www.sccvtc.net/'); ">


-------------------------------------------------------------
When the page is opened, a window pops up automatically asking if it is set as the homepage
Place the following code between

<Script language = "JavaScript">
Function myhomepage (){
This. Homepage. style. Behavior = 'url (# default # homepage) '; this. Homepage. setHomePage ('HTTP: // www.sccvtc.net ');
}
</SCRIPT>
<P align = "center"> <a href = "http: netbei.com" name = "Homepage"
Onclick = "myhomepage ();"> </a>

 

Add the following code to <body>:

Onload = "myhomepage ();"
That is: <body onload = "myhomepage ();">

------------------------------------------------------------------------------
Set the prompt to homepage when you point

Insert the following code into the <body> area:

<A href = "http://www.sccvtc.net /"
Onmouseover = "this. style. behavior = 'url (# default # homepage) '; this. setHomePage ('HTTP: // www.sccvtc.net '); "target =" _ blank "> set as homepage </a>
-------------------------------------------------------------------------------
Disable the current window function

Here, we can first enter the text "Close the window", drag it with the mouse to select it, type "/" in the "Link" input box, and cut into the source code window, in the link code, type the event-onclick = "javascript: window. close (); Return false ;".
The complete code is: <a href = "/" onclick = "javascript: window. Close (); Return false;"> close the window </a>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.