How to get html tag value in asp.net

coldplay.xixi
Release: 2023-01-03 09:27:46
Original
2351 people have browsed it

How to get the html tag value in asp.net: 1. By adding the [runat="server"] method, the code is [<input id="Text1" runat="server" type="text" />]; 2. Direct acquisition method.

How to get html tag value in asp.net

The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.

How to get the html tag value in asp.net:

Two methods:

1. Add runat="server"

<input id="Text1" runat="server" type="text" />
Copy after login

Get string str=this.Text1.value in the background;

2. Get it directly

<input id="Text1" name="GetValue" type="text" />
string str=Request.Form["GetValue"];
Copy after login

Related learning recommendations: html video tutorial

The above is the detailed content of How to get html tag value in asp.net. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template