Problems caused by textbox. Visible = false hiding

Source: Internet
Author: User

Today, the company's formal environment has a poor function, but the test environment is no problem. After discussion with colleagues, it was found that the visible attribute of textbox was set to false when I was writing code.

At that time, the requirement was to add "related instructions" when sending an email, while "related instructions" were filled in by the first sender, and after receiving the email, log on to the system and send the second email,

The "Description" of the email is the last "Description" written by the first person, rather than "Description ". Because a public upload, email page, and only the first person can see the "Instructions"

Text Box. Therefore, I set the visible of textbox to false by default, and set it to true when the first mail is sent.

The program runs in the test environment. However, when running in the formal environment today, the second person did not get the "Related Description" of the first person ".

After troubleshooting, I found that the visible of textbox was set to false. Although the value can be assigned, the textbox may not be parsed due to different browsers, and the value cannot be taken, so there is no relevant description.

The colleague gave the DIV method to hide and display

            <div id="mydiv" runat="server" style="display:none;">                <asp:Label ID="LalExplain" Text="相关说明" runat="server" Visible="false" />                <asp:TextBox ID="TxtBoxExplain" runat="server" Width="700px" TextMode="MultiLine"></asp:TextBox>                <asp:Label ID="Label2" runat="server" ForeColor="Red"></asp:Label>            </div>

Use the following code in the background to display

mydiv.Style.Value = "display.block";

The following code is parsed by the browser:

 <div id="mydiv" style="display:none;">                                <textarea name="TxtBoxExplain" rows="2" cols="20" id="TxtBoxExplain" disabled="disabled" class="aspNetDisabled" style="width:700px;">1、信息查询2、系统说明</textarea>                <span id="Label2" style="color:Red;"></span>            </div>

In this way, the textbox is invisible and can be parsed by the browser.

 

Problems caused by textbox. Visible = false hiding

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.