Hi Guarav
I got rid of the offending code, to move onto something else, however I keep
getting a similar error every time I try to add any slightly unusual property
to a control, for example in the following page of aspx code, I've specified
RepeatDirection="Horizontal" as a property of the RadioButtonList, and I get
a very similar error ('System.Web.UI.WebControls.TextBox' does not contain a
definition for 'Web'). Before you ask, the error does say 'TextBox', but
identifies the RadioButtonList as the source of the problem. I've also
listed the code behind and the master page code and code behind:
-----EditSystem.aspx-----------
<%@ Page Language="C#" MasterPageFile="~/master/default.master"
AutoEventWireup="true"
CodeFile="EditSystem.aspx.cs" Inherits="Admin_AddSystem" Title="Untitled
Page" %>
<asp:Content ID="htmlTitle" ContentPlaceHolderID="htmlTitle" runat="Server">
IST Systems Status - Edit System
</asp:Content>
<asp:Content ID="head" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="dropDownMenus" ContentPlaceHolderID="dropDownMenus"
runat="Server">
<li><a href="/system_status/" title="Go to home page"
menu="home">Home</a></li>
<!--<li><a href="#" menu="menu2">Drop-down menu</a></li>-->
<li id="active"><a href="/system_status/Admin/ManageStatus.aspx"
title="Update system(s) including current status">
Update Systems</a></li>
<li id="help"><a href="/system_status/help.aspx" title="Help information"
menu="help">
Help</a></li>
</asp:Content>
<asp:Content ID="breadcrumb" ContentPlaceHolderID="breadcrumb" runat="Server">
<div class="breadcrumb">
<a href=''>IST</a/ <a href="/system_status/">
System Status</a/ Update Systems / <a
href="/system_status/Admin/ManageSystems.aspx">
Manage Systems</a/ Edit System
</div>
</asp:Content>
<asp:Content ID="main" ContentPlaceHolderID="main" runat="Server">
<form id="form1" runat="server" class="flow">
<br />
<div style="margin-left: 40px">
<h2>
Edit System</h2>
<br />
<br />
<fieldset class="float">
<br />
<table class="editSystemDetailsTable">
<tr>
<td class="editSystemDetailsTable">
System
</td>
<td class="editSystemDetailsTable">
<asp:TextBox ID="System" runat="server"
CssClass="inputBox"></asp:TextBox>
</td>
</tr>
<tr>
<td class="editSystemDetailsTable" CssClass="inputBox">
Category
</td>
<td class="editSystemDetailsTable">
<asp:DropDownList ID="lstCategories" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="editSystemDetailsTable" CssClass="inputBox">
Importance
</td>
<td class="editSystemDetailsTable">
(Lowest)
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:RadioButtonList>
(Highest)
</td>
</tr>
<tr>
<td class="editSystemDetailsTable">
</td>
<td class="editSystemDetailsTable">
<asp:Button ID="Save" runat="server" OnClick="Save_Click"
Text="Save" CssClass="marginLeft"
Style="text-align: center" />
</td>
</tr>
</table>
</fieldset>
<br />
<br />
<br />
<br />
</div>
</form>
</asp:Content>
--------------- EditSystem.aspx.cs ----------------
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Admin_AddSystem : System.Web.UI.Page
{
private short srtSystemID;
protected void Page_Load(object sender, EventArgs e)
{
bool blnIsNewRecord = (Request.QueryString["id"] == null);
if (!blnIsNewRecord)
{ srtSystemID = Convert.ToInt16(Request.QueryString["id"]); }
#region initialisation of page
if (!Page.IsPostBack)
{
if (!blnIsNewRecord)
{
PopulateForm();
PopulateDropDowns();
}
}
#endregion
}
protected void PopulateForm()
{
using (DataSet dsSystemDetails =
DAL.SystemStatus.getSystemDetailsByID(srtSystemID) )
{
//Category.Text =
dsSystemDetails.Tables[0].Rows[0]["ss_category"].ToString();
//System.Text =
dsSystemDetails.Tables[0].Rows[0]["ss_system"].ToString();
//UnavailableFrom.Text =
dsSystemDetails.Tables[0].Rows[0]["ss_down_from"].ToString();
}
}
protected void PopulateDropDowns()
{
using (DataSet dsCategories = DAL.SystemStatus.getCategories())
{
lstCategories.DataSource = dsCategories;
lstCategories.DataTextField = "ss_category";
lstCategories.DataValueField = "ss_category";
lstCategories.DataBind();
}
}
protected void Save_Click(object sender, EventArgs e)
{
// save details of new system
//strSystem = System.Text;
// save details to database, and redirect to 'Maintain System
Details' page
//DAL.SystemStatus.setSystemDetails(strSystem, strStatus,
datUnavailableFrom, datReavailableFrom, strReason, srtSystemID);
Response.Redirect("ManageSystems.aspx");
}
}
--------------- default.master ----------------
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="default.master.cs"
Inherits="master_default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<asp:ContentPlaceHolder ID="htmlTitle" runat="server">
</asp:ContentPlaceHolder>
</title>
<link rel="stylesheet" type="text/css" href="/core/template/sidebar.css" />
<link rel="stylesheet" type="text/css"
href="/core/template/default_css.asp" />
<link rel="stylesheet" type="text/css" href="/core/template/screen.css"
media="screen" />
<link rel="stylesheet" type="text/css" href="/core/template/print.css"
media="print" />
<link rel="stylesheet" type="text/css" href="/core/template/sidebar.css" />
<link rel="stylesheet" type="text/css" href="~/StyleSheet.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css"
href="/core/template/default.ie.css"/>
<![endif]-->
<link rel="shortcut icon" href="/core/template/images/logo.dev.ico" />
<script language="javascript" src="/core/punaAPI/punaAPI.js"
type="text/javascript"></script>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<script type="text/javascript">
// some code removed
</script>
<!-- whole page container-->
<div id="container_page">
<!-- main content wrapper (excludes footer) -->
<div id="container_content">
<div id='container_masthead'>
<!-- some code removed -->
</div>
<div id="navigation_bar">
<div id="navigation">
<ul id="nav">
<!-- add code similar to the following as the content of to the
dropDownMenus section, on each
individual page, and mark appropriate menu as being 'active' as
per the first <litag
<li id='active'><a href="/system_status/" title="Go to home
page" menu="home">Home</a></li>
<li><a href="#" menu="menu2">Drop-down menu</a></li>
<li id="menu3"><a href="/system_status/help.aspx" title="Help
information" menu="help">Help</a></li>
*uses script that follows this general format, as included in
this master page:*
<script type="text/javascript">
// some code removed
</script>
-->
<asp:ContentPlaceHolder ID="dropDownMenus" runat="server">
</asp:ContentPlaceHolder>
</ul>
</div>
</div>
<!-- if breadcrumbs make sense in the application... -->
<asp:ContentPlaceHolder ID="breadcrumb" runat="server">
</asp:ContentPlaceHolder>
<!-- main content -->
<div id="container_text">
<!-- if the page title is to be highly visible to the end user... -->
<h2 id='pageTitle'>
</h2>
<asp:ContentPlaceHolder ID="main" runat="server">
</asp:ContentPlaceHolder>
</div>
<!-- end main content -->
</div>
<!-- end main content wrapper -->
<!-- footer content -->
<!-- end footer content -->
</div>
<!-- end whole page container -->
</form>
</body>
</html>
--------------- default.master.cs ----------------
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
public partial class master_default : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
----------------
"Gaurav Vaish (a.k.a. MasterGaurav)" wrote:
Thanks for the very quick reply. You're right that I'm using .NET 3.5.
Unfortunately, your suggestion is not the cause of the problem - I'm not
trying to set a property 'Web' equal to anything in code. The class in
the
code behind is defined as:
public partial class RecordDetails : System.Web.UI.Page
Can you please post across both the files - aspx and code-beside?
Or if it's too public a forum... mail at gaurav[~dot~]vaish[~at~]gmail.
--
Happy Hacking,
Gaurav Vaish | http://dwt.sourceforge.net
http://blogs.mastergaurav.com | http://eduzine.edujini-labs.com
--------------------------------