Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8480551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:19:29+00:00 2026-06-10T19:19:29+00:00

What I tried: MarkUP: <asp:TextBox ID=TextBox2 runat=server></asp:TextBox> <asp:Label ID=Label1 runat=server AssociatedControlID=TextBox2 Text=Label></asp:Label> <asp:SliderExtender ID=SliderExtender1

  • 0

What I tried:

MarkUP:

 <asp:TextBox ID="TextBox2"   runat="server"></asp:TextBox>

    <asp:Label ID="Label1" runat="server" AssociatedControlID="TextBox2"  Text="Label"></asp:Label>

    <asp:SliderExtender ID="SliderExtender1"  TargetControlID="TextBox2"  BoundControlID="Label1" Maximum="200" Minimum="100" runat="server">
    </asp:SliderExtender>

Code Behind:

protected void setImageWidth()
{
    int imageWidth;
    if (Label1.Text != null)
    {
        imageWidth = 1 * Convert.ToInt32(Label1.Text);
        Image1.Width = imageWidth;
    }
}

After running the page on a browser, I get the System.FormatException: Input string was not in a correct format.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:19:31+00:00Added an answer on June 10, 2026 at 7:19 pm

    The problem is with line

    imageWidth = 1 * Convert.ToInt32(Label1.Text);
    

    Label1.Text may or may not be int. Check.

    Use Int32.TryParse(value, out number) instead. That will solve your problem.

    int imageWidth;
    if(Int32.TryParse(Label1.Text, out imageWidth))
    {
        Image1.Width= imageWidth;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following markup: <Asp:updatepanel id=up runat=server> <contenttemplate> <asp:Button id=btn runat=server text=test />
I have this markup: <asp:DetailsView ID=dvDatabase OnModeChanging=dvDatabase_ModeChanging> <HeaderTemplate> <asp:Button ID=btnView runat=server CausesValidation=False CommandName=Cancel Text=View
I have asp:panel with some controls, the mark-up as below <asp:panel id=panel1 runat=server> <asp:Label
I have the following ASP-Markup: <asp:Button runat=server ID=btnSubmit meta:resourcekey=btnSubmit CssClass=submit OnClick=btnSubmit_Click /> And the
I have some markup like this: <form id=ddlSelections runat=server> <asp:ScriptManager ID=ScriptManager1 runat=server EnablePartialRendering=true />
I have the following ASP.NET markup: <asp:regularexpressionvalidator id=RegularExpressionValidator7 runat=server ControlToValidate=Email1 ErrorMessage=Email not valid ValidationExpression=\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*>
I'm trying to bind a bool from the server to the markup: <asp:BoundField DataField=RevSharePercent
I'm not all that familiar with markup. I tried to use it to test
I have a situation. I have a label in ASP.NET 2.0(C#). The label should
I am working on an ASP.NET webforms page that has the following asp markup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.