I have a web page that when I click on a control the property window is empty. Not only that but when I double click a control or page in design view the event is not created in the code behind, in fact nothing happens. Seems like the page is not attached to the code-behind, however in the solution explorer the pages are attached.
Actually the page even works (mostly). I realized this issue when trying to read the selected items from a list box (which I load from a DataSet). No items are ever selected.
The code for that is below.
Is there something the page must reference that maybe I deleted by accident? Any help would be appreciated.
The HTML:
The codebehind:
Thanks for your help!
Actually the page even works (mostly). I realized this issue when trying to read the selected items from a list box (which I load from a DataSet). No items are ever selected.
The code for that is below.
Is there something the page must reference that maybe I deleted by accident? Any help would be appreciated.
The HTML:
Code:
<%@ Page language="c#" Codebehind="Administrator.aspx.cs" AutoEventWireup="false" Inherits="Internal.administrator" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>administrator</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5"[/URL] name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
[COLOR=gray]... omitted html ...[/color]
[COLOR=blue]
<asp:listbox SelectionMode="Multiple" id="lstRoles" tabIndex="9" runat="server" Height="56px" Width="160px"></asp:listbox>
[/color]
[COLOR=gray]... omitted html ...[/color]
The codebehind:
Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Oracle.DataAccess.Client;
namespace Internal
{
ublic class administrator : System.Web.UI.Page
{
[COLOR=gray]... omitted code...[/color]
[COLOR=blue]
protected System.Web.UI.WebControls.ListBox lstRoles;
[/color]
private void Page_Load(object sender, System.EventArgs e){
[COLOR=gray]... omitted code...[/color]
ds = dba.GetOraDataSet(sql,"Groups");
[COLOR=gray]... omitted code...[/color]
lstRoles.DataSource=ds.Tables["Groups"];
lstRoles.DataTextField="DESCRIPTION";
lstRoles.DataValueField="GID";
lstRoles.DataBind();
SetupUserType(ddlUserType);
}
override protected void OnInit(EventArgs e){
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent(){
[COLOR=gray]... omitted code...[/color]
this.lstRoles.SelectedIndexChanged += new System.EventHandler(this.lstRoles_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}
[COLOR=gray]... omitted code...[/color]
private void btnCreateUserLogin_Click(object sender, System.EventArgs e){
[COLOR=gray]... omitted code...[/color]
[COLOR=blue]login.AddRoles(userId,GetSelectedItems(lstRoles));[/color]
[COLOR=gray]... omitted code...[/color]
[COLOR=blue]
private ArrayList GetSelectedItems(ListBox listBox){
ArrayList returnVal = new ArrayList();
foreach(ListItem item in listBox.Items)
if(item.Selected) returnVal.Add(item.Value);
return returnVal;
}
[/color]
[COLOR=gray]... omitted code...[/color]
}
}
Thanks for your help!