Errors from web server...why??

Rankun

Newcomer
Joined
Jan 14, 2003
Messages
17
When I run my app on my local box it works fine. Whenever I run the app from the web, I get:"Server Error in ..." "Input string was not in a correct format."
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

This always happens whenever I click any button that requries validation. IE it should show text in the validation summary box that says something like "You must enter a number between 1 and 10", instead I get the above.

Note:Web.config <customErrors mode="Off"/>

Any have an idea of what I'm doing wrong? Thanks in Advance, Rankun

Don't think this will help but, In case anyone wants to see the
Stack Trace:

[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +195
Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value, NumberFormatInfo NumberFormat) +82

[InvalidCastException: Cast from string "" to type 'Double' is not valid.]
Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value, NumberFormatInfo NumberFormat) +170
Microsoft.VisualBasic.CompilerServices.DoubleType.FromString(String Value) +7
FitFreak.Exercise.btnAddExercise_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\FitFreak\Exercise.aspx.vb:125
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
__________________
Rankun
 
PlausiblyDamp said:
The line

looks like you are passing an empty string somewhere when it should be a string containing a number.


Yes I am passing an empty string, on purpose. It should open up the summary validation box and give the user an error. IE You must enter a number. Again it works on the local box fine same code same inputs. Thanks for the help everyone, still looking for a solution.
 
What browser(s) have you tested this with? What are the security settings for the zone in which the page is running from? Is JavaScript enabled or not on the browser for this zone / site / url?
 
PlausiblyDamp said:
What browser(s) have you tested this with? What are the security settings for the zone in which the page is running from? Is JavaScript enabled or not on the browser for this zone / site / url?

I am testing with IE 6.0 only, that is the only platform that will be used to access the program.

Javascript is enabled. I am using the same box to test the app locally and from the web.
 
It definately looks like the client script isn't executing for some reason, are you getting any errors on the page? It may be worth checking that the .Net framework is correctly installed on the server and that nobody has accidently removed the aspnet_client directory.
Also you shouldn't rely on just the client side scripts in case they are disabled on the browser anyway - on the server side you would need to check Page.IsValid before performing any operations that rely on user input.
 
PlausiblyDamp said:
It definately looks like the client script isn't executing for some reason, are you getting any errors on the page? It may be worth checking that the .Net framework is correctly installed on the server and that nobody has accidently removed the aspnet_client directory.
Also you shouldn't rely on just the client side scripts in case they are disabled on the browser anyway - on the server side you would need to check Page.IsValid before performing any operations that rely on user input.

Guess I'm confusing myself....

If I use page.isvalid is that going to make my validationsummary show the errors? Or do I need to manually create/code all my errors and get rid of the .net validators?

I was thinking about just recoding my app to use text boxes with page.isvalid, but I thought since .net already had all these validators and summary validation it would be easier.

Thanks again, Rankun
 
If you have validators on your form then they are always processed server side regardless of what the client is or does in terms of client side scripting.
Page.IsValid doesn't really do anything itself it simply reports on if the page has any validators that failed their validation and if you prevent the page redirecting on a validation error then it should display the validation summary just fine.
 
Back
Top