473,411 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

ASP.NET question

Is there a separate ASP.NET newsgroup? I can't find one, and I don't
know if it's appropriate here, but I figure it's still written in C# so
it's all the same thing anyway.

I'm just wondering how I might write something that inserts a "Home"
icon wherever I put the code. In other words, instead of putting a
separate icon on each page, so that I'd have to change them all if I
wanted a different icon, is there a way to make one 'file' or 'link' or
whatever you'd call it that I can put on my page, and I just change one
thing to change the image? I'm guessing I could use ASP.NET for this,
but I have no experience with it so I'm not too sure what it even does.
I'm only familiar with Windows programming so far.
Nov 17 '05 #1
7 1032

"John Salerno" wrote...
Is there a separate ASP.NET newsgroup? I can't find one, and I don't know if it's appropriate
here, but I figure it's still written in C# so it's all the same thing
anyway.
Well, both yes and no.

I think this particular question rather belongs to a more specific ASP.NET
group, or possibly even an even more generic one.

To give an example:

microsoft.public.dotnet.framework.aspnet

.... ;-)

I'm just wondering how I might write something that inserts a "Home" icon
wherever I put the code. In other words, instead of putting a separate
icon on each page, so that I'd have to change them all if I wanted a
different icon, is there a way to make one 'file' or 'link' or whatever
you'd call it that I can put on my page, and I just change one thing to
change the image? I'm guessing I could use ASP.NET for this, but I have no
experience with it so I'm not too sure what it even does. I'm only
familiar with Windows programming so far.


I don't even see this as an ASP.NET question, but rather an SSI question
(Server-Side Includes), which isn't confined to only ASP.NET, but works on
rather many webservers, not only IIS.

An example on what you can put into the pages (in "HTML-mode"):

<!--#include file="homelink.inc"-->

Then you can simply change the contents of that file when you need to, e.g.:

In homelink.inc:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>
// Bjorn A
Nov 17 '05 #2
Bjorn suggest a very easy solution that might work for you, but you still
need to have that line inserted in every page. The object way would be to
create a user control and add that to each page through some form of master
page template - much easier with .net 2.0.

As an alternative, look at ihttpmodules and insert the link in the page as
the response is pipelined to the browser, that way you dont insert it
anywhere manually and the runtime adds it at delivery time.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Bjorn Abelli" <bj**********@DoNotSpam.hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl...

"John Salerno" wrote...
Is there a separate ASP.NET newsgroup?

I can't find one, and I don't know if it's appropriate
here, but I figure it's still written in C# so it's all the same thing
anyway.


Well, both yes and no.

I think this particular question rather belongs to a more specific ASP.NET
group, or possibly even an even more generic one.

To give an example:

microsoft.public.dotnet.framework.aspnet

... ;-)

I'm just wondering how I might write something that inserts a "Home" icon
wherever I put the code. In other words, instead of putting a separate
icon on each page, so that I'd have to change them all if I wanted a
different icon, is there a way to make one 'file' or 'link' or whatever
you'd call it that I can put on my page, and I just change one thing to
change the image? I'm guessing I could use ASP.NET for this, but I have
no experience with it so I'm not too sure what it even does. I'm only
familiar with Windows programming so far.


I don't even see this as an ASP.NET question, but rather an SSI question
(Server-Side Includes), which isn't confined to only ASP.NET, but works on
rather many webservers, not only IIS.

An example on what you can put into the pages (in "HTML-mode"):

<!--#include file="homelink.inc"-->

Then you can simply change the contents of that file when you need to,
e.g.:

In homelink.inc:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>
// Bjorn A

Nov 17 '05 #3
Bjorn Abelli wrote:
is as an ASP.NET question, but rather an SSI question
(Server-Side Includes), which isn't confined to only ASP.NET, but works on
rather many webservers, not only IIS.

An example on what you can put into the pages (in "HTML-mode"):

<!--#include file="homelink.inc"-->

Then you can simply change the contents of that file when you need to, e.g.:

In homelink.inc:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>


Yeah, I wasn't sure if ASP.NET would really do this kind of thing
anyway. SSI and CSS were both suggested to me, but I have no experience
with SSI. I thought I might try it in PHP, but that's when I figured I
could use ASP.NET as well.

But as far as SSI goes, all I have to do is include that line? And what
exactly goes in that file? I've never seen an .inc extension. Could it
be any extension, such as a gif for the image I want to use?
Nov 17 '05 #4
Never give an include file a .inc extension, give it an .asp extension. A
file with a .inc extension will render like a text file in your browser
exposing the code if it were called directly.

--

Derek Davis
dd******@gmail.com

"Bjorn Abelli" <bj**********@DoNotSpam.hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP12.phx.gbl...

"John Salerno" wrote...
Is there a separate ASP.NET newsgroup?

I can't find one, and I don't know if it's appropriate
here, but I figure it's still written in C# so it's all the same thing
anyway.


Well, both yes and no.

I think this particular question rather belongs to a more specific ASP.NET
group, or possibly even an even more generic one.

To give an example:

microsoft.public.dotnet.framework.aspnet

... ;-)

I'm just wondering how I might write something that inserts a "Home" icon
wherever I put the code. In other words, instead of putting a separate
icon on each page, so that I'd have to change them all if I wanted a
different icon, is there a way to make one 'file' or 'link' or whatever
you'd call it that I can put on my page, and I just change one thing to
change the image? I'm guessing I could use ASP.NET for this, but I have
no experience with it so I'm not too sure what it even does. I'm only
familiar with Windows programming so far.


I don't even see this as an ASP.NET question, but rather an SSI question
(Server-Side Includes), which isn't confined to only ASP.NET, but works on
rather many webservers, not only IIS.

An example on what you can put into the pages (in "HTML-mode"):

<!--#include file="homelink.inc"-->

Then you can simply change the contents of that file when you need to,
e.g.:

In homelink.inc:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>
// Bjorn A

Nov 17 '05 #5
"John Salerno" wrote...
Bjorn Abelli wrote: is as an ASP.NET question, but rather an SSI question
(Server-Side Includes), which isn't confined to only ASP.NET, but works
on rather many webservers, not only IIS.

An example on what you can put into the pages (in "HTML-mode"):

<!--#include file="homelink.inc"-->

Then you can simply change the contents of that file when you need to,
e.g.:

In homelink.inc:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>
Yeah, I wasn't sure if ASP.NET would really do this kind of thing anyway.
SSI and CSS were both suggested to me, but I have no experience with SSI.
I thought I might try it in PHP, but that's when I figured I could use
ASP.NET as well.

But as far as SSI goes, all I have to do is include that line?


Yes.
And what exactly goes in that file?
Something that otherwise would have gotten into your HTML- or ASPX-file.

If it's something that you frequently use in many pages, it's a good idea to
have it in a separate file to make updates on, instead of the need to update
all pages where that particular code goes. In my example it contained only
one single line:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>
I've never seen an .inc extension. Could it be any extension, such as a
gif for the image I want to use?


Nope. It need to be text, as I illustrated above.

But as another poster suggested, it could be a good idea to *not* use ".inc"
as extension, use .asp or .aspx, depending on how you intended to include
the "homelink" in the first place.

<!--#include file="homelink.asp"-->
// Bjorn A
Nov 17 '05 #6

"carion1" wrote...
Never give an include file a .inc extension, give it an .asp
extension. A file with a .inc extension will render like a
text file in your browser exposing the code if it were called directly.


If it's code that otherwise would go into an asp- or aspx-page, I agree.

But if it's plain HTML, I personally like to use an extension easily
separated from other extensions.

Such content will be exposed to the browser anyway...

// Bjorn A
Nov 17 '05 #7
Bjorn Abelli wrote:
"John Salerno" wrote...

Bjorn Abelli wrote:


is as an ASP.NET question, but rather an SSI question
(Server-Side Includes), which isn't confined to only ASP.NET, but works
on rather many webservers, not only IIS.

An example on what you can put into the pages (in "HTML-mode"):

<!--#include file="homelink.inc"-->

Then you can simply change the contents of that file when you need to,
e.g.:

In homelink.inc:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>


Yeah, I wasn't sure if ASP.NET would really do this kind of thing anyway.
SSI and CSS were both suggested to me, but I have no experience with SSI.
I thought I might try it in PHP, but that's when I figured I could use
ASP.NET as well.

But as far as SSI goes, all I have to do is include that line?

Yes.

And what exactly goes in that file?

Something that otherwise would have gotten into your HTML- or ASPX-file.

If it's something that you frequently use in many pages, it's a good idea to
have it in a separate file to make updates on, instead of the need to update
all pages where that particular code goes. In my example it contained only
one single line:

<a href="default.aspx"><img alt="Home" src="home.gif"></a>
I've never seen an .inc extension. Could it be any extension, such as a
gif for the image I want to use?

Nope. It need to be text, as I illustrated above.


Actually, I meant could I use it to display a gif, like your example
did, which I should have noticed earlier!
Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.