访问CodeBehind中的HTML控件和访问Source中的服务器端控件 [英] Access to HTML Controls in CodeBehind and Access to Server Side Controls in Source

查看:59
本文介绍了访问CodeBehind中的HTML控件和访问Source中的服务器端控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CodeBehind中访问HTML控件并在源(Aspx文件)中访问服务器端控件

如何在CodeBehind中访问HTML控件并在源(Aspx文件)中访问服务器端控件-asp.net(c#)
非常感谢

Access to HTML Controls in CodeBehind and Access to Server Side Controls in Source(Aspx file)
Hi
How can I Access to HTML Controls in CodeBehind and Access to Server Side Controls in Source(Aspx file) - asp.net(c#)
Thanks very much

推荐答案

尝试属性的aspx页面中.

希望对您有帮助:)
Try this [^] for accessing the html control in codebehind but not sure what you are trying to do in the second part of your question as the server controls are always there in aspx page with runat="server" attribute.

hope it helps :)


问题未正确提出,因此无法从字面上回答.

这是背景:

服务器端控件是设计者提出的一种虚构内容,它是处理HTTP请求并通过ASP.NET服务器端代码生成HTTP响应的产物.这些控件最终呈现为客户端上加载的一些HTML代码.

一种控件不能仅仅因为它们是同一事物的不同阶段而访问另一控件.从服务器的角度来看,HTML控件只是HTTP请求中生成的HTML文本,它们本质上并不作为单独的对象存在.从客户端的角度来看,服务器端控件不存在任何形式或任何意义:在加载和呈现HTML内容时,服务器端应用程序已终止其生命.它只是由于回发(或一般而言的任何HTTP请求)而再次出现.

—SA
The problem is not correctly formulated, so it cannot be literally answered.

Here is the background:

Server-side controls is a fiction presented by the designer, the artifact of processing of HTTP request and generating HTTP response by ASP.NET server-side code. These controls are ultimately rendered as some HTML code loaded on the client side.

One kind of control cannot access another just because they are different stages of the same thing. From the server side standpoint, HTML controls are just the text of HTML generated in HTTP request, they do not essentially exist as separate objects. Form the standpoint of client side, server-side controls do not exist in any form or in any sense: at the moment of time when HTML content is loaded and rendered, server-side application is already terminated its life. It comes to like again only as a result of a postback (or any HTTP request in general).

—SA


这篇关于访问CodeBehind中的HTML控件和访问Source中的服务器端控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆