开发者

display mulitple copies of page.aspx in one main page

开发者 https://www.devze.com 2023-04-01 13:59 出处:网络
Just need an idea of what to do here. (beginner) I have a web page, an ASDF.aspx.It displays information.Works just fine; has data bound controls ….What I want to do is create a main r开发者_运维技巧

Just need an idea of what to do here. (beginner)

I have a web page, an ASDF.aspx. It displays information. Works just fine; has data bound controls …. What I want to do is create a main r开发者_运维技巧eview page, a page that will display multiple copies of ASDF.aspx.

I don’t even know how to start. In the old world, I’d create an object returning HTML ASDF text, call that object multiple times for each ASDF form I wanted to show, and then cat it all together.


you can transfer all the logic from the aspx page to a .ascx web user control (should be pretty much a copy/paste). Then you can put one copy of your web user control in ASDF.aspx and multiple copies of your web user control in your review page.

A web user control is a naming container (so it will make sure all the controls have unique names in your review page). This will make sure your server-side logic still works, but you may have to check if you're referring to your controls by name in your client-side (javascript) logic, because the names the controls have in the HTML may change.


That's what user controls (ASCX files) are for. Take the markup and code-behind logic from ASDF.aspx and put it into a user control. Then, from the review page add multiple instances of the user control to the page.


Using a web user control is the best practice to create reusable parts of a page.

BTW, if you can't change the asdf.aspx page, as a workaround, you can use iframe. Put an iframe for each copy of asdf.aspx you want to show:

  <iframe src="asdf.aspx?id=1" />
  <iframe src="asdf.aspx?id=2" />
  <iframe src="asdf.aspx?id=3" />
0

精彩评论

暂无评论...
验证码 换一张
取 消