读书人

请问一个常识性的有关问题请

发布时间: 2012-01-20 18:53:53 作者: rapoo

请教一个常识性的问题,请高手指点。
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "Product_Update.aspx.cs " Inherits= "WebUI.Manage.Prduct_Update " %>

<!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> Unit Page </title>
</head>

<script language=javascript type= "text/javascript ">

function ShowTempImage(imageCtlID,fileCtlID)
{
var filepath=document.getElementById(fileCtlID).value;
var fileEx=filePath.split( ". ");
var fileExName=(fileEx[fileEx.Length-1]).toLowerCase();
if(fileExName== "jpg "||fileExName== "gif ")
{
document.getElementById(imageCtlID).style.visibility= "visible ";
document.getElementById(imageCtlID).src=filePath;
}
else
{
document.getElementById(imageCtlID).style.visibility= "hidden ";
}
}
</script>
<body>
<form id= "form1 " runat= "server ">
<div>
<table border= "0 " style= "width:100% ">
<tr>
<td style= "width:100% ">
</td>
</tr>
<tr>
<td style= "width:100%;height:152px; ">
<table border= "1 " style= "width:100% ">
<tr>
<td style= "width:100% "> 产品名称 </td>
<td style= "width:546px ">
<asp:TextBox ID= "txt_pname " runat=server> </asp:TextBox>
</td>
</tr>
<tr>
<td style= "width:100% "> 类别 </td>
<td style= "width:546px ">
<asp:DropDownList ID= "ddl_ptype " runat=server Width= "158px "> </asp:DropDownList>
</td>


</tr>
<tr>
<td style= "width:100% ">
产品图片 </td>
<td style= "width:546px ">
  
<table border= "0 " cellpadding= "0 " cellspacing= "0 " style= "width:100% ">
<tr>
<td style= "width:100% ">
<asp:Image ID= "Image1 " runat=server Height= "100% " Width= "100% " ImageUrl= "../UpLoadFiles/nopic.jpg " />
</td>
</tr>
<tr>
<td style= "width:100% ">
<asp:FileUpload ID= "fu_pimg " runat=server />
</td>
</tr>

</table>
</td>
</tr>
<tr> <td> </td> <td> </td> </tr>
<tr>
<td style= "width:100% "> 详细信息 </td>
<td style= "width:546px ">
<asp:TextBox ID= "txt_pinfo " runat=server Height= "338px " TextMode=MultiLine Width= "558px "> </asp:TextBox>
</td>
</tr>
<tr>


<td style= "width:100% "> </td>
<td style= "width:546px ">
<asp:Button ID= "Button1 " runat=server Text= "保存产品信息 " OnClick= "Button1_Click " OnCommand= "Button1_Command " />
</td>
</tr>
<tr>
<td style= "width:100% "> </td>
<td style= "width:546px "> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td style= "width:100% "> </td>
</tr>
<tr>
<td style= "width:100% "> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
然后我在aspx.cs里面想给html里面的一个空间赋值得时候txt_pname.text的时候竟然没有联想功能,也就是我打个txt_pname的时候后面不会自动出来.text想请高手指点

[解决办法]
常见的bug
try "this. "
[解决办法]
你先自己直接加.Text,然后编译看会不会报错。
[解决办法]
这个说不准的,你自己编译试一下会不会报错

读书人网 >asp.net

热点推荐