zoukankan      html  css  js  c++  java
  • PlaceHolder

    PlaceHolder 控件用于为代码添加的控件预留空间。在页控件层次结构中为以编程方式添加的控件保留位置。

    注释:PlaceHolder 不会产生任何可见的输出(仅仅是网页上其它控件的容器)。

    设计如图:

    打开源:

    <body>
        <form id="form1" runat="server">
        <div>
            <table style=" 100%;">
                <tr>
                    <td>
                        &nbsp;
                        昵称:</td>
                    <td>
                        &nbsp;
                        &nbsp;
                        相片:</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                        法拉利f430</td>
                    <td>
                        &nbsp;
                        <asp:PlaceHolder ID="placeCar" runat="server"></asp:PlaceHolder>
                    </td>
                </tr>
                </table>
        </div>
        </form>
    </body>

    在该网站新建文件夹Images 粘贴一张图片到该文件夹下面

    打开后置cs

        protected void Page_Load(object sender, EventArgs e)
        {
            TextBox txtUserName = new TextBox();
            txtUserName.Text = "请写上你的大名:";
            this.form1.Controls.Add(txtUserName);

            Image image = new Image();
            image.ImageUrl = "~/Images/falali.jpg";
            this.placeCar.Controls.Add(image);
        }

    效果如图:

  • 相关阅读:
    uC/OS-II时间(OS_time)块
    uC/OS-II任务(OS_task)块
    uC/OS-II信号(OS_sem)块
    uC/OS-II队列(OS_q)块
    uC/OS-II互斥信号(OS_mutex)块
    uC/OS-II内存(OS_mem)块
    elasticsearch-installation
    rabbitmq的安装
    str_翻转字符串
    str_2.判断两个字符串是否互为旋转词
  • 原文地址:https://www.cnblogs.com/scsuns520/p/1633585.html
Copyright © 2011-2022 走看看