Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi iam getting an errors in sample project
C#
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();
        }
        }

        }
Posted

1 solution

Syntax_error[^]
try this
C#
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();
           }
       }
 
Share this answer
 
Comments
harshavardhan12345678 29-Jan-14 4:55am    
Error 1 The type or namespace name 'Arraylist' could not be found (are you missing a using directive or an assembly reference?) c:\visual studio 2010\Projects\pageispostback12\pageispostback12\Default.aspx.cs pageispostback12
Karthik_Mahalingam 29-Jan-14 4:55am    
check my solution..
harshavardhan12345678 29-Jan-14 4:58am    
3 errors in arraylist line
harshavardhan12345678 29-Jan-14 5:00am    
Error 1 The type or namespace name 'Arraylist' could not be found (are you missing a using directive or an assembly reference?) c:visual studio 2010\Projects\pageispostback12\pageispostback12\Default.aspx.cs 16 17 pageispostback12
Karthik_Mahalingam 29-Jan-14 5:03am    
its not Arraylist .......its ArrayList

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900