. Net Control page with js assignment background does not receive data Solution

Source: Internet
Author: User

I used
[Html]
<Asp: TextBox ID = "txtEndDate" name = "txtEndDate" ReadOnly = "true" runat = "server" onclick = "J. calendar. get (); "> </asp: TextBox>
The purpose is to click the text box to bring up a js date control. 1

(Figure 1)
After the date is selected, use the following background code to receive parameters.
[Csharp]
String sEndDate = txtEndDate. Text;

The value obtained from the result is an empty string ("").
My solution
① Add a name to the TextBox Control above and use the following code to solve the problem.
[Csharp] view plaincopyprint?
String end = Request. Form ["txtEndDate"];

Note: neither Request. QueryString ["txtEndDate"] can be obtained.

My current doubts
① Why cannot I receive the original attribute (Text attribute) for the value set in js)
② Why can't I get it only through Request. Form [""]?
③ There are no other solutions, so that normal properties can be used to receive

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.