Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

template for newsletter
I need to create a template for an online newsletter that will auto-generate
page number (with current page not hyperlinked) and previous and next
buttons (no previous on first page and no next on last page).

Does anyone know of any quick asp code that will do this?  I don't think
that it'd be too hard to do, but I'm very new at asp.

Basically at the top of the page, I'll have a back and next button and on
the bottom of the page I'll have the word it set up sort of like this:

Previous                  page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Contents
Next

I have a template setup in dreamweaver that has edit zones for all of those
now, but I'd like to just have one edit zone, the main content of the page,
and have the rest auto-generated from asp code so that if the page design
needs to be changed at all...  it's easy to just change the template and
have it applied to all the pages.

--
Posted 'as is'.  If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley



Report this thread to moderator Post Follow-up to this message
Old Post
Mike Brearley
12-20-04 08:55 PM


Re: template for newsletter
http://www.juicystudio.com/tutorial/asp/paging.asp



Report this thread to moderator Post Follow-up to this message
Old Post
Gérard Leclercq
12-20-04 08:55 PM


Re: template for newsletter
Is there a way to do it without a database?  The content includes images and
special formatting so it appears as it did in the original print.

--
Posted 'as is'.  If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley

"Gérard Leclercq" <gerard.leclercq@pas-de-mail.fr> wrote in message
news:%4Dxd.5402$y47.232563@phobos.telenet-ops.be...
> http://www.juicystudio.com/tutorial/asp/paging.asp
>



Report this thread to moderator Post Follow-up to this message
Old Post
Mike Brearley
12-20-04 08:55 PM


Re: template for newsletter
On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <nospam@spam.com>
wrote:

>Is there a way to do it without a database?  The content includes images an
d
>special formatting so it appears as it did in the original print.

How do you know where the page breaks are?  Okay, now that *you* know,
how are you going to explain that to the computer...?  :)

You can likely accomplish your task with the proper use of
stylesheets, try a CSS group or DHTL/HTML group for details.

Jeff

Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Cochran
12-21-04 01:55 AM


Re: template for newsletter
"Jeff Cochran" <jeff.nospam@zina.com> wrote in message
news:41c76012.418802155@msnews.microsoft.com...
> On Mon, 20 Dec 2004 13:02:20 -0500, "Mike Brearley" <nospam@spam.com>
> wrote:
> 
>
> How do you know where the page breaks are?  Okay, now that *you* know,
> how are you going to explain that to the computer...?  :)
>
> You can likely accomplish your task with the proper use of
> stylesheets, try a CSS group or DHTL/HTML group for details.
>
> Jeff

Page breaks are irrelivent...  This isn't a typical enter text into database
and get a newspage from it.  It's something that needs to be layed out
exactly as it is on paper.  We're creating each page, but want the outer
areas (navigation, background, etc...) to be controlled by a template.  No
database files....

Maybe I need to find a dreamweaver group as we're using dreamweaver
templates for this...

--
Posted 'as is'.  If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley



Report this thread to moderator Post Follow-up to this message
Old Post
Mike Brearley
12-21-04 08:55 AM


Re: template for newsletter
I need to know how do I (in asp) I have it see how many pages named exactly
as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
bottom that has:

Previous      page 1 | 2 | 3 | 4 | 5 | 6 | Contents        Next

The page your on won't be hyperlinked, but the rest are and the last page
doesn't have the next button.

This isn't for a newsletter where the text in entered in a database.  We'll
actually be coding the context in each page, but I want all the rest to be
controlled by a template so it's easier for us down the road if we decide to
change the layout and so that we can just slap the content in without
worrying about the navigation.

--
Posted 'as is'.  If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley



Report this thread to moderator Post Follow-up to this message
Old Post
Mike Brearley
12-21-04 08:55 AM


Re: template for newsletter
Are you manually splitting the pages? If so, you can do this with script, if
each page contains some identifier of this. In asp.net you have a form with
the runat="server" attribute. You could put in this two hidden inputs. Then,
so these are picked up by your asp.net script, you also give them
runat="server" attributes and an appropriate id (eg. "page_no" and
"total_pages"). Then the templates can also contain server script which look
for these two attributes.

HTH,
ME

--
Martin Eyles
martin.eyles@NOSPAM.bytronic.com

"Mike Brearley" <mike_brearleyNOSPAM@DONTDOIT.hotmail.com> wrote in message
news:OMBrwRw5EHA.4072@TK2MSFTNGP10.phx.gbl...
> I need to know how do I (in asp) I have it see how many pages named
exactly
> as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
> bottom that has:
>
> Previous      page 1 | 2 | 3 | 4 | 5 | 6 | Contents        Next
>
> The page your on won't be hyperlinked, but the rest are and the last page
> doesn't have the next button.
>
> This isn't for a newsletter where the text in entered in a database.
We'll
> actually be coding the context in each page, but I want all the rest to be
> controlled by a template so it's easier for us down the road if we decide
to
> change the layout and so that we can just slap the content in without
> worrying about the navigation.
>
> --
> Posted 'as is'.  If there are any spelling and/or grammar mistakes, they
> were a direct result of my fingers and brain not being synchronized or my
> lack of caffeine.
>
> Mike Brearley
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Martin Eyles
12-21-04 08:55 PM


Re: template for newsletter
Mike Brearley wrote:
> I need to know how do I (in asp) I have it see how many pages named
> exactly as page1.asp, page2.asp, etc.... exist and put a bottom nav
> bar on the bottom that has:
>
> Previous      page 1 | 2 | 3 | 4 | 5 | 6 | Contents        Next
>
> The page your on won't be hyperlinked, but the rest are and the last
> page doesn't have the next button.
>
> This isn't for a newsletter where the text in entered in a database.
> We'll actually be coding the context in each page, but I want all the
> rest to be controlled by a template so it's easier for us down the
> road if we decide to change the layout and so that we can just slap
> the content in without worrying about the navigation.

I'm not sure this buys you a whole lot, since you are working with a fixed
set of script names, but...

...you can construct an include (or executable script) that examines an
array of script names against the current script. For example, you could
create a document like this -- let's call it paging.js.asp:

<%@ Language=JScript %><%
var links = new Array("default.asp","page1.asp","page2.asp", ...),
script = Request.ServerVariables("SCRIPT_NAME"),
r = previous = next = null,
a = new Array()

for (var i=0; i<links.length; i++) {
r = new RegExp(links[i],"i")
if (r.test(script)) {
a.push(i+1)
if (i>0) previous = links[i-1]
if (i<links.length-1) next = links[i+1]
} else {
a.push("<a href=\"" + links[i] + "\">" + (i+1) + "</a>")
}
}

if (previous)
Response.Write("<a href=\"" + previous + "\">Previous</a> ")
Response.Write(a.join(" | "))
if (next) Response.Write(" <a href=\"" + next + "\">Next</a>")
%>

Then you can insert the numbering scheme anywhere in your document with:

<% Server.Execute("paging.js.asp") %>

Note that it makes no difference what ASP language you use in the calling
script.




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.



Report this thread to moderator Post Follow-up to this message
Old Post
Dave Anderson
12-21-04 08:55 PM


Re: template for newsletter
On Mon, 20 Dec 2004 21:26:11 -0500, "Mike Brearley"
<mike_brearleyNOSPAM@DONTDOIT.hotmail.com> wrote:

>I need to know how do I (in asp) I have it see how many pages named exactly
>as page1.asp, page2.asp, etc.... exist and put a bottom nav bar on the
>bottom that has:
>
>Previous      page 1 | 2 | 3 | 4 | 5 | 6 | Contents        Next
>
>The page your on won't be hyperlinked, but the rest are and the last page
>doesn't have the next button.
>
>This isn't for a newsletter where the text in entered in a database.  We'll
>actually be coding the context in each page, but I want all the rest to be
>controlled by a template so it's easier for us down the road if we decide t
o
>change the layout and so that we can just slap the content in without
>worrying about the navigation.

This is better done client-side in a Javascript navigation script, but
you could script it server side if needed. A quick Google showed this
example:

http://www.aspin.com/func/content?t...iten&id=5412810

Jeff

Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Cochran
12-22-04 08:55 AM


Re: template for newsletter
Javascript navigation script works for me...  any good examples out there?

Also, please note, I'm breaking the pages apart myself (no database), I just
need the navigation script for a template object so that I don't have to
code it (granted just copy/paste) everytime I create a page.

--
Posted 'as is'.  If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike Brearley

"Jeff Cochran" <jeff.nospam@zina.com> wrote in message
news:41cae277.517714894@msnews.microsoft.com...
> On Mon, 20 Dec 2004 21:26:11 -0500, "Mike Brearley"
> <mike_brearleyNOSPAM@DONTDOIT.hotmail.com> wrote:
> 
>
> This is better done client-side in a Javascript navigation script, but
> you could script it server side if needed. A quick Google showed this
> example:
>
> http://www.aspin.com/func/content?t...iten&id=5412810
>
> Jeff



Report this thread to moderator Post Follow-up to this message
Old Post
Mike Brearley
12-23-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:13 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.