.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

Suffereing with text formatting, whats wrong?

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
I am outputting a histogram and can't get the labeling of the cells formatted correctly. I want the numbers printed at the bottom of each cell to be centered, but as you can see they are left justified. At the same time the very left number I oversized to see what would happen. This widens the size of the graphic bin which I don't want, I would rather crop the number. What am I missing here, what attributes are missing? I have been playing with this since yesterday and it is driving me nutts. <hbox height="200" width="100" style="border: 2px inset -moz-dialog; margin: 4px;"> <box id="0" flex="1" align="end" width="5%" style="background: -moz-linear-gradient(left, red,red 10%);">2900</box> <box id="1" flex="1" align="end" width="5%" style="background: -moz-linear-gradient(left, red,red 11%);">3</box> <box id="2" flex="1" align="end" width="5%" style="background: -moz-linear-gradient(left, yellow,yellow 12%);">1</box> <box id="3" flex="1" align="end" width="5%" style="background: -moz-linear-gradient(left, yellow,yellow 13%);">1</box> Etc </hbox>

View Complete Post

More Related Resource Links

Whats wrong with this statement


Im trying to updated some old ASP pages with some new .net pages and cant seem to get this update statement to work. I need to update the current ASP code below and then once thats working im going to use that same statement in a procedure for all our new .Net pages..

So can anyone see what im doing wrong by inserting the 2nd column to the update statement?

strSqual = "update tas set date_completed='" & TransDate & ", trans_id=" & InsertedTransID & "' where date_completed is null and sercontract_id="& strContractID & " and DATEDIFF(dd,task_due_date,'" & strProcDate & "')<=14"


I am trying to add an extra column to the update, but not sure if the syntax is correct.

Whats wrong with this code, im getting blue line under the createStatus next the switch

Error message: Use of unassigned local variable 'createStatus'
            MembershipCreateStatus createStatus;
            MembershipUser newUser = Membership.CreateUser(Username.Text, Password.Text, Email.Text);

            switch (createStatus)
                case MembershipCreateStatus.Success:
                    this.CreateAccountResults.Text = "The user account was successfully created!";
                case MembershipCreateStatus.DuplicateUserName:
                    this.CreateAccountResults.Text = "There already exists a user with this username.";
                case MembershipCreateStatus.DuplicateEmail:
                    this.CreateAccountResults.Text = "There already exists a user with this email address.";
                case MembershipCreateStatus.InvalidEmail:
                    this.CreateAccountResults.Text = "There email address you provided in invalid.";
                case MembershipCreateStatus.InvalidPassword:
                    this.CreateAccountResults.Text = "The password you provided is invalid. It must be seven characters long and have at least one non-a

Formatting Multiple Lined Text Box

I have an expression as  Field!name1.value+VBCRLF+Field!name2.value My requirement is i need to have the first line as bold and rest in normal text in SSRS 2005  

Data from text files, What's wrong with my code?

Hi all, I have uploaded some tab-delimited .txt files on my web site (actually run on my computer, ie localhost, for now), and now I try to retrieve the data from those files. I do this by calling a vb file containg the sub below. Everything works great, except that the sub won't recognise unicode characters. I can split the resulting string using vbnewline and vbtab, but already in the sub in question, the string doesn't understand the Swedish letters åäö, apostrophes and more. Any help would be greatly appreciated! /Pettrer       Shared Function getTextfile(ByVal FullPath As String, Optional ByRef ErrInfo As String = "") As String Dim strContents As String = "" Dim objReader As StreamReader Try objReader =New StreamReader(FullPath) 'UTF8Encoding? strContents = objReader.ReadToEnd() objReader.Close() ErrInfo = Ex.MessageCatch Ex As Exception End Try Return strContents End Function  

Whats wrong with my ExecuteScalar() Code ? - C#.net - Plz Help !

Hi,I downloaded OracleHelper & i'm using it....Now i want to insert a row into a table named 'Sample'.I have 2 textboxes and when i click on the button i need to insert the values from 2 textboxes into the table & here is my code....OracleHelper.ExecuteNonQuery(connectionString, CommandType.Text,"insert into sample (id,name) values(?id,?name);", new OracleParameter("@id", OracleDbType.Int32, Int32.Parse(TextBox1.Text)), new OracleParameter("@name",OracleDbType.Varchar2,20,(TextBox2.Text).ToString()));The error i get is,ORA-00911: invalid character and it shows the error is innew OracleParameter("@name",OracleDbType.Varchar2,20,(TextBox2.Text).ToString())Please guide me !

Whats wrong with my style?

Im getting a compile error "Error 6 '12' is not a valid value for the 'System.Windows.Documents.TextElement.FontSize'" when I apply my style to a label.  It "looks right", I could use someone elses opinion what is wrong: <Window x:Class="MoneyClient.RevisedScreen" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:net="clr-namespace:System;assembly=mscorlib" Title="Revised Screen" Height="480" Width="600"> <Window.Resources> <net:Int32 x:Key="titleFontSize">12</net:Int32> <Style x:Key="headerStyle" TargetType="Label"> <Setter Property="FontSize" Value="{StaticResource titleFontSize}" /> <Setter Property="FontWeight" Value="Bold" /> </Style> </Window.Resources> <Label Content="Setup" FontSize="12" FontWeight="Bold" Style="{StaticResource headerStyle}"/> </Window> Thnx Mat

Whats wrong with this condition

I have this condition in my page_load event and it seems to be ignored, i do have it OUTSIDE of my !IsPostback condition. I need to check those sessions EVERYTIME you get to the page, regardless if its the first time on the page or if you have been on the page / site for a while.. those sessions are being set on a different page and this particular page needs those variables in order to work.. so if they dont exist they need to be sent back to the first page so they can be set.   if (Session["ss_t_id"] == null || Session["ss_t_type"] == null) { Response.Redirect("/", false); } ============================================== if (!IsPostBack) { ddlReport.SelectedIndex = 1; if (ddlReport.SelectedValue == "0") { lvReport.Visible = false; filterddl.Visible = false; prtPage.Visible = false; prtAll.Visible = false; } else { DropDownLists are being set in this portion } }  

Displaying Rich text with formatting in RDLC file

Hi, I want to display my rich text with formatting in RDLC file. Can anyone please help me with the way out for that? Thanks & Regards, Subalakshmi Vijayarajan.

Can anybody tell me whats wrong in this query?


Hi, this is the query for SsisConfiguration. i have done few changes in the main package so i have to change the data files path. Can anybody tell me if this is correct? i have 5 child packages so do i have to do the same thing for all packages?

USE SsisLogs



IF  EXISTS (SELECT * FROM [SsisLogs].[audit].[SSISConfig]
UPDATE SsisLogs.Audit.SsisConfig
SET ConfiguredValue = '\\uafc.com\ua\MH\DIRFILEDEV\CHG67570\Data'
WHERE ConfigurationFilter = 'FileLocation_RxCuiToNdc_Load'
IF NOT EXISTS (SELECT * FROM [SsisLogs].[audit].[SSISConfig]

Formatting text within a tag


I am using a radio button list. And I have a list item with the following text (see code at the bottom)........Have you or a family member ever been disgnosed or treated for any type of Asthma. I would like the one word Asthma to be italiziced and underlined. when I tried to use html tags within the listitem tag it sai the element is not allowed with the listitem tag. Is this possible?

<asp:RadioButtonList ID="RadioButtonList2" runat="server" RepeatColumns="2"
            <asp:ListItem>Have you or a family member ever been disgnosed or treated for any type of Asthma) Yes</asp:ListItem>

Whats wrong with this SelectNodes string?


I can't fingure out what I'm doing wrong here.

This is a minimized version of how the XML looks like: 

<?xml version="1.0"?>
    <title> </title>
    <description> </description>
        <rdf:li rdf:resource="http://magicplus.karolinska.se/pc/driftrapportlista.asp" />
        <rdf:li rdf:resource="http://magicplus.karolinska.se/pc/driftrapportlista.asp" />
        <rdf:li rdf:resource="http://magicplus.karolinska.se/pc/driftrapportlista.asp" />
        <rdf:li rdf:resource="http://magicplus.karolinska.se/pc/driftrapportlista.asp" />
        <rdf:li rdf:resource="http://magicplus.karolinska.se/pc/driftrapportlista.asp" />
        <rdf:li rdf:resource="http://magicplus.karolinska.se/pc/driftrapportlista.asp" />
  <item rdf:about="http://magicplus.karolinska.se/pc/driftrapportlista.asp">

formatting datapager text


I have a listview control qith a datapager.  I'm using a linkbutton for next and previous.  I have a css class that makes the text Arial, and bold.  It also sets the size to 10px.  When I run the page, the link button is Arial and bold, but I can't change the size of the text.  I've tried setting it to 10px, 8px, even 5px, 10pt,  and xx-small.  Nothing changes the font size. 

My customer wants the next and previous buttons to look a certain way.  I'll have to manage paging manually if I can't get this figured out. 

Formatting search results -- is there any good way to flip colors on text being searched for?


I have a mobile website that allows you to search on three different criteria and dsiplay the results in a gridview.  I thought it would be easy to modify it so that when the results are displayed, the field that was searched would display the sought text string with the colors reversed, as is the style for so many search engines.  So I began modifying the rowdatabound() event, searching the relevant field for the search string, sandwiching the search string inside a <FONT> block with the reverse colors wherever it was found, and assigning the result back to the control that the field was bound to.

I don't seem to be having much luck.  No matter what kind of control I use -- which includes textbox, label, and literal, all I can ever get is a BLANK where the reversed-colors text is supposed to be.  If I use the <FONT> block with the normal colors, I can still see the text, but if I try to reverse them (or use different colors), all I can get is the blank space.

So to state the problem succinctly:  Using the rowdatabound() event, you want to display a block of text inside of a conrol inside of a gridview with one word displayed in the reverse of the normal foreground and background colors.  What kind of control would you use?  (Note: The field

Does SSRS 2008 Support Rich Text Formatting?

Couldn't find any recent responses to this. Does anyone know if the 2008 version supports rich text formatting? Thanks

Whats wrong with this syntax


I had issues with updating database with .xls  and .csv files, but got it working.. I need more control over the csv upload, so i was trying a few things i found online for connecting to the file similar to the excel file that works great.


I have the follow connections to an xls and csv and the csv logic throws an exception that it cant find the file, even though it was uploaded successfully prior to the reader.

Here is the logic for an excel file and then for the csv, both are identical except for the Extended Properties on the connectionstring, so not sure why its giving that error, the file is uploaded to the folder fine and exists prior to the reader.

{"'C:\\\\inetpub\\wwwroot\\SyNet\\TestSecurity\\Sion\\Sion\\Data\\testAPconfig.csv' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides."}


Connection String for .CSV

                            OleDbConnection csvConnection = new OleDbConnection();
                            csvConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                            "Data Source=" + fullName + ";Extended Properties=\"text;HDR=Yes;FMT=Delimited;\"";


sql server 2005 on windows 7 .. Whats wrong?


Hi ..

I downloaded Sql server 2005 on Windows 7 And downloaded Sp3  but it is just giving me the Configration tools without the Database Server ..

what the problem please??!!

if any one can help I will be so greatfull ..


whats wrong with this? decimal or whole number?!


here is my code, i am getting the data types wrong i think.

label 51 is a whole number from database, label52 could be a decimal number after the division is applied to label 51.

label 53 will be a decimal

label 54 will be a decimal, but id like to show it to the nearest whole number...

how can i get this to work? thanks!

FormView Formview1 = (FormView)sender;
        Label Label51 = Formview1.FindControl("Label51") as Label;
        Label Label52 = Formview1.FindControl("Label52") as Label;
        Label Label53 = Formview1.FindControl("Label53") as Label;
        Label Label54 = Formview1.FindControl("Label54") as Label;


        Label52.Text = (int.Parse(Label51.Text) / Convert.ToInt32("144")).ToString();
       Label53.Text = (double.Parse(Label52.Text) * Convert.ToInt32("100")).ToString();
        Label54.Text = (Convert.ToInt32("100") - int.Parse(Label53.Text)).ToString();

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