asp.net , c#, textbox

Posted on 2013-10-16
Medium Priority
Last Modified: 2013-10-21
<input class="span3" runat="server" id="email" name="email" placeholder="Email" type="text">                                                  

in asp.net/c# code behind, how to capture the value from above codes in the front end?
I have button in asp.net for the click event.

Question by:solution1368
  • 2
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39578323
string value = Request.Params["email"];  // whatever the "name" attribute of your target control is

Open in new window

LVL 33

Expert Comment

ID: 39578946
Front end? In JavaScript?
var ctl = document.getElementById('<%=email.ClientID%>');

Open in new window


Expert Comment

ID: 39578968
Request.Form["email"] in the server side and document.getElementById('<%=email.ClientID%>'); in client side or by using jquery $("#email").val()
LVL 33

Accepted Solution

hongjun earned 2000 total points
ID: 39578998
For jquery, it will still need the ClientID

var ctl =  $('#<%=email.ClientID%>');

Open in new window


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question