求助,WEB Forms 控件页 上的 label,button 和 Html 控件页上的 label,button 有什么不同吗?谢谢!
请教:
我打开 visual c# projects asp.net web application
然后往 上面拖控件
我在 WEB Forms 拖了 label1,button1
在 Html 也拖了 label1,button1
可是我发现 Html 上的 label1,button1 没有 text 属性
请教 各位大哥:
Html 上的 label1,button1 是用什么属性代替 WEB Forms 拖了 label1,button1 的 text 属性的呢?
还有一般我们是 WEB Forms 上的控件还是用 Html 上的控件呢?
请各位大哥介绍几本 非常基础的(连 html 控件页上 的控件属性 都讲的书)
谢谢 各位大哥了!
问题点数:50、回复次数:5Top
1 楼hchxxzx(NET?摸到一点门槛)回复于 2005-06-01 20:08:28 得分 30
两者在生成之后,HTML代码类似,但二者工作机理不同.
label:
服务端控件:Text
客户端控件:innerHTML
button:
服务端:Text
客户端:value
在ASP.NET中,一般是用服务端控件,因为控制灵活,功能强大,唯一的不足是运行效率稍低于客户端控件.Top
2 楼delphi_start(中文)回复于 2005-06-01 20:41:05 得分 0
hchxxzx 大哥:
您太牛了~~
那么 html 的
label1.innerHTML=="kkk";
hchxxzx 大哥,是不是这样啊?
谢谢 hchxxzx 大哥!
Top
3 楼hackate(兰花开香入梦境,独思佳人亦飘然!!)回复于 2005-06-01 20:47:03 得分 10
label控件等于HTML里的span
Top
4 楼laihua(背着石头过河)回复于 2005-06-01 20:52:52 得分 10
服务端的控件在执行他的事件时会引发postback,页面会刷新,html控件一般用js写事件。不会引起页面刷新。Top
5 楼delphi_start(中文)回复于 2005-06-01 21:09:39 得分 0
谢谢 各位大哥:
laihua 大哥:
服务端的控件在执行他的事件时会引发postback,页面会刷新,html控件一般用js写事件。不会引起页面刷新。
请您再详细解释一下,好吗?
再次感谢各位大哥!
还有一个问题是:
我刚才照着书上写了个程序:
我按 Ctrl+Shit+B 编译项目没有错误 (Build: 1 succeeded, 0 failed, 0 skipped)
可是我按 Ctrl+F5 运行程序,则出现下面的错误:
*********************************************************************错误提示
Server Error in '/DEMO/CH2' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The data at the root level is invalid. Line 1, position 1.
Source Error:
Line 1: .<?xml version="1.0" encoding="utf-8" ?>
Line 2: <configuration>
Line 3:
Source File: c:\inetpub\wwwroot\DEMO\CH2\web.config Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
*****************************************************************************错误提示
各位大哥,我是不是有什么地方还没有配置好!
配置文件为:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation
defaultLanguage="c#"
debug="true"
/>
<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.
"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors
mode="RemoteOnly"
/>
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"
"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
-->
<authentication mode="Forms">
<forms loginURL="webform1.aspx"/>
</authentication>
<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<deny users="?"/>
</authorization>
<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
</system.web>
</configuration>
Top




