如何在页面中获取错误是回发 [英] how do iam getting an error in page is postback

查看:78
本文介绍了如何在页面中获取错误是回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在示例项目中收到错误

hi iam getting an errors in sample project

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace pageispostback12
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (page.ispostback==false)
            {
                arraylist al = new arraylist();
                al.add("mpc");
                al.add("bipc");
                al.add("cec");
                al.add("hec");
                al.trimtosize();
                al.sort();
                RadioButtonList1.DataSource=al;
                RadioButtonList1.DataBind();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text="Name:"+TextBox1.Text+"<br/>group:"+RadioButtonList1.SelectedItem.ToString();
        }
        }

        }

推荐答案

Syntax_error [ ^ ]

试试这个

Syntax_error[^]
try this
protected void Page_Load(object sender, EventArgs e)
       {
           if (Page.IsPostBack == false)
           {
               ArrayList al = new ArrayList();
               al.Add("mpc");
               al.Add("bipc");
               al.Add("cec");
               al.Add("hec");
               al.TrimToSize();
               al.Sort();
               RadioButtonList1.DataSource = al;
               RadioButtonList1.DataBind();
           }
       }


这篇关于如何在页面中获取错误是回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆