wylyhwdf 2015-06-18 03:25 采纳率: 0%
浏览 2196
已结题

学生小白求解答! GridView在VS上可见,但网页调制无法显示

以下是一个页面的代码:

namespace WebApplication1
{
public partial class dingdan : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string strcnn = ConfigurationManager.ConnectionStrings["s"].ConnectionString;
        SqlConnection cnn = new SqlConnection(strcnn);
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = cnn;
        cmd.CommandText = "delete from [order] where uid='" + DropDownList1.SelectedValue.Trim() + "' and pid in (select id from sp where name='" + GridView1.SelectedRow.Cells[1].Text.Trim() + "')";

        try
        {
            cnn.Open();
            cmd.ExecuteNonQuery();
            Response.AddHeader("Refresh", "0");
        }
        catch (Exception ex)
        {

        }
        finally
        {
            if (cnn.State == ConnectionState.Open)
                cnn.Close();
        }
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/login.aspx");
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/editsp.aspx");
    }

    protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {

    }

    protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {

    }
}

}
图片说明

VS上的界面可以显示,但是调式出来在网页上看不见,求助!
最好是能够写出代码,告诉我怎么做,谢谢!!

  • 写回答

4条回答

  • 夢里花落 2015-06-18 03:34
    关注

    pageload是用来初始化的,里面啥都没有,肯定显示不出来

    评论

报告相同问题?

悬赏问题

  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥199 rust编程架构设计的方案 有偿