文本框中未填充初始文本

发布于 2024-08-05 12:21:26 字数 1384 浏览 9 评论 0原文

我已将初始文本放入 asp.net 网页的文本框中。在文本属性框中。

我想在网页加载时加载文本。

当我调试和运行时,文本框没有填充该文本。

请帮我。

 <td class="textFieldColumn" style="height:16px!important;">
                                                    <asp:TextBox ID="txtUserID" text="Enter User id.." runat="server" AutoPostBack="true" 
                                                        CssClass="text_box_3"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvUserID" CssClass="requiredField" runat="server" ControlToValidate="txtUserID"
                                                        ErrorMessage="* Required field" ValidationGroup="Form2"></asp:RequiredFieldValidator><div class="smallText" nowrap>
                                                        &nbsp;&nbsp;(This would be the ID you would normally log on with.)</div></td>




  Private Sub mvRequestorForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles mvRequestorForm.Load
        txtUserID.Text = "Enter User ID..."
    End Sub













<input name="txtUserID" type="text" onchange="javascript:setTimeout('__doPostBack(\'txtUserID\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="txtUserID" class="text_box_3" />

渲染的代码

I have put an initial text in the text box of a asp.net web page. In the text property box.

I want to load the text in the load time of the webpage.

While i debug and run text box is not populating with that text.

Please help me.

 <td class="textFieldColumn" style="height:16px!important;">
                                                    <asp:TextBox ID="txtUserID" text="Enter User id.." runat="server" AutoPostBack="true" 
                                                        CssClass="text_box_3"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="rfvUserID" CssClass="requiredField" runat="server" ControlToValidate="txtUserID"
                                                        ErrorMessage="* Required field" ValidationGroup="Form2"></asp:RequiredFieldValidator><div class="smallText" nowrap>
                                                          (This would be the ID you would normally log on with.)</div></td>




  Private Sub mvRequestorForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles mvRequestorForm.Load
        txtUserID.Text = "Enter User ID..."
    End Sub













<input name="txtUserID" type="text" onchange="javascript:setTimeout('__doPostBack(\'txtUserID\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="txtUserID" class="text_box_3" />

tHE RENDERED CODE

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流心雨 2024-08-12 12:21:26

我会使用 AJAX TextBoxWatermark

http://www.asp.net/ AJAX/AjaxControlToolkit/Samples/TextBoxWatermark/TextBoxWatermark.aspx

<ajaxToolkit:TextBoxWatermarkExtender ID="txtExtender1" runat="server"
    TargetControlID="txt"
    WatermarkText="Type First Name Here"
    WatermarkCssClass="watermarked" />
<asp:Textbox id="txt" ruant="server" />

I would use a AJAX TextBoxWatermark

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/TextBoxWatermark/TextBoxWatermark.aspx

<ajaxToolkit:TextBoxWatermarkExtender ID="txtExtender1" runat="server"
    TargetControlID="txt"
    WatermarkText="Type First Name Here"
    WatermarkCssClass="watermarked" />
<asp:Textbox id="txt" ruant="server" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文