Click to See Complete Forum and Search --> : Basic UI questions


Ishaibin
March 3rd, 2007, 03:53 PM
Hello !

Im an experienced software engineer but a real novice in asp.net
and internet technology (dont know html or any scripting lunguage)
so i will be very glad if you can fill two small gaps i now have
after reading an asp book :)

1.I used the table layout and created a cell on the left side of the screen
to contain the treeview.
The cell is on the same row as another large cell , used to contain the content holder.
When the cell with the content holder stretches automatically it also stretches the tree view cell.
This causes the tree view control to move to the center of the cell - at the bottom of the screen...
I cant figure out how to align the tree view to the upper side of the cell - and make it stay there !
I dont want to use the absolute positioning (unless its the only way :( ).

2.How can i use an image as a background to the tree view ?
I searched in the docs but couldnt find anyway.

Best regards !

Ishai

hspc
March 3rd, 2007, 05:12 PM
Please post the HTML or attach the aspx page. this can make the problem easier to solve..

Ishaibin
March 3rd, 2007, 05:16 PM
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!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>Untitled Page</title>
</head>
<body dir="rtl">
<form id="form1" runat="server">
<div>
&nbsp;</div>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
<tr>
<td colspan="2" style="height: 72px">
</td>
</tr>
<tr>
<td style="width: 286px; height: 117px">
<asp:TreeView ID="TreeView1" runat="server" ImageSet="BulletedList" DataSourceID="SiteMapDataSource1" ShowExpandCollapse="False" style="z-index: 100; right: 18px; position: absolute; top: 146px" Width="163px" >
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px"
VerticalPadding="0px" />
<Nodes>
<asp:TreeNode Text="ראשי" Value="New Node" Target="\\default.aspx"></asp:TreeNode>
<asp:TreeNode Text="טיפולים" Value="New Node" Target="\\content\treatments.aspx"></asp:TreeNode>
<asp:TreeNode Text="אודותי" Value="New Node" Target="\\content\about.aspx"></asp:TreeNode>
<asp:TreeNode Text="מהו הילינג" Value="New Node" Target="\\content\whatishealing.aspx"></asp:TreeNode>
<asp:TreeNode Text="מפגשים מחבקים גוף ונפש" Value="New Node" Target="\\content\gatheringevening.aspx"></asp:TreeNode>
<asp:TreeNode Text="יעוץ מקצועי" Value="New Node"></asp:TreeNode>
<asp:TreeNode Text="צור קשר" Value="New Node"></asp:TreeNode>
</Nodes>
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="0px"
NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</td>
<td style="height: 117px">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</form>
</body>
</html>

Ishaibin
March 4th, 2007, 01:23 PM
Hi !

can someone please help me ?

I think those are very easy questions :

1.how do i control the position of a control inside a cell ?

2.how do i put an image as background in a tree view control ?

best regards.

Ishai

JetDeveloper
March 4th, 2007, 11:52 PM
1.how do i control the position of a control inside a cell ?

For a table cell use valign for vertical alignment, align for horizontal alignment. For valign the values can be "top","middle","bottom"
For align, they can be "left","center","right"

<td valign="top" align="center">
Some html
</td>

This will put the content at the top of the table cell and center it horizontally.

2.how do i put an image as background in a tree view control ?

Use css background-image property.

http://www.w3schools.com/css/pr_background-image.asp

Ishaibin
March 9th, 2007, 04:59 PM
Hi !
Thank you very much for your help.

I used the style property :


<asp:TreeView ID="TreeView1" runat="server" ImageSet="BulletedList" DataSourceID="SiteMapDataSource1" ShowExpandCollapse="False" style="z-index: 100; right: 18px; position: static; top: 146px; background-image: url(App_Data/energy_transfer.jpg); text-align: right; background-position: left center; background-attachment: fixed; background-repeat: repeat-x;" Width="163px">


but still , when I debug the webpage there is no background image ...
I tried to set the cell background image - didnt work either!
For some reason I only manage to set the background as simple color.

What can be the problem ?

Ishaibin
March 9th, 2007, 06:19 PM
Hi ,

My problem is the following :

The style works but only on the default content page.
When I run the site and change the content page using the tree view - the images disappear and return only when i go back to the default content page

How can I solve it ?

Thank you very much.