首页 新闻 赞助 找找看

asp.net:来自Global的错误处理 输入字符串的格式不正确。

0
悬赏园豆:20 [已解决问题] 解决于 2015-04-21 13:43

前台aspx文件

<%@ Page Title="" Language="C#" MasterPageFile="~/masterpage/TeacherMaster.master" AutoEventWireup="true" CodeFile="TaskList.aspx.cs" Inherits="Teacher_TaskList" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript" src="../bootstrap/jsckeditor.js"></script>
    <form id="form1" runat="server">
        <div class="span3" style="width:25%;float:left;">
                <ul class="nav nav-tabs" style="margin-bottom:0px;">
                    
                    <li class="active">
                        <a href="#panel-now" data-toggle="tab">当前任务</a>
                    </li>
                    <li>
                        <a href="#panel-all" data-toggle="tab">全部任务</a>
                    </li>
                </ul>
            
                <div class="tab-content">
                    <div class="tab-pane active" id="panel-now">                           
                        <asp:GridView ID="Current_Task" DataKeyNames="textid" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" HorizontalAlign="Center" Width="407%" CellSpacing="1" AutoGenerateColumns="False"  AllowPaging="True">                                            
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" />
                        <EditRowStyle BackColor="#2461BF" Font-Italic="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="Silver" Font-Bold="True" ForeColor="White" Font-Size="12px" HorizontalAlign="Center" />
                        <AlternatingRowStyle BackColor="White" />
                            <Columns>               
                            <asp:BoundField DataField="text_name" HeaderText="作业名"/>     
                            <asp:BoundField  HeaderText="类型"/>  
                            <asp:BoundField DataField="beanclass.classname" HeaderText="班级"/>   
                            <asp:BoundField  HeaderText="完成度(已完成/应完成)"/>   
                            <asp:BoundField  HeaderText="平均分/总分"/>
                            <asp:BoundField  HeaderText="平均用时"/>          
                        </Columns>                          
                     </asp:GridView>                                                                 
                    </div>
                    <div class="tab-pane" id="panel-all">                                                    
                        <asp:GridView ID="All_Task" DataKeyNames="textid" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" HorizontalAlign="Center" Width="98%" CellSpacing="1" AutoGenerateColumns="False"  AllowPaging="True">                                          
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" />
                        <EditRowStyle BackColor="#2461BF" Font-Italic="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="Silver" Font-Bold="True" ForeColor="White" Font-Size="12px" HorizontalAlign="Center" />
                        <AlternatingRowStyle BackColor="White" />
                            <Columns>               
                            <asp:BoundField DataField="text_name" HeaderText="作业名"/>     
                            <asp:BoundField  HeaderText="类型"/>  
                            <asp:BoundField DataField="beanclass.classname" HeaderText="班级"/>   
                            <asp:BoundField  HeaderText="完成度(已完成/应完成)"/>   
                            <asp:BoundField  HeaderText="平均分/总分"/>
                            <asp:BoundField  HeaderText="平均用时"/>               
                        </Columns>                                 
                     </asp:GridView>                                                              
                    </div>
        </div>
            </div>
          </form>
</asp:Content>
后台cs文件:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DateType = Model.BeanTaskText;
using Model;
using Common;
using BLL;

public partial class Teacher_TaskList : System.Web.UI.Page
{
    BllTaskText<DateType> bllitem;
    DateType beanitem;
    protected void Page_Load(object sender, EventArgs e)
    {
        bllitem = new BllTaskText<DateType>();
        beanitem = new DateType();
        BinData();
    }
    protected void BinData()
    {
        Current_Task.DataSource = bllitem.Get_ListByDate();
        Current_Task.DataBind();
        All_Task.DataSource = bllitem.Get_AllList();
        All_Task.DataBind();
    }
}

数据库两个操作Get_ListByDate(),Get_AllList()在别的aspx调用过是没有问题可以正常取出数据并显示。但是运行这个页面还是会出错,输入字符串的格式不正确。求大神解答!!!Thanks you very much!

码码码农的主页 码码码农 | 初学一级 | 园豆:90
提问于:2015-04-20 21:05
< >
分享
最佳答案
0

哪里报错看哪里,报错的时候会有具体的行号的。

收获园豆:20
幻天芒 | 高人七级 |园豆:37175 | 2015-04-21 09:14

没有出错行号,只有那一句话 global错误 输入字符串不正确。感觉是前台文件有问题,但又找不出来。

码码码农 | 园豆:90 (初学一级) | 2015-04-21 12:59

@码码码农: 那你检查下你的global.cs文件和global.cs.asmx文件。应该是这两个格式。就是global的页面文件。

幻天芒 | 园豆:37175 (高人七级) | 2015-04-21 13:01

@幻天芒: 谢谢,但我的工程里没有global这个页面,这是系统自带的吗?

码码码农 | 园豆:90 (初学一级) | 2015-04-21 13:15

@码码码农: 有个Global.cs,这个类带有一个页面。

幻天芒 | 园豆:37175 (高人七级) | 2015-04-21 13:22
其他回答(1)
0

看到你这黑压压的一片都没心情了,但是, 我估计是这个位置有问题。<asp:BoundField DataField="beanclass.classname" HeaderText="班级"/>   
                            <asp:BoundField  HeaderText="完成度(已完成/应完成)"/>   
                            <asp:BoundField  HeaderText="平均分/总分"/> 
                            <asp:BoundField  HeaderText="平均用时"/>        

| 园豆:780 (小虾三级) | 2015-04-20 22:35

这是gridview的几个列,只有班级名绑定了其它暂时还没有绑定,是没有问题的。

支持(0) 反对(0) 码码码农 | 园豆:90 (初学一级) | 2015-04-21 13:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册