程序集引用错误 [英] an assembly reference error
本文介绍了程序集引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i得到了以下错误。帮助我解决了这个错误。
'System.Web.UI.WebControls .TextBox'不包含'text'的定义,并且没有扩展方法'text'接受类型为'System.Web.UI.WebControls.TextBox'的第一个参数'(你是否缺少using指令或程序集引用) ?)
Hi,
i got the follwing error.pls help me to resolve this error.
'System.Web.UI.WebControls.TextBox' does not contain a definition for 'text' and no extension method 'text' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Details.aspx.cs" Inherits="Details" %>
<!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">
<title>Untitled Page</title>
<style type="text/css">
.style1
{
width: 10px;
height: 39px;
}
.style2
{
height: 39px;
}
</style>
<script language="javascript" type="text/javascript">
/*function aprl_disp()
{
document.getElementById("m1").visible=true;
}*/
function lg_display()
{
window.open("logout.aspx");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" AlternateText="cpcl"
DescriptionUrl="~/App_Data/images/cpcl.jpg" Height="156px"
ImageUrl="~/App_Data/images/cpcl.jpg" Width="250px" />
<br />
NAME:<asp:TextBox id="t1" runat="server" Text="XXXX"></asp:TextBox>
PR NO:<asp:TextBox id="t2" runat="server" Text=""></asp:TextBox>
<br />
<h1 style="width: 1368px; background-color: #C0C0C0; font-weight: 600; font-size: xx-large; font-style: normal; font-variant: normal; color: #800000;">
<marquee style="height: 57px; width: 1366px">DASHBOARD</marquee></h1>
<table>
<tr>
<td style="background-color:"Maroon" align="center" class="style2">
<asp:Menu ID="m1" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px">
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="TRAVEL" Value="GATE PASS">
<asp:MenuItem Text="AIR" Value="VISITOR" NavigateUrl="~/air.aspx"></asp:MenuItem>
<asp:MenuItem Text="CAR" Value="MATERIAL" NavigateUrl="~/car.aspx"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="GATE PASS" Value="GATE PASS">
<asp:MenuItem Text="VISITOR" Value="VISITOR" NavigateUrl="~/visitor.aspx"></asp:MenuItem>
<asp:MenuItem Text="MATERIAL PASS" Value="MATERIAL PASS"
NavigateUrl="~/material.aspx"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
<td style="background-color:"Maroon" align="center" class="style1">
<asp:Menu ID="m2" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px" Height="73px"
>
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="MIS" Value="MIS">
<asp:MenuItem Text="REPROT1" Value="REPROT1" NavigateUrl="~/report1.aspx"></asp:MenuItem>
<asp:MenuItem Text="REPORT2" Value="REPORT2" NavigateUrl="~/report2.aspx"></asp:MenuItem>
<asp:MenuItem Text="REPORT3" Value="REPORT3" NavigateUrl="~/report3.aspx"></asp:MenuItem>
<asp:MenuItem Text="REPORT4" Value="REPORT4" NavigateUrl="~/report4.aspx"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
<td align="center" class="style2">
<asp:Menu ID="m3" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px" Height="73px"
>
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="SURVEY" Value="SURVEY" NavigateUrl="~/main.aspx">
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
<td align="center" class="style2">
<asp:Menu ID="m5" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px" Height="73px"
>
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="NEWS" Value="LOGOUT">
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
<td align="center" class="style2">
<asp:Menu ID="m6" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px" Height="73px"
>
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="KYD" Value="LOGOUT" NavigateUrl="~/kyd.aspx">
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
<td align="center" class="style2">
<asp:Menu ID="m4" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px" Height="73px" >
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="LOGOUT" Value="LOGOUT" NavigateUrl="~/logout.aspx">
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
<td align="center" class="style2">
<asp:Menu ID="Menu1" runat="server" BackColor="#993333" Font-Bold="True"
Font-Size="XX-Large" ForeColor="Black" Width="211px" Height="73px"
>
<DynamicHoverStyle BackColor="#990033" />
<DynamicMenuItemStyle BackColor="#993333" />
<Items>
<asp:MenuItem Text="ADMIN" Value="LOGOUT" NavigateUrl="~/admin.aspx">
</asp:MenuItem>
</Items>
</asp:Menu>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
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 Details : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
t2.text = "welcome"
}
}
Thanks a lot.....
Thanks a lot.....
推荐答案
TextBox havin property called Text it not text, c# is case sensitive
TextBox havin property called Text it not text, c# is case sensitive
这篇关于程序集引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文