나는 다음과 같은 코드 숨김 코드를 사용하여의 GridView에 대한 온 클릭 동작을 코드하기 위해 노력하고있어 사용 후 System.FormatException 받기 SelectProcess가 CommandName으로 전달 되었기 때문에 그 코드 내에서 수행하려는 작업이 무엇이든 작동하지만 이후에는 다음 오류가 발생하면 프로그램이 작동을 멈 춥니 다.ClientScript
System.Web.HttpUnhandledException (0x80004005): Eine Ausnahme vom Typ "System.Web.HttpUnhandledException" wurde ausgelöst. ---> System.FormatException: Input string was not in a correct format.
bei System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
bei System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
bei System.Convert.ToInt32(String value, IFormatProvider provider)
bei System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
bei System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument)
bei System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
bei System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
bei System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
bei System.Web.UI.Page.HandleError(Exception e)
bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
bei System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
bei System.Web.UI.Page.ProcessRequest()
bei System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
bei System.Web.UI.Page.ProcessRequest(HttpContext context)
bei ASP.processes_aspx.ProcessRequest(HttpContext context) in c:\Users\roett04\AppData\Local\Temp\Temporary ASP.NET Files\root\4c906b5d\4377a67f\App_Web_qcvmvpfq.0.cs:Zeile 0.
bei System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
SelectButton을 추가하고 render-method를 재정의하고 onclick-handler를 추가하기 위해 rowdatabound를 사용하는 대신 OnSelectedIndexChanging을 사용하면 동일한 코드가 제대로 작동합니다.
당신은'if' 라인에서 예외가 발생한다고 말합니다. –
아니요, 코드가 완벽하게 실행되었지만, 프레디 릭이 방금 내가 찾던 답을 게시했습니다! –