joecool2005 Posted July 6, 2007 Share Posted July 6, 2007 Hi,On the code below how can I add the lname value to my textbox?Thx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="dataListVB.aspx.vb" Inherits="dataListVB" %><%Dim lname As String = "Smith"%><FORM NAME="Form" METHOD="POST" runat=server><asp:TextBox id="LastName" runat="server" /></FORM> Link to comment Share on other sites More sharing options...
aspnetguy Posted July 6, 2007 Share Posted July 6, 2007 <%Dim lname As String = "Smith"LastName.Text = lname%> Link to comment Share on other sites More sharing options...
jesh Posted July 6, 2007 Share Posted July 6, 2007 In C#: LastName.Text = lname; Link to comment Share on other sites More sharing options...
joecool2005 Posted July 9, 2007 Author Share Posted July 9, 2007 By doing this it changes the value of the textbox but it will not display on the textbox. Is it possible to display it inside the textbox? <asp:TextBox id="LastName" runat="server" /> <% Dim lname As String = "Smith" LastName.Text = lname%> Link to comment Share on other sites More sharing options...
aspnetguy Posted July 10, 2007 Share Posted July 10, 2007 using ASP style tags is not a good practiceeither use codebehind or at the very least do this <%@ Page Language="VB" AutoEventWireup="false" CodeFile="dataListVB.aspx.vb" Inherits="dataListVB" %><script runat="server">void Page_Load(){ Dim lname As String = "Smith" LastName.Text = lname}</script><FORM NAME="Form" METHOD="POST" runat=server><asp:TextBox id="LastName" runat="server" /></FORM> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.