473,503 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to redirect webpage via CSS?

1 New Member
I posted this code into a htm. file and I added on my website so i can redirect that page every time somebody access it .

Now can anybody tell me what code should I put into the "lutu1.css" file so I can get the redirection of my page for example to www. google. com

Expand|Select|Wrap|Line Numbers
  1. <P>
  2.   <STRONG>
  3.     <head>
  4.       <link type="text/css" href="http://mydomainname.com/pic1/lutu1.css" media="all"
  5. rel="stylesheet">
  6.     </head>
  7.  
Jan 23 '10 #1
5 21207
sanjib65
102 New Member
You can use the HtttpServerUtility.Transfer method to halt the code running on the current web page and request that a different web page or web site (as you said, www.google.com) carry on the processing.

But my question is, why you chose a CSS file to do this thing?
Jan 24 '10 #2
Frinavale
9,735 Recognized Expert Moderator Expert
Davincourtney,

This HTML code is completely invalid.
You cannot have a <P> element or a <Strong> tag in/around the <head> section. These tags can only be used in the <body> section of the HTML.

This isn't even a CSS related question...I don't even think your page will work with this because it is so invalid.

What are you trying to do?

-Frinny
Jan 25 '10 #3
Niheel
2,456 Recognized Expert Moderator Top Contributor
I think he is trying to redirect his webpage to google via CSS. Or he could just be trying to link to google.

I don't think that's possible.

If you want to redirect via HTML you have to put the following code at the top inbetween <head> </head>
Expand|Select|Wrap|Line Numbers
  1. <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html">
  2.  
If you want to link to website like google you have to use the code below. The url inside the href=" " is the destination webpage.

Expand|Select|Wrap|Line Numbers
  1. <a href="http://www.google.com">going to google now</a>
  2.  
Jan 25 '10 #4
Frinavale
9,735 Recognized Expert Moderator Expert
Ahh, that does make more sense.

Please note that CSS stands for "Cascading Style Sheets". This is used for setting the style for HTML elements on the page (for example you can set the background-color property using CSS). You cannot use CSS to redirect to another web page.

If you want to redirect, you can use the HTML code that Kub has posted. Or you can do this server side as sanjib65 suggested.

You could use the Server.Transfer() method but only if you are "transferring" the user from web page in your website to another web page in your website.

If you are trying to redirect the user to a webpage/website that is out side of your website/server then you need to use the Server.Redirect() method.

-Frinny
Jan 25 '10 #5
drhowarddrfine
7,435 Recognized Expert Expert
Well, in Apache, it's one line in the htaccess file.

You can add a link with CSS but what a user would still have to click it.
Jan 25 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
3268
by: Don Miller | last post by:
I have an ASP script that is called from a PDF form to process form data. On the last line of the script I have a Response.Redirect "webpage.asp" that leads to another target page with actual HTML....
1
4750
by: Paul Lee | last post by:
Hi all, I'm trying to redirect users from a specific domain to one of my webpages. So, in my example, anyone accessing my index.html from the *btinternet.com domain (allowing for wildcards!) will...
2
1920
by: OnLiner | last post by:
I have a site with hundreds of pages. I often get visits from people who have linked to individual pages and not to the main index page. This means that they do not have the correct...
1
4167
by: Jac | last post by:
Aspx-problem : I want to write code (C-sharp) behind a button, that determines on some criteria which webpage an IFRAME has to show. To change a normal webpage you do a redirect in c-scharp...
2
2812
by: Alan Scott | last post by:
I am using the following code to redirect users to another webpage when they click on an image: Response.Redirect("login.aspx"); The code works. However, I have frames setup and would like the...
9
1961
by: postings | last post by:
Just a quick question... When I do a "response.redirect" from a source webpage to a destination webpage, does the code on the source webpage carry on executing unless I put a "response.end"...
2
1939
by: bryant_j_j | last post by:
Hi everyone, Does anybody know how to redirect every visitor to a webpage, except those coming from some specified IP addresses, to a different webpage? Does anybody know of a JavaScript for...
5
4545
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
1
1125
by: sureshreddy | last post by:
hi friends, I want the time to be displayed for a webpage to redirect to another webpage. You can see this concept in job sites when we fill all the details and click the search button it displays...
10
8999
by: Eirik Eldorsen | last post by:
How can I 301 redirect www.example.com/default.aspx to www.example.com without using ISAPI filters?
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.