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" />
精彩评论