Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
backgroung image is not displaying
code:

ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="error_page.aspx.cs" Inherits="DVD.error_page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
<title></title>
</head>
<body>
<form id="form1"  runat="server" style= "background-image :url(images\error.jpg);">
    <div style="height: 398px; width: 581px"  >    
    </div>
    </form>
    <p>
       </p>
    <p>
         </p>
</body>
</html>



plz help me out..!!!
Posted
Updated 15-Feb-12 0:10am
v2

use
C#
style= "background-image :url(images\error.jpg)

with body as
C#
<body style="background-image :url(images\error.jpg)">
</body>

not with form
 
Share this answer
 
Make sure the image file exist there.

Check this
CSS - background-image[^]
 
Share this answer
 
v2
Comments
Sanjeev236 15-Feb-12 6:13am    
thanks man..!!!!
Sanjeev236 15-Feb-12 6:14am    
can u tell me how to stretch the same image for full page without repeat?
thatraja 15-Feb-12 6:17am    
There is a property background-repeat, check it
thatraja 15-Feb-12 6:24am    
Oops, Ignore my previous reply.
You can change the size by putting bigger values on width & height attributes.
<img src="a.jpg" width=500 height=500 />
Hi there..
Replace your form tag with this, your problem will be resolved..

ASP.NET
<form id="form1" runat="server" style="background-image:<br mode=" hold=" />        url('images/error.jpg')"></form>


Accept the answer if you like it..

All the best.. :)
 
Share this answer
 
hi sanjeev plz you can write code in body section like this

XML
<body style="background-image :url(images\error.jpg)">
</body>



i think its workout
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900