<asp:TextBox ID="txtauto" runat="server" onkeydown="changeInputLength()"></asp:TextBox>
一句话:
function changeInputLength()
{
document.getElementById("txtauto").size = document.getElementById("txtauto").value.length+2;
}