Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Shailesh Patel #1
usercontrol with include file
Hi,
I put include file in usercontrol and use this UC in another aspx page.
However, aspx file writes <!-- #include virtual="/fres/fues.htm" --> in aspx
file but did not display content of include file.
I would like to know how to do this?
Thank you.
Shailesh
Shailesh Patel Guest
-
Strange Include problems: Repeat regions will Not workwith include file
I have a strange problem. I have an Index.asp page and on that page I have a poll that is displays. This poll is located in a sub folder, so to call... -
Event not firing in usercontrol inside usercontrol
I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these... -
proper way to include constants; as module or include file?
I am developing a new perl module that uses constants with regular expressions. What is the proper way to offer this file? For example, my perl... -
Can you share a code behind file with a page and usercontrol?
Tying not to spaghetti code which seems to be easy to do in .net, im trying to do my main .net html in index.aspx, use repeated .net html in an... -
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack
a uscontrol test.ascx have a dropdownlist web control the dropdownlist's AutoPostBack property is set "true" but when i use... -
Brennan Stehling #2
Re: usercontrol with include file
Shailesh,
I have not see that include syntax in ASP.NET as it was in classic ASP.
If I wanted to include static content within a ASPX page, I would do
this...
1) Create a User Control called Include.ascx
2) Add a Literal control to that User Control
3) Add a Property to the code-behind called Virtual or File as a String
4) For the Load handler, I would read the contents of that file and set
the Text property of the Literal control
That would bring the contents of that control into your page. In the
ASPX page, you would reference the User Control like...
<uc1:Include ID="Include1" runat="server" Virtual="~/file.html" />
And to speed things up a little, I would use System.Web.Caching to hold
the contents of the file with a dependency on the referenced file.
Once you have this User Control you can use it for any website you
build.
Brennan Stehling
[url]http://brennan.offwhite.net/blog/[/url]
Shailesh Patel wrote:> Hi,
>
> I put include file in usercontrol and use this UC in another aspx page.
> However, aspx file writes <!-- #include virtual="/fres/fues.htm" --> in aspx
> file but did not display content of include file.
> I would like to know how to do this?
>
> Thank you.
>
> ShaileshBrennan Stehling Guest
-
Brennan Stehling #3
Re: usercontrol with include file
Shailesh,
I thought this was interesting so I created a sample ASP.NET 2.0
website with the User Control I described here.
You can download it here.
[url]http://brennan.offwhite.net/downloads/IncludeWebsite.zip[/url]
Brennan Stehling
[url]http://brennan.offwhite.net/blog/[/url]
Shailesh Patel wrote:> Hi,
>
> I put include file in usercontrol and use this UC in another aspx page.
> However, aspx file writes <!-- #include virtual="/fres/fues.htm" --> in aspx
> file but did not display content of include file.
> I would like to know how to do this?
>
> Thank you.
>
> ShaileshBrennan Stehling Guest
-
Shailesh Patel #4
Re: usercontrol with include file
Hi Brennan,
I tried to download file and gives me
"End-of-central-directory signature not found. Either this file is not a Zip
file, or it constitutes one disk of a multi-part Zip file."
while unzipping.
But I got your point and try it.
Thank you.
"Brennan Stehling" <offwhite@gmail.com> wrote in message
news:1161890061.433864.276980@e3g2000cwe.googlegro ups.com...> Shailesh,
>
> I thought this was interesting so I created a sample ASP.NET 2.0
> website with the User Control I described here.
>
> You can download it here.
>
> [url]http://brennan.offwhite.net/downloads/IncludeWebsite.zip[/url]
>
> Brennan Stehling
> [url]http://brennan.offwhite.net/blog/[/url]
>
> Shailesh Patel wrote:>>> Hi,
>>
>> I put include file in usercontrol and use this UC in another aspx page.
>> However, aspx file writes <!-- #include virtual="/fres/fues.htm" --> in
>> aspx
>> file but did not display content of include file.
>> I would like to know how to do this?
>>
>> Thank you.
>>
>> Shailesh
Shailesh Patel Guest



Reply With Quote

