在页面之间传递值 [英] Passing values between pages

查看:56
本文介绍了在页面之间传递值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

asp.net中的一个问题

使用sql server 2005,我通过field(id,title,subject,art​​icle)制作了一个表.我还制作了一个进行记录的页面.我想在第一页中显示标题,并使它们链接到另一个显示字段"article"的页面.

但是我不知道我应该使用什么?中继器或数据网格或...
我也不知道如何使标题链接到另一个字段"article".

a question in asp.net

with sql server 2005 i made a table by field(id,title,subject,article) .also i made a page that make records. i want to show titles in the first page and make them link to another page that shows field "article".

but i dont know what i shoud use?repeater or datagrid or...
also i dont know how can i make the titles link to another field "article"

推荐答案

Datagrid是我认为的最佳方法.链接并从此处指向您的记录页面.这将很容易且所需的代码更少.
Datagrid is the best way i think.make the first column of the datagird as link and from here refers to your record page.It will be easy and less code required.


考虑使用有意义的标记.

您可以使用任何喜欢的东西,gridview内置更多,而转发器更灵活.您可以通过以下方式建立链接:在网址上传递ID,然后创建一个页面,以ID的形式查找数据并显示该数据.
Consider using meaningful tags.

You can use anything you like, a gridview has more built in and a repeater is more flexible. You make a link by passing an id on the url and making a page that looks up data by the id and displays it


使用DataGrid/GridView显示标题并在DataItemBound事件上绑定rEcord的行ID,然后将其作为参数传递到文章"页面,并根据Prev中的文章ID显示记录.页面.
Use DataGrid/GridView to Display the title and on DataItemBound Event Bind the Row id of the rEcord and then pass it to Article page as a parameter and display the Record based on Article ID from Prev. Page.


这篇关于在页面之间传递值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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