如何在asp.net中创建分区,动态 [英] How to create the div, dynamically in asp.net

查看:210
本文介绍了如何在asp.net中创建分区,动态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些文本框和提交按钮。

I have some textbox and submit button.

在以往我点击提交按钮股利应动态在我的aspx页面添加。

When ever I click the submit button the div should be added dynamically in my aspx page.

同样是在文本框中也显示在页面默认提供的信息。

Also the information which is available in the text box also displayed in the page default.

使用:不使用的数据库,我需要在我的页面显示用户的建议...

Use:Without using database i need to display the user suggestion in my page...

推荐答案

您有两种方式:

You have 2 possibilities:


  1. 您可以动态地添加产生div标签,一个asp.net面板。

  1. You can add dynamically an asp.net panel which generates div tag.

//这里创建动态控件。

//使用使用System.Web.UI.WebControls;

面板PANEL1 =新面板();

panel1.ID =MyPanel;

Form1.Controls.Add(PANEL1);

// Create dynamic controls here.
// Use "using System.Web.UI.WebControls;"
Panel panel1 = new Panel();
panel1.ID = "MyPanel";
Form1.Controls.Add(panel1);

创建使用jQuery在div

Create the div using jQuery

选择与父元素
$(#ID) $(&放大器; LT;元素和放大器; GT;) $(类。)然后 $(theElement).append(< D​​IV>您的内容与LT; / DIV>中);

Select the parent element with $("#id"), $("&lt;element&gt;") or $(".class") and then $(theElement).append("<div>Your content</div>");

这篇关于如何在asp.net中创建分区,动态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆