.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

convert Label text to integer

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
Hi, I want to convert Label text into Integer datatype.  I tried by giving Convert.Int32(Label1.Text) and int.Parse(Label1.Text)  but I couldn't do Type casting . I am getting error at runtime.    I searched in web I couldn't get the solution. Please help me....

View Complete Post

More Related Resource Links

Change label text on master page from the content page.

Hello. Can I access the objects (for example change the label text) on the master page, from its contents page code? If yes, how can I approach that? Thank you Artashes

convert xml file as text file using xml document

hi i want to convert to xml file to text file using xml document.. M not much aware of xml..so please guide me.... my boss told me don use xmltextreader and using xml document convert to txt file.....  

Convert integer to binary using asp.net

Hi I have an Integer value as 15, i want to convert as binary value. please guide me.   Thanks S.Andrews  

How to convert both text and image into image

Hi, Here is a question. how to convert both text and image together into an image. To clarify my question I can say if I have a text editor where I can add both text,image,audio or video player, how can I convert the whole texteditor.text (it gives me html code) to an image and save it in a file. I will be highly pleased with your answer. Help me please. Thank you. 

how to convert the text to mp3 speech format

im working on a applicatio that will speak out a text file for you. i have code to read a text file but can not directly convert and save in mp3 format.. need help.. :)

Need to convert query string(date - 09/15/2010) to a text format - yyyymmdd

I am fairly new to C # and need some assistance with a form page.  I have created a simple form that requires the user to select a beginning date and ending date.  I then pass the values to my code behind page via query strings.  I have them passing, but I need the format to be change to a different format.  Unfortunately the database does not use the standard date format.  It requires the date to be in a text format as YYYYMMDD.Form: <tr> <td> Beginning Date:</td> <td><asp:TextBox runat="server" ID="begDate"></asp:TextBox> <asp:Image ID="Image2" ImageUrl="~/images/calendar_schedulehs.png" runat="server" /></td> </tr> Code Behind: protected void createReport_Click(object sender, EventArgs e) { StringBuilder url = new StringBuilder("Report/TopCustomer.aspx?"); url.Append("BegDate=" + begDate.Text); url.Append("&EndDate=" + endDate.Text); url.Append("&Brnch=" + ddlLocation.SelectedValue); Response.Redirect(url.ToString()); Current URL: TopCustomer.aspx?BegDate=09/15/2010&EndDate=09/30/2010&Brnch=300I need to have the above URL change to:TopCustomer.aspx?BegDate=20100915&E

Convert from Number to Text- Exporting to Excel from SQL Reporting services 2000

I was trying to export a report which contains a number format. When I do that, all the numbers in excel will have a green small tag beside it saying "Convert from Number to Text". Is there anyway that I can change the format to a number when I export it to excel?

Convert PDF to Text?



Is there an example of coverting PDF fillable forms to text or xml thru asp.net code behind?

Below is the senario:

User fills out a fillable pdf form then submit.

I'll receive the form as an attachment thru email.

On my  web application,  a button is clicked to automatically convert pdf fillable form to text or xml then insert into database.

Any suggestion is welcome.


Convert Text to Numeric in reports generated by Microsoft SQL Server 2000

Our programming team is producing Excel reports using Microsoft SQL Server 2000 and cannot seem to find a way to produce numeric data as numeric.  It is being produced in the spread sheet as text (with the green triangle in the corner of the cell).  If the user viewing the report has an older version of Excel they cannot even convert it to numeric manually. 

Is there a way to produce numeric data as numeric in the Excel report?

Hide Label Based on Label Text?


Is it possible to display or hide a label based on the text rendered in it?
I have a label that will display the value of a control on the previous page. If the value rendered is "0" then I want to hide the label or hide the label and one more label associated with it. (or if the value is more than "0" make it visible)

Any suggestions would be great.


How to convert .html format data to normal text using Regular Expressions?

How to convert .html format data to normal text using Regular Expressions?

Modal Popup - Unable to set label text property



I have ajax accordion with 6 panes with an user control inside each of it.
 In the first pane I have a form view user control and have a modalpopup to
display error message. The same method is used in all other panes.

On page load I was able to set the label text property and it properly shows in modal popup.

However whenever I do some validation and update label text property, the modal popup
shows up but the label text property is not updated. It works in all other panes.

The only difference is the user control in the pane is inside of a update panel. If I remove the

update panel every thing works fine. But I need the update panel to avoid full post back.

How do I set the label text property inside of a modal popup.

Sections of code below:




protected void Page_Load(object sender, EventArgs e)
        lblNewMessage.Text = "Error";

 protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)
	 if (!doValidate() ) { return; }
    public bool doValidate()
        if (!psClassUtil.check_isnull_or_empty(firstName, 30, "N"))
            lblNewMessage.Text = "First Name is required (Maximum 30 characters)."; // does not 

how to refresh display label.text under for loop condition


Dear All,

I have a for loop condition as below coding for looping to change word on label.text, but as a result, it just only display the last value.

pls help me how can I do to display each value for a looping.

i want the result is the label1.text to show 1 then 2, then 3, then 4.......finally is 10.

for i as integer = 0 to 10

   label1.text = i


thx all



Split the integer value form text


 I have a @message parameter in SP, user sends an Integer value in that message.
For Ex: @message = 'This is, a Test message 500000 and the message ends.'
Now i want to get only that 500000 value from this @message param. There is no delimiters for identifying the integer value and in that param contains only one integer value

create procedure st_test (@message varchar (4000), @result int output)
//LOGIC for get the interger value

Convert array to Text


I am using MS Visual Studio 2008, Standard Edition, Visual C++, CLR Windows Forms Application.

I have an array and I would like to know how to place one of the members of the array into a textBox. It could be any one of the members. It seems like this should be an easy thing to do but I cant figure it out.

The array is;  array<DriveInfo^>^ DI = DriveInfo::GetDrives(); 

textBox1->Text = one of the array members

Does anyone know how to place a member of the array into a Windows Form textBox?


C# data bound combobox: display selected item text in separate label.content


I am new to C# but I'm resisting the urge to run screaming back to VB.NET. I'm working with a WPF application using C# code-behind and a lot of binding to a SQL 2005 database backend.

GOAL: I have a comboBox bound to a tbl_Systems entity which provides a list of systems for user selection. When the User selects a system from the comboBox I want to display the selection's text in a separate Label. The big picture is that several comboBox selections will be used to build a query string that will populate a listbox. So, I want to display these selected values in the Label so the user can see the query string they have dictated.

PROBLEM: When I set the Label content property to the comboBox SelectedItem property the entity tbl_System is displayed in the Label not the comboBox selection text.

SUSPICION: From reading similar examples in VB I suspect that the comboBox SelectedItem is actually a "datarowview" or the C# equivalent. But I don't know how to translate this explanation to C#.

The UI XAML comboBox properties are set as such:


If label text value is something, then...



I am trying to write code, on page load a label will show with a value. is the text value is a certain word. e.g. "hello", id like a series of textboxes to be invisible, but if it says 'byebye' id like other textboxes visible..

my code below is wrong with the error Cannot implicitly convert type 'string' to 'bool'

Label1.Text = Profile.Type;
            if (Label1.Text = "Hello")


TextBox1.Visible = true;

TextBox2.Visible = true;           


if (Label1.Text = "ByeBye")


TextBox1.Visible = false;

TextBox2.Visible = true;           



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