asp.net中的Gridview或Listview [英] Gridview or Listview in asp.net

查看:100
本文介绍了asp.net中的Gridview或Listview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试在asp.net中创建一个网格或列表,其上有文本框,可以在不使用数据库的情况下添加,编辑,删除行。

有人可以帮助我这里我是新手列表和网格在asp.net

Hi,
I am trying to make a grid or list in asp.net which have textboxes over it and can add, edit, delete rows without using database.
can someone help me out here I'm new to list and grid in asp.net

推荐答案

你提到过,GridView或ListView如你所说制作网格或清单。这是你这个问题的实际问题。你不确定该怎么做。让我告诉你两者之间的基本不同。



ListView用于垂直堆叠视觉控件。每个元素都在另一个元素之后。就像ListBox一样,不同的是你可以通过调用ToString函数来编辑每个控件的渲染方式,而不是像ListBox那样。



另一方面,GridView水平地叠加可视控件,一个接一个。您还可以控制它们的宽度和高度。



这取决于你想做什么,



1.如果你想创建一个视图类似于音乐库,每首歌曲都在前一个音乐库中,使用ListView。

2.如果要创建图库并想在网格中显示控件(图像),请使用GridView。



但请记住,这些控件来自ASP.NET Web Forms,新版本的ASP.NET仅为您提供ASP.NET MVC,Web Forms被删除,其他框架也集成在ASP.NET MVC中。
You mentioned, GridView or ListView as you said "make a grid or list". That is the actual problem in this question of yours. You are not sure of what to do. Let me tell you the basic different between both of them.

ListView is used to stack the visual controls vertically. Every element comes after the other, next to it. Just as a ListBox does, the different is that you get to edit how each of these controls would render rather than like ListBox did by calling ToString function.

GridView on the other hand stacks the visual controls horizontally, one after the other. You also get to control the width and heights of them.

It depends on what you want to make,

1. If you want to create a view similar to a Music Library, where each song gets stacked right under the previous, use ListView.
2. If you want to create an image gallery and want to show the controls (Image) in a grid, use GridView.

But remember, these controls are from ASP.NET Web Forms, the new versions of ASP.NET provides you with ASP.NET MVC only, Web Forms is removed and other frameworks are integrated in ASP.NET MVC.


这篇关于asp.net中的Gridview或Listview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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