如何在同一页面中使用内容页面链接 [英] How can I use content page link in same page

查看:121
本文介绍了如何在同一页面中使用内容页面链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个母版页和一个子内容页.在内容页面中,我创建了一个包含2列的表.
在第一列中,我创建了4个链接按钮.单击每个链接按钮后,我需要在内容页面中动态显示子表单.例如,我有这样的内容:


I have created a master page and a child content page. In the content page, I have created a table having 2 columns.
In the first column, I have created 4 link buttons. On clicking each link button, I need to dynamically show child forms within the content page. For example, I have something like this:


Master page

          Content page

                 Child link 1

                 Child link 2

                 Child link 3

                 Child link 4



单击子链接" 1后,我需要在同一内容页面的右侧显示一个表单.单击链接2后,我需要显示另一个表格,依此类推.由于我是该论坛的新手,还是ASP.NET和VB.Net的初学者,希望我可以在这里找到一些帮助.
提前感谢你的帮助.如果您甚至可以指向我指向该网站上的某些文章,并从那里开始学习,那就太好了.



Upon clicking Child link 1, I need to display a form in the right hand side of the same content page. Upon clicking link 2, I need to show another form and so on. As I am a newbie to this forum and a beginner in ASP.NET and VB.Net, hoping that I might find some help here.
Thanks in advance for your assistance. It’d be great if you can even point me to some article on this site and I’ll take it up from there.

推荐答案

您希望链接链接到具有查询字符串值的同一页面,例如default.aspx?sel = cl4,其中cl4是您需要告诉您在右侧显示什么的值.然后您的页面将被重定向,页面加载,读取该值并相应地显示其自身.这种方法的好处是您所有的页面都可以添加书签.
You want the links to link to the same page with a query string value, such as default.aspx?sel=cl4, where cl4 is the value you need to tell you what to show in the right side. Then your page will redirect, the page loads, reads that value, and shows itself accordingly. The benefit of this approach is that all your pages are bookmarkable.


如果您不想使用回发,则有两种选择.如果其他形式不广泛,则可以将每个形式放在默认情况下隐藏的div中(位于同一页面上),然后在单击链接时使用javascript显示它们.或者,您可以使用AJAX将表单的内容加载到页面 http://api.jquery.com/load/ [^ ]
If you don''t want to use postbacks you have a couple of options. If the other forms are not extensive you could place each one in a div, hidden by default, on the same page, then show them using javascript when the link is clicked. Or you could use AJAX to load the contents of the form into the page http://api.jquery.com/load/[^]


这篇关于如何在同一页面中使用内容页面链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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