.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CSS With Databinder And Left Trim

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net

Hi there,

I've got a problem with the CSS layout for my website and the Container.DataItem nested inside a repeater.

I use a two column layout, and Databinder is in the left column.  When I use the trim, the right column goes under the left column and won't go over to the right column like it's supposed to.  The left column and right column both work fine with plain HTML.  I'm working on a blog for the website, so that's why I want the text trimmed.  Last night I thought I was going crazy and that my CSS skills needed brushing up.  Turns out it's a problem related to ASP.NET.  I'm a bit lost at this, so I'd appreciate if someone could point me in the right direction.  I'll post the code below.


html>body {
	margin: 0;
	padding: 0;

body {
	background-image: url(images/background.jpg);
	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
	margin: 0;
	padding: 0;

#wrapper {
	background-image: url(images/wrapper.jpg);
	overflow: hidden;
	position: absolute; 
	/*height: 100%;*/
	/*min-height: 100%;*/
	width: 70%;
	margin-left: 200px;

#header {
	clear: both;

.logo {
	font-size: 40px;
	font-family: "Reprise Rehearsal";
	padding-top: 20px;

#LeftColumn {
	float: left;
	padding-left: 50p

View Complete Post

More Related Resource Links

left right margin


Hiii Coders ,

I have created my website. Now what is my requirement is that on higher resolution it should be centralized means margin from both sides should be same.

How can i get it working

plz provide me some code snippet plz

thanx and regards

Trim function in C Sharp

How do i use "trim" function in C Sharp? I have a string and i want to strip off spaces from the end of the string. Any idea how do i do it??


Drop-Right/Left submenus


 I'm currently using the CurvedMenuProjects custom control and I does almost everything I need a Menu Control to do but it doesn't swap submenu position (left/right) when the dropdown goes off the right edge of the screen.


Does anybody know if it's possible to configure the control to do this?


Any pointers on how I can get started writing the behavior into the custom control myself?




SharePoint Security: Trim SharePoint Search Results for Better Security


SharePoint search may return too much information, causing data security problems. Learn how to use the custom security trimmer to ensure users see only the documents they have permission to view.

Ashley Elenjickal, Pooja Harjani

MSDN Magazine July 2010

Only 12 days left in the Code Contest!


We are having a fun coding contest to find the best solution to a fairly trivial coding problem.  Come along and show off your skills . you might just win a totally awesome Gyroscope Powerball!

Participate in the Code Contest!

Problem with System.Web.UI.DataBinder ??

Hi. I want to edit some fields in GridView so i wrote a code, but i need to use Eval() method and rowcommands so as i read in book i need to use ystem.Web.UI.DataBinder class which is part of System.Web.UI. I added but still got the problem:'ASP.default3_aspx' does not contain a definition for 'GridView7_RowDeleted' and no extension method 'GridView7_RowDeleted' accepting a first argument of type 'ASP.default3_aspx' could be found (are you missing a using directive or an assembly reference?)Here's my assemblies:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;

How can I align Left the text into a Button?

I've tried: Code Snippet Button button = new Button(); button.Width = 200; TextBlock textBlock = new TextBlock(); textBlock.Text = "Aligned text" textBlock.TextAlignment = TextAlignment.Left; button.Content = textBlock;   but it is not working.

How to scroll the DataGrid (horizontally) when user drags a column header far left or right?

We're working with the WPF DataGrid and I have a question about  dragging column headers: The grid lets the user rearrange the columns, by dragging the column header left or right.  So far, so good. But, sometimes we have many columns, and only the first few columns are visible; so there is a horizontal scrollbar.  In such case, if the user drags a column header to the right edge of the DataGrid window, I want the DataGrid to scroll, automatically, one column at a time.  Is there an easy way to do that? (To be clear: yes, the user can already scroll horizontally by interacting with the horizontal scrollbar, but that isn't what I'm asking about.  I'm asking if the "drag a column header left or right" gesture can cause the DataGrid to scroll left or right.) I guess I could handle various low-level events, but it seems like it shouldn't be necessary -- DataGrid has so much functionality built-in, that I'm guessing it already has the ability to scroll when the user drags the column header to the edge.  So, is there either (a) a property that I can set, to tell the DataGrid to scroll when the user drags a column header to the edge of the window;  or (b) a code example showing how to achieve this effect myself?  Thanks!

Textblock and left/top alignment has different space

Hi, when i add a text the text is aligned left,top by default. At the left the text hits the edge, but at the top the text still has space left. Is this because of some special characters that need that space? I would like to show the text with left and top the same amount of space. <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <TextBlock Background="Red" FontSize="100" FontFamily="Verdana" Padding="0" >T98}`|_*dfshjd sjlksdj dsjl djskldj lksj dlksj</TextBlock> </Grid> </Window>

How do I keep the #region/#endregion directives on the left edge, or is that possible (C#)?

Hello, How do I keep the #region/#endregion directives on the left edge, or is that possible (C#)? The #region/#endregion keep moving to the left to align with the rest of the code.  I don't want that to happen. Regards, Robert

Left Outer Join fails to return all records

I have a table tblDrop that contains 1067 records for 8/31/2010 and a table tblSoftcount that has 739 records, some with bad serial numbers. I need to match all of the records in tblDrop with those in tblSoftcount. I have a query using Left outer join that has worked for the duration of the application, but has recently stopped returing the full set of records from tblDrop. We have not changed the SQL versions on the server (compatibility level 2005). Here is the query: SELECT   v.SlotNum_ID, s.SlotNum_ID, v.PTNumber, s.PTNumber, v.DropBillAmount AS [Drop], v.ReportDate, v.DateValue     FROM tbl_Drop v LEFT OUTER JOIN tblSoftCount s ON v.SlotNum_ID = s.SlotNum_ID AND v.ReportDate = s.ReportDate WHERE   s.ReportDate = '8/31/2010' AND v.DropBillAmount <> 0 AND s.Slotnum_ID IS NULL;  

Trim a string

Hi, The result of this line document.getElementById('listName').innerText = args.get_fileName(); is filename.csv... How do I trim the .csv off the end? 

Format datetime in <%#DataBinder.Eval(Container.DataItem, "DBDate")%>

I have a date in a database which i bring into a repeater using <%#DataBinder.Eval(Container.DataItem, "DBDate")%>.  Can I format the datetime which is write to remove the time bit from it.  At the moment it is written in this format:25/02/2007 00:00:00. I want it to be 25/02/2007 or even a more readable date such as February 25th 2007. Thanks Andrew

Edit Blog site - hide the left navigation bar

Hi, We want to customize the look & frrl of a blog. I don't see a page layout gallery, only master pages. Which master page is used and how may i hide the left navigation bar?

collapsing the left menu as a default

 Hi! i have a menu on the left of the page which appears in the expandable form. I want to see them as the collapsed menu based on the site map group. I have posted the site map code and the master page here. Any idea please<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="~/Default.aspx" title="Modules" description="Modules"> <siteMapNode url="~/Modules/Hire/Hire.aspx" title="Hire" description="Hire" resourceKey="HIR"> <siteMapNode url="~/Modules/Hire/Hire_Request_Navigator.aspx" title="Booking Request" resourceKey="HIR_REQ" description="Booking Request"> <siteMapNode url="~/Modules/Hire/Hire_Request_Detail.aspx" title="Request Detail" resourceKey="0" isPhantom="true"/> </siteMapNode> <siteMapNode url="~/Modules/Hire/Hire_Booking_Navigator.aspx" title="Booking" resourceKey="HIR_BOO"> <siteMapNode url="~/Modules/Hire/Hire_Booking_Fleet_Available.aspx" title="Booking Vehicle Selection" resourceKey="0" isPhantom="true"/> <siteMapNode url="

Open ContextMenuStrip on left mouse click on NotifyIcon

Hi,I was working with an application and faced this problem, I have this code :public partial class Form2 : Form    {        public Form2()        {            InitializeComponent();        }        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)        {            if (e.Button == MouseButtons.Left)            {                contextMenuStrip1.Show(this, Control.MousePosition); // Or any other overload            }        }        private void Form2_Load(object sender, EventArgs e)        {            notifyIcon1.Icon = Icon;        }    }Here, in design mode, i have set contextMenuStrip1 as notifyIcon1's ContextMenuStrip. When I right click on notifyIcon1, it opens the context menu and when I click somewhere else, it closes. But with my code opens the contextmenu on left click and when I open context menu that way, it shows in taskbar and doesn't close when I click some where else.In short, I want to open contextmenustrip when user left clicks and right clicks on the notifyicon and it works well with right click by default but not with left click. And I want to avoid using SendMessage to send left click message.Is there any way I can work this out?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend