I'm gettign the following error when selecting the cancel button
Server Error in '/ClubWebSite1' Application.
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.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) +216
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +93
[InvalidCastException: Conversion from string "" to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +251
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(Object Value) +1030
ASP.events_view_aspx.get_EventID() +98
ASP.events_view_aspx.Page_Load(Object sender, EventArgs e) +58
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3750
script runat="server">
Private EventID, prevEventID, nextEventID
As Integer
Const INVALIDID
As Integer = -1
Protected Sub Page_Load(ByVal sender
As Object,
ByVal e As System.EventArgs)
If Not IsPostBack
Then
'Initialize the fields
Dim action As
Object = Request.QueryString("Action")
If Not action
Is Nothing
Then
Select
Case LCase(CStr(action))
case "new"
'We are in new mode
FormView1.ChangeMode(FormViewMode.Insert)
Dim lp As LocationsPicker =
CType(FormView1.FindControl("LocationPicker1"), LocationsPicker)
lp.LocationID =
Nothing
Dim dp
As DurationPicker =
CType(FormView1.FindControl("dtpicker"), DurationPicker)
dp.startDateTime = Now
dp.endDateTime = Now.AddHours(3)
Dim slp As TextBox =
CType(FormView1.FindControl("staticURLTextBox"), TextBox)
slp.Enabled =
False
Case "delete"
SqlDataSource1.Delete()
Response.Redirect("Events_list.aspx")
Case Else
'We are in edit mode
Dim cb
As CheckBox =
CType(FormView1.FindControl("CheckBox1"), CheckBox)
Dim surl As TextBox =
CType(FormView1.FindControl("staticURLTextBox"), TextBox)
If Not surl.Text
Is Nothing
AndAlso surl.Text <>
"" Then
cb.Checked =
True
surl.Enabled =
True
Else
surl.Enabled =
False
End If
End Select
End If
End If
End Sub
Protected
Sub FormView1_ItemUpdated(ByVal sender
As Object,
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs)
Response.Redirect(
"events_view.aspx?eventID=" & e.Keys("id").ToString)
End Sub
Protected Sub FormView1_ItemInserted(ByVal sender
As Object,
ByVal e As System.Web.UI.WebControls.FormViewInsertedEventArgs)
Response.Redirect(
"events_list.aspx")
End Sub
Protected
Sub CheckBox1_CheckedChanged(ByVal sender
As Object,
ByVal e As System.EventArgs)
Dim cb As CheckBox =
CType(FormView1.FindControl("CheckBox1"), CheckBox)
Dim surl As TextBox =
CType(FormView1.FindControl("StaticURLTextBox"), TextBox)
If cb.Checked
Then
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.
Source Error:
Line 62: if (id != null)
Line 63: {
Line 64: m_EventID = System.Convert.ToInt32(id);
Line 65: }
Line 66: else
Source File: c:\Documents and Settings\User\Desktop\iss\Events_View.aspx Line:
64
Stack Trace:
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2755599
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112
System.String.System.IConvertible.ToInt32(IFormatProvider provider) +43
System.Convert.ToInt32(Object value) +25
ASP.events_view_aspx.get_EventID() in c:\Documents and Settings\User\Desktop\iss\Events_View.aspx:64
ASP.events_view_aspx.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\User\Desktop\iss\Events_View.aspx:14
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3750
This error shows after cancelling add new events in C#
None
0 Points
5 Posts
error when selecting Cancel on Even_Edit.aspx
May 04, 2008 08:41 PM|rrrodz|LINK
I'm gettign the following error when selecting the cancel button
Server Error in '/ClubWebSite1' Application.
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.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
Member
460 Points
100 Posts
Re: error when selecting Cancel on Even_Edit.aspx
May 05, 2008 03:08 AM|jignesh_login|LINK
pls post your code,so it's focus more on error.
thanks
Arise, awake; and stop not till the goal is reached
None
0 Points
5 Posts
Re: error when selecting Cancel on Even_Edit.aspx
May 05, 2008 10:39 AM|rrrodz|LINK
<%
@ Import Namespace="System.Data" %> <%@ Register TagPrefix="Club" Namespace="ClubSite" %><%
@ Register TagPrefix="Club" TagName="LoginBanner" Src="LoginBanner.ascx" %> <%@ Register TagPrefix="Club" TagName="ImageThumbnail" Src="ImageThumbnail.ascx" %><%
@ Register TagPrefix="Club" TagName="Photopicker" Src="photos_formpicker.ascx" %> <%@ Register TagPrefix="Club" TagName="Durationpicker" Src="Durationpicker.ascx" %><%
@ Register TagPrefix="Club" TagName="Locationpicker" Src="Locations_picker.ascx" %><
script runat="server"> Private EventID, prevEventID, nextEventID As Integer Const INVALIDID As Integer = -1FormView1.ChangeMode(FormViewMode.Insert)
Dim lp As LocationsPicker = CType(FormView1.FindControl("LocationPicker1"), LocationsPicker)lp.LocationID =
Nothing Dim dp As DurationPicker = CType(FormView1.FindControl("dtpicker"), DurationPicker)dp.startDateTime = Now
dp.endDateTime = Now.AddHours(3)
Dim slp As TextBox = CType(FormView1.FindControl("staticURLTextBox"), TextBox)slp.Enabled =
FalseSqlDataSource1.Delete()
Response.Redirect("Events_list.aspx")cb.Checked =
Truesurl.Enabled =
True Elsesurl.Enabled =
False End If End Select End If End If End Sub Protected Sub FormView1_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs)Response.Redirect(
"events_view.aspx?eventID=" & e.Keys("id").ToString) End SubResponse.Redirect(
"events_list.aspx") End Sub Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim cb As CheckBox = CType(FormView1.FindControl("CheckBox1"), CheckBox) Dim surl As TextBox = CType(FormView1.FindControl("StaticURLTextBox"), TextBox) If cb.Checked Thensurl.Enabled =
True Elsesurl.Enabled =
False End If End Sub<
asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div id="body"> <Club:LoginBanner ID="LoginBanner1" runat="server" /> <div class="actionbuttons"> <Club:RolloverLink ID="Logoutbtn" runat="server" Text="Add New Event" OnClientClick="foo" NavigateURL="Event_edit.aspx?Action=New" /> </div> <div class="fullwidth"> <h3>Event Details
</h3> <div class="dashedline"> </div> <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="id" DefaultMode="Edit" OnItemInserted="FormView1_ItemInserted" OnItemUpdated="FormView1_ItemUpdated" Width="100%"> <InsertItemTemplate> <div class="actionbuttons"> <Club:RolloverButton ID="GreenRolloverButton2" CommandName="Insert" Text="Add Event" runat="server" /> <Club:RolloverLink ID="GreenRolloverLink1" Text="Cancel" runat="server" NavigateURL='<%# "Events_view.aspx?EventID=" & Cstr(Eval("ID")) %>' />Event Heading:
</td> <td align="left"> <asp:TextBox ID="titleTextBox" runat="server" Width="500px" Text='<%# Bind("title") %>'></asp:TextBox> </td> </tr> <tr> <td class="formlabel">Link:
</td> <td align="left"> <asp:CheckBox ID="CheckBox1" runat="server" Text="Use a link instead of inline content for this anouncement:" /><br />Link:
<asp:TextBox Text='<%# Bind("staticURL") %>' runat="server" ID="staticURLTextBox" Width="450px" /> </td> </tr> <tr> <td class="formlabel">Location:
</td> <td align="left"> <Club:Locationpicker ID="LocationPicker1" runat="server" LocationID='<%# Bind("location")%>' /> </td> </tr> <tr> <td class="formlabel"> <asp:Label ID="Label1" runat="server" Text="Description:" /> </td> <td align="left"> <asp:TextBox Text='<%# Bind("description") %>' runat="server" ID="descriptionTextBox" Rows="10" TextMode="MultiLine" Width="500px" Height="166px"></asp:TextBox> </td> </tr> <tr> <td class="formlabel">Event Date:
</td> <td align="left"> <Club:Durationpicker ID="dtpicker" runat="server" startDateTime='<%#Bind("Starttime") %>' enddatetime='<%#Bind("endtime") %>' /> </td> </tr> <tr> <td class="formlabel">Photo:
</td> <td align="left"> <Club:Photopicker ID="Photopicker1" runat="server" ImageId='<%# Bind("photo") %>' /> </td> </tr> </table> <div class="dashedline"> </div> <div class="actionbuttons"> <Club:RolloverButton ID="apply1" CommandName="Insert" Text="Add Event" runat="server" /> <Club:RolloverLink ID="Cancel" Text="Cancel" runat="server" NavigateURL='<%# "Events_view.aspx?EventID=" & Cstr(Eval("ID")) %>' /> </div> </InsertItemTemplate> <EditItemTemplate> <div class="actionbuttons"> <Club:RolloverButton ID="GreenRolloverButton1" CommandName="Update" Text="Apply Changes" runat="server" /> <Club:RolloverLink ID="GreenRolloverLink1" Text="Cancel" runat="server" NavigateURL='<%# "Events_view.aspx?EventID=" & Cstr(Eval("ID")) %>' /> </div> <div class="dashedline"> </div> <table> <tr> <td class="formlabel">Event Heading:
</td> <td align="left">Link:
</td> <td align="left"> <asp:CheckBox ID="CheckBox1" runat="server" Text="Use a link instead of inline content for this anouncement:" /><br />Link:
<asp:TextBox Text='<%# Bind("staticURL") %>' runat="server" ID="staticURLTextBox" Width="450px" /> </td> </tr> <tr> <td class="formlabel">Location:
</td> <td align="left">Event Date:
</td> <td align="left"> <Club:Durationpicker ID="dtpicker" runat="server" startDateTime='<%#Bind("Starttime") %>' endDateTime='<%#Bind("endtime") %>'/>Photo:
</td> <td align="left"></
asp:Content>Member
1 Points
9 Posts
Re: error when selecting Cancel on Even_Edit.aspx
Jul 09, 2008 08:47 PM|miesan|LINK
hello,
have you read this post?
http://forums.asp.net/t/970081.aspx?PageIndex=3
i got same problem but i'm using C#, could anyone help me?
thanks.
Member
1 Points
9 Posts
Re: error when selecting Cancel on Even_Edit.aspx
Jul 09, 2008 09:00 PM|miesan|LINK
Server Error in '/iss' Application.
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.
Source Error:
Source File: c:\Documents and Settings\User\Desktop\iss\Events_View.aspx Line: 64
Stack Trace:
This error shows after cancelling add new events in C#