Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,446 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,174 people online right now. Registration is fast and FREE... Join Now!




Input string was not in a correct format error

 
Reply to this topicStart new topic

Input string was not in a correct format error

chacal
1 Aug, 2008 - 07:55 AM
Post #1

New D.I.C Head
*

Joined: 29 Jul, 2008
Posts: 3

Hi!

In my website, I have a button that is suppose to show or hide a panel depending if it is hidden or not. When I click on the button, I get this error:

Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

I searched the web a little bit, and it seems this error has to do with type casts, but this has nothing to do with my function. Here's my code:

Code for the button in the aspx page:
CODE

<asp:Button ID="btnNouvSite" runat="server" onclick="btnNouvSite_Click" Text="Nouveau site / Add site" />


Code in the code behind file (I'm using C#):
CODE

    protected void btnNouvSite_Click(object sender, EventArgs e){
        panNouvSite.Visible = !panNouvSite.Visible;
    }


Anybody has an idea what my problem is? Thanks in advance!
User is offlineProfile CardPM
+Quote Post

chacal
RE: Input String Was Not In A Correct Format Error
1 Aug, 2008 - 09:03 AM
Post #2

New D.I.C Head
*

Joined: 29 Jul, 2008
Posts: 3

I figured it out by myself: there was an error somewhere in the code of the panel.

Thanks anyway.
User is offlineProfile CardPM
+Quote Post

arunkumar.16583
RE: Input String Was Not In A Correct Format Error
7 Aug, 2008 - 10:31 PM
Post #3

New D.I.C Head
*

Joined: 7 Aug, 2008
Posts: 4


My Contributions
there is error in c# code , you can not check such like
as ur checking in c#

QUOTE(chacal @ 1 Aug, 2008 - 08:55 AM) *

Hi!

In my website, I have a button that is suppose to show or hide a panel depending if it is hidden or not. When I click on the button, I get this error:

Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Input string was not in a correct format.

I searched the web a little bit, and it seems this error has to do with type casts, but this has nothing to do with my function. Here's my code:

Code for the button in the aspx page:
CODE

<asp:Button ID="btnNouvSite" runat="server" onclick="btnNouvSite_Click" Text="Nouveau site / Add site" />


Code in the code behind file (I'm using C#):
CODE

    protected void btnNouvSite_Click(object sender, EventArgs e){
        panNouvSite.Visible = !panNouvSite.Visible;
    }


Anybody has an idea what my problem is? Thanks in advance!


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 02:46PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month