Adding a include statement in default.aspx - help !!

P

Priya Ghate

Hi

I have some code that is redundant in the default.aspx file. Is there a way in which I could keep the redundant code in a .aspx or .inc file and reference it from my default.aspx page of my main portal site ? Also if other subsites within the main portal sites want to access that file will they be able to do so ? Could someone point me to a code snippet or link on the web

Help will be highly appreciated

Thanks in advance
Priya
 
J

Jim Buyens

-----Original Message-----
Hi,
Howdy.

I have some code that is redundant in the default.aspx
file. Is there a way in which I could keep the redundant
code in a .aspx or .inc file and reference it from my
default.aspx page of my main portal site ? Also if other
subsites within the main portal sites want to access
that file will they be able to do so ? Could someone
point me to a code snippet or link on the web.

By "portal" do you mean Windows SharePoint Services?

If so, the best approach is to program your own Web Part,
and then add it to the global catalog for your SharePoint-
enabled server. Here are some places to start reading:

Creating a Basic Web Part
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/spptsdk/html/createabasicwp.asp

Building an Online Web Part Gallery
http://msdn.microsoft.com/library/en-
us/odc_sp2003_ta/html/sharepoint_buildinganonlinewebpartgal
lery.asp?frame=true

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
P

Priya Ghate

Thanks Jim for your reply. By "Portal" I mean, share point portal site. I
have created a team site. And I want to keep the code for the left
navigation as a seperate file that I could inculde in my default.aspx page.
Within my main portal site I have some sub sites as well. They also have the
same kind of left navigation code. That is the reason I wanted to seperate
out the common code and reference it using a include statement whereever I
needed. Also in the furture if I want to make changes to my left navigation
I would do it at one place itself.

So do u think this is possible by creating a webpart or can I go someother
way ?

let me know your thoughts on this ..

Thanks,
Priya
 
J

Jim Cheshire

A User Control is exactly what you should use. Very simple to create, and
reusable in any page in your application.

--
Jim Cheshire
Jimco Add-ins
http://www.jimcoaddins.com
===================================
Co-author of Special Edition
Using Microsoft FrontPage 2003
===================================
Our newest add-in:
FrontPage Cart Companion
http://www.frontpagecartcompanion.com


Priya Ghate said:
Hi,

I have some code that is redundant in the default.aspx file. Is there a
way in which I could keep the redundant code in a .aspx or .inc file and
reference it from my default.aspx page of my main portal site ? Also if
other subsites within the main portal sites want to access that file will
they be able to do so ? Could someone point me to a code snippet or link on
the web.
 
P

Priya Ghate

Hi Jim,

Could you please give me some info about how to create a User Control ? Any
code snippet or link to a website would do ..

Thanks,
Priya
 
J

Jim Buyens

Priya Ghate said:
Thanks Jim for your reply. By "Portal" I mean, share point portal site. I
have created a team site. And I want to keep the code for the left
navigation as a seperate file that I could inculde in my default.aspx page.
Within my main portal site I have some sub sites as well. They also have the
same kind of left navigation code. That is the reason I wanted to seperate
out the common code and reference it using a include statement whereever I
needed. Also in the furture if I want to make changes to my left navigation
I would do it at one place itself.

So do u think this is possible by creating a webpart or can I go some other
way?

This is near the edge of my expertise, but to the best of my
knowledge, yes, you would need to create a Web Part.

If all you want is a box with some hyperlinks in it, you might be able
to create a SharePoint list with the hyperlinks you want. This would
work very much like the Links Web part in an individual SharePoint
Team Site. But you would need SharePoint Portal Server to make the
same list of links available to multiple team sites.

To double-check all this, you should probably repost your question to
one of the SharePoint newsgroups.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
J

Jim Buyens

Priya Ghate said:
Thanks Jim for your reply. By "Portal" I mean, share point portal site. I
have created a team site. And I want to keep the code for the left
navigation as a seperate file that I could inculde in my default.aspx page.
Within my main portal site I have some sub sites as well. They also have the
same kind of left navigation code. That is the reason I wanted to seperate
out the common code and reference it using a include statement whereever I
needed. Also in the furture if I want to make changes to my left navigation
I would do it at one place itself.

So do u think this is possible by creating a webpart or can I go some other
way?

This is near the edge of my expertise, but to the best of my
knowledge, yes, you would need to create a Web Part.

If all you want is a box with some hyperlinks in it, you might be able
to create a SharePoint list with the hyperlinks you want. This would
work very much like the Links Web part in an individual SharePoint
Team Site. But you would need SharePoint Portal Server to make the
same list of links available to multiple team sites.

To double-check all this, you should probably repost your question to
one of the SharePoint newsgroups.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top