all groups > asp.net > january 2006 >
You're in the

asp.net

group:

how to include aspx without directive?


RE: how to include aspx without directive? Peter Bromberg [C# MVP]
1/31/2006 7:08:32 AM
asp.net:
Franz,
Normally in ASP.NET the "include" function is performed with UserControls
(ascx). Perhaps if you could be more specific about what you mean by "include
an aspx file inside a script-block"? What is the goal here?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




[quoted text, click to view]
Re: how to include aspx without directive? Peter Rilling
1/31/2006 7:28:58 AM
I would just create a user control for the menu (.ascx) and then disable the
control (visible = false) when the condition is not met.

[quoted text, click to view]

Re: how to include aspx without directive? Juan T. Llibre
1/31/2006 11:32:48 AM
Franz,

Like Peter suggested, convert your menu.aspx file to a user control (menu.ascx).
Then, you'll be able to include it real easily.

Here's a tutorial which shows how to convert a web form into a user control :

http://msdn2.microsoft.com/en-us/library/2x6sx01c.aspx

Follow the directions in it and you'll be home free.




Juan T. Llibre
ASP.NET MVP
ASPNETFAQ.COM : http://www.aspnetfaq.com
==================================
[quoted text, click to view]

how to include aspx without directive? Franz
1/31/2006 10:54:34 PM
Hi,

I would like to include a aspx file inside a script-block, however, I don't
want to include that file by <!-- #include virtual="whateverfile" -->. How
can I do it?

Thanks.
Franz

Re: how to include aspx without directive? Franz
1/31/2006 11:23:24 PM
Peter,

I have to include a aspx file (a menu) inside a normal web page. However,
the menu is only included under some conditions.

<%
if (/* some condition */) {
%>
<!-- #include virtual="menu.aspx" -->
<%
}
%>

I want to make the above to the following.

<%
if (/* some condition */) {
Something.Include("Menu.aspx");
}
%>

Franz

"Peter Bromberg [C# MVP]" <pbromberg@yahoo.nospammin.com> ¼¶¼g©ó¶l¥ó·s»D:15A32669-4294-4ADC-A3BC-5B21F2361F3F@microsoft.com...
[quoted text, click to view]

Re: how to include aspx without directive? Franz
1/31/2006 11:55:23 PM
Thanks all of you.

"Juan T. Llibre" <nomailreplies@nowhere.com> ¼¶¼g©ó¶l¥ó·s»D:uzuFZunJGHA.524@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button