Buy Questpond's video subscriptions on
huge discount
.
Online: 8381
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
ASP.NET
>
Loading ...
To pass Html Input value as ASP:textbox value in code behind (.cs page)
Posted by
Anishabathija
under
ASP.NET
on 11/16/2012 |
Points: 10
| Views : 11478 | Status :
[Member]
| Replies : 4
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
hey ,
I have created a datetime picker using javascript , however the field to select the date is of the type html input. how Do I pass this value as a textbox value in my code behind page.
Please help.
thanks
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Funda
on: 11/16/2012
[Member]
Starter
|
Points: 25
0
I am not sure about your question.....
If you want a Html Input value in server side , use runat attribute [runat="server"] ...
example
<input id="Text1" runat="server" type="text" />
now you will be getting the Text1 in server side...
Anishabathija
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Anishabathija
on: 11/16/2012
[Member]
Starter
|
Points: 25
0
Yeah that's exactly what I have done.
Now I want to pass the value of this "<input>" field to my code behind (.cs page) .
how do I do that?
Anishabathija
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Deepraj
on: 11/16/2012
[Member]
Starter
|
Points: 25
0
Hi,
In order to access html tags in code behind use
[id of html tag].Value;
which gives you value in code behind.
The HTML5 introduces new set of tags
<input type="date" id="mycal" runat="server" > is one new element
you can access this element using mycal.Value
Anishabathija
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Funda
on: 11/16/2012
[Member]
Starter
|
Points: 25
0
@Anishabathija
what Deepraj is correct....which is recommended always..you need to get value....
Still.....
As I dont know what you doing in the code ..so u can try the following...
Request.Form["elementId"]
HtmlElementCollection elems = document.GetElementsByTagName(elementName);
mytag.Attributes["NameOfElementAttribute"]
Still many ways are there....:-)
Anishabathija
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...