Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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 :)
 
Share this answer
 
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
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900