By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

In Visual Basic 2008 create aspx web pages programmatically

P: n/a
I am working with Visual Studio or alternately with Expression Web. I need
to create about 50 aspx pages with about 1200 thumbnali images, typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.

Can anybody point me to locations in MSDN or elsewhere giving the references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?

I have done equivalent things with Excel where the corresponding references
workboook & worksheet commands, etc, are widely available.

Any direction would be appreciated.

Peter K

Jul 11 '08 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Peter K wrote:
I am working with Visual Studio or alternately with Expression Web.
I need to create about 50 aspx pages with about 1200 thumbnali
images, typically arranged in three to four groups per page, having
hyperlinks to the corresponding full size images.

Any direction would be appreciated.
If it's just a case of presenting an entire folder full of images one page
at a time, you should be able to do that with two pages: one for the
thumbnails and one for the preview.

Thumbnails page:
Read the content of the thumbnail images folder and make a <tablefrom a
suitable number of them.
Include prev/next page links which have URLs which post back to the
thumbnail page with the page number in, for choosing which set of thumbnails
to put in the <table>
Give each thumbnail an <ato the preview page, include the image reference
in the URL so the preview page can put the appropriate src= in the <img>
element.

Preview page:
Get the image's filename from Request.QueryString("whateverYouCalledIt")

If the sets of thumbnails are to be distinguished by, e.g. part of the file
name, then you can use the same approach but limit each page to images with
a particular part of the file name.

Don't worry about the time taken to read the directory contents on every
access of the page: the OS will take care of any caching needed.

Otherwise, what is your data source for determining which images go in which
groups on which pages?

Andrew
Jul 11 '08 #2

P: n/a
On Jul 11, 5:47*am, Peter K <Pet...@discusions.microsoft.comwrote:
I am working with Visual Studio or alternately with Expression Web. *I need
to create about 50 aspx pages with about 1200 thumbnali images, typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.

Can anybody point me to locations in MSDN or elsewhere giving the references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?

I have done equivalent things with Excel where the corresponding references
workboook & worksheet commands, etc, are widely available.

Any direction would be appreciated.

Peter K
I agree, I wouldn't try to programmatically create 50 pages, I'd
create as few of pages as possible pages (say 1 or 2) that could
handle the content of all the other pages.

Thanks,

Seth Rowe [MVP]
Jul 11 '08 #3

P: n/a
Thxs for your reply. Yes, I could do it that way.

However,my main problem is that I cannot find anywhere what references to
attach to the project, what objects to use, etc. I know how to create an
Excel application, open a workbook, move between work sheets, read & write in
those pages, save the file, close the workbook, etc. These are widely
available.

I need the equivalent items for aspx web pages. What are the libraries, how
do I create the application, create/open a page, etc.

Again, I'd appreciate any advise in that direction. Have searched MSDN, VB
samples, etc. Found nothing relevant to that situation.

Peter K

"Andrew Morton" wrote:
Peter K wrote:
I am working with Visual Studio or alternately with Expression Web.
I need to create about 50 aspx pages with about 1200 thumbnali
images, typically arranged in three to four groups per page, having
hyperlinks to the corresponding full size images.

Any direction would be appreciated.

If it's just a case of presenting an entire folder full of images one page
at a time, you should be able to do that with two pages: one for the
thumbnails and one for the preview.

Thumbnails page:
Read the content of the thumbnail images folder and make a <tablefrom a
suitable number of them.
Include prev/next page links which have URLs which post back to the
thumbnail page with the page number in, for choosing which set of thumbnails
to put in the <table>
Give each thumbnail an <ato the preview page, include the image reference
in the URL so the preview page can put the appropriate src= in the <img>
element.

Preview page:
Get the image's filename from Request.QueryString("whateverYouCalledIt")

If the sets of thumbnails are to be distinguished by, e.g. part of the file
name, then you can use the same approach but limit each page to images with
a particular part of the file name.

Don't worry about the time taken to read the directory contents on every
access of the page: the OS will take care of any caching needed.

Otherwise, what is your data source for determining which images go in which
groups on which pages?

Andrew
Jul 11 '08 #4

P: n/a
On Jul 11, 11:43*am, Peter K <Pet...@discusions.microsoft.comwrote:
Thxs for your reply. *Yes, I could do it that way.

However,my main problem is that I cannot find anywhere what references to
attach to the project, what objects to use, etc. *I know how to create an
Excel application, open a workbook, move between work sheets, read & write in
those pages, save the file, close the workbook, etc. *These are widely
available.

I need the equivalent items for aspx web pages. *What are the libraries, how
do I create the application, create/open a page, etc.

Again, I'd appreciate any advise in that direction. *Have searched MSDN, VB
samples, etc. *Found nothing relevant to that situation.

Peter K

"Andrew Morton" wrote:
Peter K wrote:
I am working with Visual Studio or alternately with Expression Web.
I need to create about 50 aspx pages with about 1200 thumbnali
images, typically arranged in three to four groups per page, having
hyperlinks to the corresponding full size images.
Any direction would be appreciated.
If it's just a case of presenting an entire folder full of images one page
at a time, you should be able to do that with two pages: one for the
thumbnails and one for the preview.
Thumbnails page:
Read the content of the thumbnail images folder and make a <tablefroma
suitable number of them.
Include prev/next page links which have URLs which post back to the
thumbnail page with the page number in, for choosing which set of thumbnails
to put in the <table>
Give each thumbnail an <ato the preview page, include the image reference
in the URL so the preview page can put the appropriate src= in the <img>
element.
Preview page:
Get the image's filename from Request.QueryString("whateverYouCalledIt")
If the sets of thumbnails are to be distinguished by, e.g. part of the file
name, then you can use the same approach but limit each page to images with
a particular part of the file name.
Don't worry about the time taken to read the directory contents on every
access of the page: the OS will take care of any caching needed.
Otherwise, what is your data source for determining which images go in which
groups on which pages?
Andrew
http://www.asp.net/learn/videos/

Don't take this the wrong way - but you need more basic help than this
ng should supply (imo). The above link has some good videos, but I'd
recommend getting an ASP.NET book and download Visual Web Developer
Express if you don't have the full version of Visual Studio.

Thanks.

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 11 '08 #5

P: n/a
Thxs for your reply.

I'm not quite sure what you mean by creating 'one or two pages that could
handle the contents of all the other pages'. There are 1200 image addresses
& 1200 thumbnail addresses (available in a sreadsheet as well as in an SQL
database) & they all have to be put onto web pages. That's not a job to do
one by one.

I wrote a program to create the folders & place the images into the folders,
another one to create the thumbnails, also placed into the set of folders.
All those things are well available & documented in MSDN & in many other
places.

However, for creating aspx web pages I have not been able to find the
equivalent info, which references/libraries to attach to the project, what
objects to use to define the application & to create/open pages, & write to
them.

I'd appreciate any help in that direction.

Peter K

What I cannnot find is what

"rowe_newsgroups" wrote:
On Jul 11, 5:47 am, Peter K <Pet...@discusions.microsoft.comwrote:
I am working with Visual Studio or alternately with Expression Web. I need
to create about 50 aspx pages with about 1200 thumbnali images, typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.

Can anybody point me to locations in MSDN or elsewhere giving the references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?

I have done equivalent things with Excel where the corresponding references
workboook & worksheet commands, etc, are widely available.

Any direction would be appreciated.

Peter K

I agree, I wouldn't try to programmatically create 50 pages, I'd
create as few of pages as possible pages (say 1 or 2) that could
handle the content of all the other pages.

Thanks,

Seth Rowe [MVP]
Jul 11 '08 #6

P: n/a

"Peter K" <Pe****@discusions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
Thxs for your reply.

I'm not quite sure what you mean by creating 'one or two pages that could
handle the contents of all the other pages'. There are 1200 image
addresses
& 1200 thumbnail addresses (available in a sreadsheet as well as in an SQL
database) & they all have to be put onto web pages. That's not a job to
do
one by one.

I wrote a program to create the folders & place the images into the
folders,
another one to create the thumbnails, also placed into the set of folders.
All those things are well available & documented in MSDN & in many other
places.

However, for creating aspx web pages I have not been able to find the
equivalent info, which references/libraries to attach to the project, what
objects to use to define the application & to create/open pages, & write
to
them.

I'd appreciate any help in that direction.

Peter K

What I cannnot find is what

"rowe_newsgroups" wrote:
>On Jul 11, 5:47 am, Peter K <Pet...@discusions.microsoft.comwrote:
I am working with Visual Studio or alternately with Expression Web. I
need
to create about 50 aspx pages with about 1200 thumbnali images,
typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.

Can anybody point me to locations in MSDN or elsewhere giving the
references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?

I have done equivalent things with Excel where the corresponding
references
workboook & worksheet commands, etc, are widely available.

Any direction would be appreciated.

Peter K

I agree, I wouldn't try to programmatically create 50 pages, I'd
create as few of pages as possible pages (say 1 or 2) that could
handle the content of all the other pages.

Thanks,

Seth Rowe [MVP]
Part of the following starter kit contains a photo album system. While it
may not be exactly what you are looking for I am sure that code will point
you in the right direction and perhaps change your approach to the asp.net
approach.

http://msdn.microsoft.com/en-us/vbasic/cc533486.aspx

Also you may have more luck with response by posting questions to the
asp.net forum. microsoft.public.dotnet.framework.aspnet

Hope this helps
LS

Jul 11 '08 #7

P: n/a
Thxs again.

I have Visual Studio Pro 2008 and have used it extensively. Neither in the
built in help, nor at MSDN have I so far found anything relevant to my
problem.

I have pretty much studied almost all chapters of Scott Michels ' Sams Teach
Yourself ASP.NET 2.0' and have extensively used it, where applicable. In
particular, I have looked over the last three chapters, where he develops a
full application of a multi-user photo album site. None of it is applicable
to my problem at hand, programmatically creating a set of about 50 aspx web
pages.

I am a subscriber to https://www.learnvisualstudio.net/ & have seen &
worked through many of their videos and used the info, where applicable.
Again, I have not found anything relevant to my current problem.

To programmatically write web aspx pages I need to attach
references/libraries/namespaces/classes to the project, which ones?
I then must use objects from the above to create/open the files, etc. For
MS Office this is well documented & widely available, I cannot find anything
for my current problem.

Again, any help would be appreciated.

Peter K
Excel application, open a workbook, move between work sheets, read & write in
those pages, save the file, close the workbook, etc. These are widely
available.

I need the equivalent items for aspx web pages. What are the libraries, how
do I create the application, create/open a page, etc.

Again, I'd appreciate any advise in that direction.

"rowe_newsgroups" wrote:
On Jul 11, 11:43 am, Peter K <Pet...@discusions.microsoft.comwrote:
Thxs for your reply. Yes, I could do it that way.

However,my main problem is that I cannot find anywhere what references to
attach to the project, what objects to use, etc. I know how to create an
Excel application, open a workbook, move between work sheets, read & write in
those pages, save the file, close the workbook, etc. These are widely
available.

I need the equivalent items for aspx web pages. What are the libraries, how
do I create the application, create/open a page, etc.

Again, I'd appreciate any advise in that direction. Have searched MSDN, VB
samples, etc. Found nothing relevant to that situation.

Peter K

"Andrew Morton" wrote:
Peter K wrote:
I am working with Visual Studio or alternately with Expression Web.
I need to create about 50 aspx pages with about 1200 thumbnali
images, typically arranged in three to four groups per page, having
hyperlinks to the corresponding full size images.
Any direction would be appreciated.
If it's just a case of presenting an entire folder full of images one page
at a time, you should be able to do that with two pages: one for the
thumbnails and one for the preview.
Thumbnails page:
Read the content of the thumbnail images folder and make a <tablefrom a
suitable number of them.
Include prev/next page links which have URLs which post back to the
thumbnail page with the page number in, for choosing which set of thumbnails
to put in the <table>
Give each thumbnail an <ato the preview page, include the image reference
in the URL so the preview page can put the appropriate src= in the <img>
element.
Preview page:
Get the image's filename from Request.QueryString("whateverYouCalledIt")
If the sets of thumbnails are to be distinguished by, e.g. part of the file
name, then you can use the same approach but limit each page to images with
a particular part of the file name.
Don't worry about the time taken to read the directory contents on every
access of the page: the OS will take care of any caching needed.
Otherwise, what is your data source for determining which images go in which
groups on which pages?
Andrew

http://www.asp.net/learn/videos/

Don't take this the wrong way - but you need more basic help than this
ng should supply (imo). The above link has some good videos, but I'd
recommend getting an ASP.NET book and download Visual Web Developer
Express if you don't have the full version of Visual Studio.

Thanks.

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 11 '08 #8

P: n/a

Thxs,

I'll have a look at the reference & also do further posts at the suggested URL

Peter K
"Lloyd Sheen" wrote:
>
"Peter K" <Pe****@discusions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
Thxs for your reply.

I'm not quite sure what you mean by creating 'one or two pages that could
handle the contents of all the other pages'. There are 1200 image
addresses
& 1200 thumbnail addresses (available in a sreadsheet as well as in an SQL
database) & they all have to be put onto web pages. That's not a job to
do
one by one.

I wrote a program to create the folders & place the images into the
folders,
another one to create the thumbnails, also placed into the set of folders.
All those things are well available & documented in MSDN & in many other
places.

However, for creating aspx web pages I have not been able to find the
equivalent info, which references/libraries to attach to the project, what
objects to use to define the application & to create/open pages, & write
to
them.

I'd appreciate any help in that direction.

Peter K

What I cannnot find is what

"rowe_newsgroups" wrote:
On Jul 11, 5:47 am, Peter K <Pet...@discusions.microsoft.comwrote:
I am working with Visual Studio or alternately with Expression Web. I
need
to create about 50 aspx pages with about 1200 thumbnali images,
typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.

Can anybody point me to locations in MSDN or elsewhere giving the
references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?

I have done equivalent things with Excel where the corresponding
references
workboook & worksheet commands, etc, are widely available.

Any direction would be appreciated.

Peter K

I agree, I wouldn't try to programmatically create 50 pages, I'd
create as few of pages as possible pages (say 1 or 2) that could
handle the content of all the other pages.

Thanks,

Seth Rowe [MVP]

Part of the following starter kit contains a photo album system. While it
may not be exactly what you are looking for I am sure that code will point
you in the right direction and perhaps change your approach to the asp.net
approach.

http://msdn.microsoft.com/en-us/vbasic/cc533486.aspx

Also you may have more luck with response by posting questions to the
asp.net forum. microsoft.public.dotnet.framework.aspnet

Hope this helps
LS

Jul 11 '08 #9

P: n/a
On Jul 11, 12:03*pm, Peter K <Pet...@discusions.microsoft.comwrote:
Thxs for your reply.

I'm not quite sure what you mean by creating 'one or two pages that could
handle the contents of all the other pages'. *There are 1200 image addresses
& 1200 thumbnail addresses (available in a sreadsheet as well as in an SQL
database) *& they all have to be put onto web pages. *That's not a job to do
one by one.

I wrote a program to create the folders & place the images into the folders,
another one to create the thumbnails, also placed into the set of folders.. *
All those things are well available & documented in MSDN & in many other
places.

However, for creating aspx web pages I have not been able to find the
equivalent info, which references/libraries to attach to the project, what
objects to use to define the application & to create/open pages, & write to
them.

I'd appreciate any help in that direction.

Peter K

What I cannnot find is what

"rowe_newsgroups" wrote:
On Jul 11, 5:47 am, Peter K <Pet...@discusions.microsoft.comwrote:
I am working with Visual Studio or alternately with Expression Web. *I need
to create about 50 aspx pages with about 1200 thumbnali images, typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.
Can anybody point me to locations in MSDN or elsewhere giving the references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?
I have done equivalent things with Excel where the corresponding references
workboook & worksheet commands, etc, are widely available.
Any direction would be appreciated.
Peter K
I agree, I wouldn't try to programmatically create 50 pages, I'd
create as few of pages as possible pages (say 1 or 2) that could
handle the content of all the other pages.
Thanks,
Seth Rowe [MVP]
Are you saying you want to create a page for each image? If so, I
don't see any reason to use aspx pages, you can simply use html pages
that just have image tags in the content. You could write a simple
console application that went through the images, created a file
stream, and then outputted the html text to the file.

My personal preference would be to create a page that takes a
parameter, say from the query string, and use it to retrieve the image
from the database and display it. I'm guessing the fields in the Sql
database have a unique identifier (say an int primary key) - that's
what I would pass in through the query string. ASP.NET has an image
control that you could change the ImageUrl property during init or
load based on the query string. For the thumbnails, you could simply
have a collection of ASP.NET image button controls that redirect to
the large image (passing in the correct query string parameters).
These controls should be built dynamically and the page should be
cached for performance.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 11 '08 #10

P: n/a
Not one page per image, approx 50 pages with about 60 thumbnails each on
average.

Your point is well taken that controls should be built dynamically, I was
too fixated at the old approach of creating static pages.

Thxs, Peter K

"rowe_newsgroups" wrote:
On Jul 11, 12:03 pm, Peter K <Pet...@discusions.microsoft.comwrote:
Thxs for your reply.

I'm not quite sure what you mean by creating 'one or two pages that could
handle the contents of all the other pages'. There are 1200 image addresses
& 1200 thumbnail addresses (available in a sreadsheet as well as in an SQL
database) & they all have to be put onto web pages. That's not a job to do
one by one.

I wrote a program to create the folders & place the images into the folders,
another one to create the thumbnails, also placed into the set of folders..
All those things are well available & documented in MSDN & in many other
places.

However, for creating aspx web pages I have not been able to find the
equivalent info, which references/libraries to attach to the project, what
objects to use to define the application & to create/open pages, & write to
them.

I'd appreciate any help in that direction.

Peter K

What I cannnot find is what

"rowe_newsgroups" wrote:
On Jul 11, 5:47 am, Peter K <Pet...@discusions.microsoft.comwrote:
I am working with Visual Studio or alternately with Expression Web. I need
to create about 50 aspx pages with about 1200 thumbnali images, typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.
Can anybody point me to locations in MSDN or elsewhere giving the references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?
I have done equivalent things with Excel where the corresponding references
workboook & worksheet commands, etc, are widely available.
Any direction would be appreciated.
Peter K
I agree, I wouldn't try to programmatically create 50 pages, I'd
create as few of pages as possible pages (say 1 or 2) that could
handle the content of all the other pages.
Thanks,
Seth Rowe [MVP]

Are you saying you want to create a page for each image? If so, I
don't see any reason to use aspx pages, you can simply use html pages
that just have image tags in the content. You could write a simple
console application that went through the images, created a file
stream, and then outputted the html text to the file.

My personal preference would be to create a page that takes a
parameter, say from the query string, and use it to retrieve the image
from the database and display it. I'm guessing the fields in the Sql
database have a unique identifier (say an int primary key) - that's
what I would pass in through the query string. ASP.NET has an image
control that you could change the ImageUrl property during init or
load based on the query string. For the thumbnails, you could simply
have a collection of ASP.NET image button controls that redirect to
the large image (passing in the correct query string parameters).
These controls should be built dynamically and the page should be
cached for performance.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 12 '08 #11

P: n/a
just curious...but why are you not using some of the data controls,
gridview, listview, repeater etc and paging?

It would require only a few pages...but dynamically from the source create
the 50 per page items etc and so on.

As for creating the aspx pages programatically...I wouldn't recommend
it...two or three aspx pages would be plenty using a control, datasource and
paging.

in more detail what are you trying to accomplish by creating these pages
seperately(static) as opposed to dynamically?
"Peter K" <Pe****@discusions.microsoft.comwrote in message
news:99**********************************@microsof t.com...
>I am working with Visual Studio or alternately with Expression Web. I need
to create about 50 aspx pages with about 1200 thumbnali images, typically
arranged in three to four groups per page, having hyperlinks to the
corresponding full size images.

Can anybody point me to locations in MSDN or elsewhere giving the
references
to attach, the commands & objects for creating or opening the pages and
possibly available classes?

I have done equivalent things with Excel where the corresponding
references
workboook & worksheet commands, etc, are widely available.

Any direction would be appreciated.

Peter K

Jul 14 '08 #12

This discussion thread is closed

Replies have been disabled for this discussion.