Ask a Question related to ASP, Design and Development.
-
Miguel Orrego #1
Include file
Hi,
Is there any way of having an include file as a string, eg:
<!--#include file="<%=strURL%>"-->
This doesn't seem to work, I get an error:
The include file '<%=strURL%>' was not found
Is my syntax wrong or isn't this possible?
Cheers.
Miguel Orrego Guest
-
Include a file
have been tried to develop a blog like the sample php & mysql. I make an include from list from toolbox: Url parameter value: admin_topics... -
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" -->... -
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... -
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... -
Evertjan. #2
Re: Include file
Miguel Orrego wrote on 15 jul 2003 in
microsoft.public.inetserver.asp.general:No, the include is executed before the asp-parsing,> Is there any way of having an include file as a string, eg:
>
> <!--#include file="<%=strURL%>"-->
>
so that asp contents of the include get parsed too.
Try server.execute
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan. Guest
-
Chris Barber #3
Re: Include file
Try google - ther are hundreds of hits for using Server.Execute.
[url]http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/windows2000/en/server/iis/htm/asp/vbob9pid.htm[/url]
Chris.
"Miguel Orrego" <miguel@stressedmonkey.net-nospam> wrote in message
news:3f13eb6a$0$15040$cc9e4d1f@news.dial.pipex.com ...> Thanks, could you show me some example code using server.execute ?
>
> Cheers.
>
> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> news:Xns93B98990DE90Ceejj99@194.109.133.29...>> > Miguel Orrego wrote on 15 jul 2003 in
> > microsoft.public.inetserver.asp.general:> >> > > Is there any way of having an include file as a string, eg:
> > >
> > > <!--#include file="<%=strURL%>"-->
> > >
> > No, the include is executed before the asp-parsing,
> > so that asp contents of the include get parsed too.
> >
> > Try server.execute
> >
> > --
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
>
Chris Barber Guest
-
Miguel Orrego #4
Re: Include file
Sorry, I'm lying, the images were in the same folder as the page I was
calling.
I've now put copies of those images into the same folder as the page I'm
calling from and that seems to have fixed it.
Strange though that it wouldn't work with the images left as they are.
Cheers.
"Miguel Orrego" <miguel@stressedmonkey.net-nospam> wrote in message
news:3f13fc59$0$15041$cc9e4d1f@news.dial.pipex.com ...be> Great, that seems to have acheived what I want, but only halfway.
>
> When calling a file that has images, the images don't show, just get the
> usual box with a cross as you would get when the image file is not found.
> The images are there, but the path to them from the called document wouldin> ../images/image1.jpg etc. Would this have an impact? Should the images be> the same folder as the called document? Is there a way around this?
>
> Cheers.
>
> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> news:Xns93B98EF7627A1eejj99@194.109.133.29...>> > Miguel Orrego wrote on 15 jul 2003 in
> > microsoft.public.inetserver.asp.general:> >> > > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> > > news:Xns93B98990DE90Ceejj99@194.109.133.29...
> > >> Miguel Orrego wrote on 15 jul 2003 in
> > >> microsoft.public.inetserver.asp.general:
> > >> > Is there any way of having an include file as a string, eg:
> > >> >
> > >> > <!--#include file="<%=strURL%>"-->
> > >> >
> > >>
> > >> No, the include is executed before the asp-parsing,
> > >> so that asp contents of the include get parsed too.
> > >>
> > >> Try server.execute
> > > Thanks, could you show me some example code using server.execute ?
> > <%
> > myurl = "/myfile.asp"
> > server.execute myurl
> > %>
> >
> > not tested
> >
> > --
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
>
Miguel Orrego Guest
-
Evertjan. #5
Re: Include file
Miguel Orrego wrote on 15 jul 2003 in
microsoft.public.inetserver.asp.general:
[please interpost and topquote]> Sorry, I'm lying, the images were in the same folder as the page I was
> calling.
>
> I've now put copies of those images into the same folder as the page I'm
> calling from and that seems to have fixed it.
>
> Strange though that it wouldn't work with the images left as they are.
>
No, not strange, the relative path probably changes to the calling page
with response execute.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan. Guest
-
JH #6
Include file
I'm new in the .NET world, so sorry if this is a faq. In classic ASP I
often use a include file with some standard functions, ex. formating a
string an so. How do a do this i .NET ??
In my test code below, I submit a form with a textbox, use the
function "format_string" to change the value. I would like to use this
function in other scripts also, so need to place the code in another
file, and include it, how ?
I'll appreciate if someone could change my test code, to show me the
right way to do it.
Thx..
test.aspx
------------------
<%@ page language="vb" inherits="test" src="test.vb" %>
<html>
<head>
</head>
<body>
<form id="test" method="post" runat="server">
<asp:textbox id="sometext" text="" runat="server" />
<asp:button id="submit" text="submit" onclick="test_me"
runat="server" />
</form>
</body>
</html>
------------------
test.vb
------------------
Imports System
Imports System.Web.UI
public class test : inherits page
sub test_me(ByVal Sender As Object, ByVal E As EventArgs)
dim sometext as string
sometext = format_string(Request.Form("sometext"))
end sub
function format_string(value as string) as string
return "!" & value & "!"
end function
end class
------------------
JH Guest
-
Hugo Wetterberg #7
Re: Include file
The easiest way would be to make some utility classes.
public class StringUtilities
{
public static string FormatString(string s)
{
string result;
//Do something
return result;
}
}
And then in the code-behind you just use the class:
private void Page_Load(...)
{
string s="Hello 123";
s=StringUtilities.FormatString(s);
}
I hope this helps
Hugo
Hugo Wetterberg Guest
-
Ravikanth[MVP] #8
Include file
Hi
Check out the following articles, which tells about How
to include files in aspx.
[url]http://www.csharpfriends.com/Articles/getArticle.aspx?[/url]
articleID=9
[url]http://www.aspalliance.com/stevesmith/articles/includelets[/url]
..asp
Ravikanth
classic ASP I>-----Original Message-----
>I'm new in the .NET world, so sorry if this is a faq. Inex. formating a>often use a include file with some standard functions,use the>string an so. How do a do this i .NET ??
>
>In my test code below, I submit a form with a textbox,like to use this>function "format_string" to change the value. I wouldcode in another>function in other scripts also, so need to place theshow me the>file, and include it, how ?
>
>I'll appreciate if someone could change my test code, toonclick="test_me">right way to do it.
>
>Thx..
>
>
>
>test.aspx
>------------------
><%@ page language="vb" inherits="test" src="test.vb" %>
><html>
> <head>
> </head>
>
> <body>
> <form id="test" method="post" runat="server">
> <asp:textbox id="sometext" text="" runat="server" />
> <asp:button id="submit" text="submit"EventArgs)>runat="server" />
> </form>
> </body>
></html>
>------------------
>
>
>test.vb
>------------------
>Imports System
>Imports System.Web.UI
>
>public class test : inherits page
> sub test_me(ByVal Sender As Object, ByVal E As> dim sometext as string
> sometext = format_string(Request.Form("sometext"))
> end sub
>
> function format_string(value as string) as string
> return "!" & value & "!"
> end function
>end class
>------------------
>
>.
>Ravikanth[MVP] Guest
-
JH #9
Re: Include file
> The easiest way would be to make some utility classes.
Thanks for your reply.... I like the idea with a "utility class".
I put this code in ex. "StringUtilities.vb", and place it in a shared
include-folder
----------> public class StringUtilities
> {
> public static string FormatString(string s)
> {
> string result;
>
> //Do something
> return result;
> }
> }
How do my codebehind code (test.vb) know about the class
"StringUtilities" ??
----------> private void Page_Load(...)
> {
> string s="Hello 123";
> s=StringUtilities.FormatString(s);
> }
JH Guest
-
Hugo Wetterberg #10
Re: Include file
On Thu, 24 Jul 2003 11:14:00 GMT, JH <003___remove___@email.dk> wrote:
Everything is compiled into a single dll if it resides in the same
project. All the classes and pages can use functions from each other.
I've sent another post with what I think is the VB equivalent of what
I posted in my first reply.
>>> The easiest way would be to make some utility classes.
>Thanks for your reply.... I like the idea with a "utility class".
>
>
>I put this code in ex. "StringUtilities.vb", and place it in a shared
>include-folder
>----->----->> public class StringUtilities
>> {
>> public static string FormatString(string s)
>> {
>> string result;
>>
>> //Do something
>> return result;
>> }
>> }
>
>How do my codebehind code (test.vb) know about the class
>"StringUtilities" ??
>----->----->> private void Page_Load(...)
>> {
>> string s="Hello 123";
>> s=StringUtilities.FormatString(s);
>> }Hugo Wetterberg Guest
-
Hugo Wetterberg #11
Re: Include file
On Thu, 24 Jul 2003 11:14:00 GMT, JH <003___remove___@email.dk> wrote:
Sorry here's the post I should have sent before:
Saw that you are using VB, but it should be the same principle.
Separate the format string subroutine from the page and put it in a
class:
public class StringUtilities
public static function format_string(value as string) as string
return "!" & value & "!"
end function
end class
then change sub test_me to:
sub test_me(ByVal Sender As Object, ByVal E As EventArgs)
dim sometext as string
sometext = StringUtilities.format_string(Request.Form("somete xt"))
end sub
Something like that anyway.
Cheers, Hugo
Hugo Wetterberg Guest
-
joe #12
Re: Include file
Do you (can you) place these utility classes in a separate code file where
they will be available to all parts of the application and reusable in other
applications? If so what type (extension) of file do you create?
thanks
"Hugo Wetterberg" <hugo@wetterberg.com> wrote in message
news:b1hvhvo7fl5mia86a8qsmvk98phumdnjot@4ax.com...> On Thu, 24 Jul 2003 11:14:00 GMT, JH <003___remove___@email.dk> wrote:
>
> Sorry here's the post I should have sent before:
>
> Saw that you are using VB, but it should be the same principle.
> Separate the format string subroutine from the page and put it in a
> class:
>
> public class StringUtilities
>
> public static function format_string(value as string) as string
> return "!" & value & "!"
> end function
>
> end class
>
> then change sub test_me to:
>
> sub test_me(ByVal Sender As Object, ByVal E As EventArgs)
> dim sometext as string
> sometext = StringUtilities.format_string(Request.Form("somete xt"))
> end sub
>
> Something like that anyway.
> Cheers, Hugo
joe Guest
-
Hugo Wetterberg #13
Re: Include file
On Thu, 24 Jul 2003 07:55:21 -0400, "joe"
<contact_by_Newsgroup_only.please> wrote:
Yes. That is the beauty with .net. Start a new class library project
(or set the compilation target to library). The output from
compilation will be a dll that you can reference to from your other
projects.
>Do you (can you) place these utility classes in a separate code file where
>they will be available to all parts of the application and reusable in other
>applications? If so what type (extension) of file do you create?
>
>thanks
>
>
>
>
>"Hugo Wetterberg" <hugo@wetterberg.com> wrote in message
>news:b1hvhvo7fl5mia86a8qsmvk98phumdnjot@4ax.com.. .>>> On Thu, 24 Jul 2003 11:14:00 GMT, JH <003___remove___@email.dk> wrote:
>>
>> Sorry here's the post I should have sent before:
>>
>> Saw that you are using VB, but it should be the same principle.
>> Separate the format string subroutine from the page and put it in a
>> class:
>>
>> public class StringUtilities
>>
>> public static function format_string(value as string) as string
>> return "!" & value & "!"
>> end function
>>
>> end class
>>
>> then change sub test_me to:
>>
>> sub test_me(ByVal Sender As Object, ByVal E As EventArgs)
>> dim sometext as string
>> sometext = StringUtilities.format_string(Request.Form("somete xt"))
>> end sub
>>
>> Something like that anyway.
>> Cheers, HugoHugo Wetterberg Guest
-
Simon #14
Include file
Hi,
I have one question:
I used to do a lot with asp and now I'm going to use asp.net technology
In asp I had a file functions.asp with all my functions I used on several
pages like generating connection to database, generating links on pages and
things like that.
Than I had <!-- #include file="..\include\functions.asp"--> statement on
each asp page, at the top of the page.
I would like to know, how is this in asp.net
You use the same procedure or is there some other, better way to include
functions?
I read one book but I didn't found any instructions?
Can someone explain me how this is practice in asp.net?
Thank you,
Simon
Simon Guest
-
Evertjan. #15
Re: Include file
Simon wrote on 24 okt 2003 in microsoft.public.inetserver.asp.general:
As this is a classical ASP NG,> I would like to know, how is this in asp.net [..]
> Can someone explain me how this is practice in asp.net?
please ask a dotnet group.
It's overthere! [sorry William] ;-)
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan. Guest
-
Simon #16
Re: Include file
hi,
do you know the addres of asp net group?
I didn't find any. I only found microsoft.public.dotnet.general
which is more for windows applications.
Thank you,
Simon
"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns941E6458138C9eejj99@194.109.133.29...> Simon wrote on 24 okt 2003 in microsoft.public.inetserver.asp.general:>> > I would like to know, how is this in asp.net [..]
> > Can someone explain me how this is practice in asp.net?
> As this is a classical ASP NG,
>
> please ask a dotnet group.
>
> It's overthere! [sorry William] ;-)
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Simon Guest
-
Evertjan. #17
Re: Include file
Simon wrote on 24 okt 2003 in microsoft.public.inetserver.asp.general:
[Please do not toppost on usenet]> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> news:Xns941E6458138C9eejj99@194.109.133.29...> do you know the addres of asp net group?>> Simon wrote on 24 okt 2003 in microsoft.public.inetserver.asp.general:>>>> > I would like to know, how is this in asp.net [..]
>> > Can someone explain me how this is practice in asp.net?
>> As this is a classical ASP NG,
>>
>> please ask a dotnet group.
>>
> I didn't find any. I only found microsoft.public.dotnet.general
> which is more for windows applications.
microsoft.public.dotnet.framework.aspnet
and others
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan. Guest
-
+FarmerPickles #18
include file
Dumb question, but how do you use an include file from another foler on the
web? like using a forminfo.asp where that file exist in a forms folder>
<!--#INCLUDE FILE="Forum/default.asp
"-->
doesnt work.. <!--#INCLUDE FILE="../Forum/default.asp
"-->
doesnt work <!--#INCLUDE FILE="http://myweb.com/Forum/default.asp
"-->
doesnt work. any suggestions?
Thanks
Jeff
+FarmerPickles Guest
-
Franco Figun #19
Re: include file
<!--#INCLUDE VIRTUAL="..\Forum\default.asp"-->
--
FF
[url]www.francofigun.com.ar[/url]
[url]www.microsofties.com.ar[/url]
MSN: [email]francofigun@hotmail.com[/email]
UIN: 305336919
Yahoo MSN: [email]frankofm@yahoo.com.ar[/email]
"+FarmerPickles" <gig_bam_takemeout_@verizon.net> escribió en el mensaje
news:%23lrZNQCUEHA.2940@TK2MSFTNGP09.phx.gbl...the> Dumb question, but how do you use an include file from another foler on> web? like using a forminfo.asp where that file exist in a forms folder>
> <!--#INCLUDE FILE="Forum/default.asp
> "-->
> doesnt work.. <!--#INCLUDE FILE="../Forum/default.asp
> "-->
> doesnt work <!--#INCLUDE FILE="http://myweb.com/Forum/default.asp
> "-->
> doesnt work. any suggestions?
> Thanks
> Jeff
>
>
Franco Figun Guest
-
+FarmerPickles #20
Re: include file
thanks a bunch!!
"Franco Figun" <franfig@fibertel.com.ar> wrote in message
news:%23J5GTcCUEHA.3420@TK2MSFTNGP09.phx.gbl...> <!--#INCLUDE VIRTUAL="..\Forum\default.asp"-->
>
>
> --
> FF
> [url]www.francofigun.com.ar[/url]
> [url]www.microsofties.com.ar[/url]
> MSN: [email]francofigun@hotmail.com[/email]
> UIN: 305336919
> Yahoo MSN: [email]frankofm@yahoo.com.ar[/email]
> "+FarmerPickles" <gig_bam_takemeout_@verizon.net> escribió en el mensaje
> news:%23lrZNQCUEHA.2940@TK2MSFTNGP09.phx.gbl...> the> > Dumb question, but how do you use an include file from another foler on>> > web? like using a forminfo.asp where that file exist in a forms folder>
> > <!--#INCLUDE FILE="Forum/default.asp
> > "-->
> > doesnt work.. <!--#INCLUDE FILE="../Forum/default.asp
> > "-->
> > doesnt work <!--#INCLUDE FILE="http://myweb.com/Forum/default.asp
> > "-->
> > doesnt work. any suggestions?
> > Thanks
> > Jeff
> >
> >
>
+FarmerPickles Guest



Reply With Quote

