当前位置: 代码迷 >> ASP.NET >> 多行textBox显示有关问题
  详细解决方案

多行textBox显示有关问题

热度:6940   发布时间:2013-02-25 00:00:00.0
多行textBox显示问题
如图所示,请问如何触发不同的BUTTON,但是在同一textbox上面出现多行数据?


------解决方案--------------------------------------------------------
设置下textbox的textmode就行啦
------解决方案--------------------------------------------------------
如何触发不同的BUTTON
写个例子
C# code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="test8_Default9" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title></title>    <style type="text/css">        .style1        {            width: 100%;        }    </style>    <script src="../js/Demonstrate/jquery-1.4.1-vsdoc.js" type="text/javascript"></script></head><body>    <form id="form1" runat="server">    <div>    <% for (int i = 0; i < 3; i++)       {                  %>        <table class="style1">            <tr>                <td>                    <input type="button" value="Add" id= "btnAdd_<%=i %>" onclick="showInfo(<%=i %>)" />                </td>                <td>                    &nbsp;</td>            </tr>        </table>    <%} %>    </div>    </form></body></html><script type="text/javascript">    function showInfo(num) {        alert(num);    }</script>
------解决方案--------------------------------------------------------
HTML code
<asp:Button ID="Button1" runat="server" Text="Button" onclick="btn_Click" /><asp:Button ID="Button2" runat="server" Text="Button" onclick="btn_Click" />
------解决方案--------------------------------------------------------
C# code
 textbox.Text += "你选择的值"+"<br/>" textbox在这里的作用无非就是展示用的,就是为了显示你选择的内容,用label或者其他控件都可以实现
  相关解决方案