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

Top 5 Contributors of the Month
Imran Ghani
Sohaib Khalid
Post New Web Links

Simple CSS alignment problem

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net


Im trying to create a page with css layout instead of tables.

I want to create a div that is 100% long, and contains three buttons (maybe more?). The first button should be placed to the left, the second in the middle, and the third to the right. They shall, of course, be placed on the same horizontal line.

How to do this with css?

Thanks alot :)

Kind regards,


View Complete Post

More Related Resource Links

gridview table alignment problem

hi all, i designed a gridiview, within that ItemTemplate i drew an table then tr then some of td's, now the problem is after every row im getting one empty row, what is the problem and how to resolve it. below is my code <ItemTemplate>                                             <table cellspacing="0" cellpadding="0" style="border-right:1px solid Black;" >                                                 <tr  >                                                     <td width="1%" align="center" style="border-right:1px solid Black;">          &n

simple wfc and ajax problem

Good day,I wrote a very basic hello world wfc/ajax solution.C#public string sayHello(string name)    {        return "Hello " + name;    }JS:function go() {            tempuri.org.IService.sayHello("John", OnSuccess());        }        function OnSuccess(r) {            document.getElementById("result").innerHTML = r;        }All the plumbing is pretty much what all the dev sites say...but I am getting a curious result.If I put a break in OnSuccess and in sayHello functions. The onSuccess is hit before the sayHello - both are hit though so the wfc seems to be working its just that the onSuccess is being called straight away rather than after the return from the server.Help appreciatedKalCODE:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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">

best approach to a simple problem.

let me preface this with saying, i dont really know css or javascript or even xml really. i know enough to do what i need to, i dont know best practices, i can just get it done, so im aksing this to make sure the way i plan on doing this is a good way. just need to be pushed in the right direction. so im looking to make a simple webpage (client side only) that allows a user to pick colors for a IDE (think Visual Studio) so what i want to do is show a segment of code that shows something of all color types.. so think of a code segment like this response.write "hello world" there could be 4 different colors in this... the object, response, the period (it has a name, i forget it), the member, write, and a type, string.. so what im thinking is that there is some text on the page and a drop down that lets you pick the type to color, and then the color... so im thinking to use div tags to identify each type <div id=object>response</div><div id=period>.</div> etc etc and then do an on change for the color drop down to update the colors.. so i can do that, but the question is, im wanting to use CSS/XML so that way, if i get a couple of themes, i can then add a theme drop down to show some premade setups... default.xml <options> <object>red</object> <period>black</object>

Simple GUI problem

So I don't know what's going on, but when I try to select a control (a textbox in my case), it only selects the lowest level control.  What I mean, is that if there is a grid, with a second grid inside, with a textbox inside of that grid - I am unable to left click the text box.  When i right click->select, it doesn't even give me the option to select the text box.  The only way I'm able to do it, is through the document outline, which is a pain. Any info will be much appreciated thanks, Phil  

Seemingly simple URL rerouting problem


// ** URL ROUTING **  
private static void RegisterRoutes(System.Web.Routing.RouteCollection routes)  
  routes.MapPageRoute("Subsite", "{SubsiteName}", "~/Content.aspx");  
  //routes.MapPageRoute("About", "About", "~/Content.aspx");  
  //routes.MapPageRoute("Conferences", "Conferences", "~/Content.aspx");  
  //routes.MapPageRoute("PoliticsPortal", "PoliticsPortal", "~/Content.aspx");  
I am trying to register my routes as above, using a single routes.MapPageRoute() statement to cover all locations of the form www.mysite.com/subsiteName; however, I encounter all sorts of bizarre browser errors relating to my use of client-side AJAX.  If instead I use a separate "hard-coded" statement for each route, it all seems to work.

I have noticed that examples for this on the web (e.g. http://msdn.microsoft.com/en-us/library/cc668177.aspx) all seems to have at least two components in the URL path; e.g.,

routes.MapPageRoute("SalesSummaryRoute", "SalesReportSummary/{locale}", "~/sales.aspx");  
It is possible to do what I'm trying to do, isn't it?  Is there something fundamentally wrong with my approach?

Problem with css vertical alignment



I want to create a box, that looks and acts exactly like in this image (I have edited it in photoshop to make it look like what I want):


As you can see, the heading should be vertically middle aligned. And if the text exceeds the width, the text should then take up the place like normal behaviour.

Ive tried to accomplish this for a long time now, but cant get it right! Problem is that I cant make the text vertically align, since I´m using the display:block;

Here is what i have:


<div class="outer">
  <span class="heading" >Long heading that should take up all the place, but not expand the box </span>
  <div class="inner">
  <b>Description</b><br />just some random text<br />blablabla<br />


  border:1px solid #797979;


JQuery - Simple Cookie problem


Hi everyone,

The following code does not work as I expect.  If possible, please fix the following code for me.



var shopping_cart_id = $.cookie('ASP_NET_4_WEBSITE_3_ShoppingCartId');
if (shopping_cart_id == "") {  // not sure ????
shopping_cart_id = guid();
//Create (or update) the value of a cookie to expire in 30 days:
$.cookie('ASP_NET_4_WEBSITE_3_ShoppingCartId', shopping_cart_id, { expires: 30 });




simple css problem


All I'm trying to do is display a line in my header with 4 elements like the following:

 Case ID:   130                                                                                             Original Input: xxx

No matter what I try however, the "xxx" part always displays below the "Original Input" instead of to the right of it.

Following is my code; I've spent an inordinate amount of time on this and I'm hoping it's just something stupid I'm missing. I'd greatlly appreciate any suggestions.


<head runat="server">
    <style type="text/css">

WPF Ribbon's application menu alignment problem: bug or programmer error?

I'm using WPF 4's (in .NET 4) ribbon control, version 3.5.40729.1, in my application. The application menu and all sub-menu popups align as far left as possible, usually far outside the ribbon window. The expected location is that the application menu's left edge aligns with the ribbon window's left edge, and that sub-menu popups will align with the left edge of the right (usually recent items) content pane.

Here's an example screen shot illustrating the issue I'm having. Note that the left edge of this screen shot is the left edge of my monitor.

Here's a snippet of code showing the XAML of the RibbonWindow root element and the beginning of the ribbon declaration:


gridview alignment problem


I have a table in which  gridview1 is created when the user clicks a button outside this table.

when the user then clicks on a rowcommand button from Gridview1 a second gridview, chldgrdvw, is created in the next cell on the same row of the table.

My issue is that I would like the second gridview (chldgrdvw) to align with the the row clicked from gridview1.  Currently I can only get chldgv to align based on its table cell properties ie (top of cell, left of cell, bottom of cell etc..)

Gridview Header & table data alignment problem



Newbie to ASP.net. Programming in C#.

I'm querying a SQL database and displaying the results in a gridview.

The results can be many records so I need to provide the facility to scroll. To display the headers when scroling I have implemented ( in my asp code) the headers in another table and the data is in another table. I see now I cannot align the column headers with the table data.

Appreciate any help to fix this issue.

If this method is not a good one to display headers with data please suggest another method.( Some example code guidance would really help)

Here is my ASP code.

<div id="divProjectTableHeaderFullDetail" runat="server" style="background-color: #993300;
            height: 40px; width: 770px; margin: 0;  padding: 0 ; " >
            <table style="font-family: Arial; font-size: 10pt; color: white;" cellspacing="0"

Bubble bar alignment problem



I am using bubblebar dll from devcomponent in vb.net project. i have embedded bubblebar in my project.

But i want to set ita alignment according to the position of bubble bar.

I have a 2 button in form, when i press that Top button  --->  bubble bar position be at top and the icons are enlarging in downwards position.

and when i press Bottom button---> bubble position set to bottom of screen but icons are still enlarging in downwards position, though i want them to rise upwards.

i have tested bubblebar1.alignment=Top on    TopButton         and   bubblebar1.alignment=Bottom  on BottomButton.

It doe'nt works.


Kindly i anyone have idea how to do it. 

Please let me  know.


Nikhil Malhotra 

Simple Calculation problem



I am doing a very simple calculation that is not giving me the correct calculation and I don't know why. Here is my code:


float abc;
abc = 0;

for (int a = 0; a < 1184; a++)
  abc = (a + 1) / 1184 * 100; // This is percentage of loop completed

But as this loop loops through, the value for abc is zero the entire time. I've tried using different variable types for abc (i.e. int, float, double) but it makes no difference.

When running this code:


for (int a = 0; a < 1184; a++)
  abc = (a + 1) * 100; // This is percentage of loop completed


the values appear as they should: 100, 200, 300, 400, ect


Why when dividing by 1184 the values automatically become zero?

Problem with simple query



I have a problem with a query. I want to check the field confirm_date if it contains a value or null. If it contains a value I want to do an insert statement.

The query looks like so,



case confirm_date
when is not null

Sate Machine Alignment problem



I've a State Machine Workflow that it has a very big size, I mean more than 40 states. The problem is when I open the workflow in design view on Visual Studio 2008, all the states are misaligned, like one bellow the other. But if the same workflow I open in other computer with visual studio 2008, it shown good, the states are where they have to be.

I don't know what it is, maybe same bad configuration of the VS.

Any idea? 

Julio E. Szabo

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:
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