p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Redirect to a different frame


Message #1 by jmuldoon@q... on Sat, 22 Dec 2001 11:55:03
Redirect to a different frame



Is there a way to use response.redirect to send a querystring to a 

different frame? Below is a portion of code I tried that didn't work. The 

part I'm having trouble with is the very last line. The correct 

querystring is coming through, but the file is opening in the frame with 

the thumbnails. (If anyone has the time, I describe the practical reasons 

for doing this after the code):





-----------------



	FUNCTION mainThm(stThm)'Creates the list of photos as thumbnails

	cou2St=stThm 'MUST reset here. The first FUNCTION grNav changes it



	'NEXt writes a link to pass PhotName(first field in the row for 

this photo)

		'to main frame in the frameset.

		response.write "<div align=center>"	

		For cou = 0 to pnPgBr

				Response.write "<a 

href=""FrameDescription.asp?frPrId="  & pnAll(1,cou2St)  & "&" & choiqs 

& """ target=DescriptionFrame>"

				

 '--------------- FOLLOWING IF creates sendDesc from the first loop. This 

is the number of the First item

	' in this set of thumbnails. Used to put the description of the 

first item of the 

	' new list of thumbnails into the FramesDescriptions.asp page. 

This is th prId of that item

 				

		If cou = 0 then

		sendDesc= pnAll(1,cou2St)

		End if

 '--------------- END IF

				

	Response.write "<img src=""imagesPr\" & pnAll(0,cou2St) & """ 

height=110" &_

		" width=83 vspace=6 border=0"" alt=""" &_

		pnAll(2,cou2St) &  """></a><br>" & vbCrLf

		cou2St=cou2St+1	' Used below to check if loop has reached 

limit of the entire array.

		' When each thumbnail is written, it goes up by 1.

				

		if cou2St > pnRl then

			'If counter is higher than number of the last row 

in the array, exit.

			'This means the loop will not have to count up to 

PnPgBr.



		Exit For

		' Since the THUMBNAILS are not in a table, they can just 

end on an <br>

			End if

			Next

			

		

	response.redirect "FrameDescription.asp?frPrId=" & sendDesc  & "&" 

& choiqs & " target=DescriptionFrame"

	

	END FUNCTION

---------------------------------------

The URL that I'm concerned with is:

http://www.shamrockcommunications.net/gal/framesetmain.asp



The problem came up in useability testing. When a user selects a new 

category from the dropdown box, a new set of thumbnails appears, but the 

same project description remains in the larger frame to the right. It 

would be best if the first project in the new category would appear on the 

right.



The response.redirect I have above sends the right information, but opens 

in the thumbnails section. 

A simple lo-tech approach would be to add the note at the top of the 

thumbnails, "Click on a thumbnail to change the display on the right." 

(Actually, I'm going to do that soon, so that's what you'll probably see.



Slow loading: I also found out that, although this loaded fine on DSL, 

much too slow on dial-up. I'll be working on that, too.

Message #2 by "Kim Iwan Hansen" <kimiwan@k...> on Sat, 22 Dec 2001 13:42:56 +0100
just let the "get projects" button open two windows at once (using

javascript).



-Kim



> -----Original Message-----

> From: jmuldoon@q... [mailto:jmuldoon@q...]

> Sent: 22. december 2001 11:55

> To: ASP Databases

> Subject: [asp_databases] Redirect to a different frame

>

>

> Redirect to a different frame

>

> Is there a way to use response.redirect to send a querystring to a

> different frame? Below is a portion of code I tried that didn't work. The

> part I'm having trouble with is the very last line. The correct

> querystring is coming through, but the file is opening in the frame with

> the thumbnails. (If anyone has the time, I describe the practical reasons

> for doing this after the code):

>

>

> -----------------

>

> 	FUNCTION mainThm(stThm)'Creates the list of photos as thumbnails

> 	cou2St=stThm 'MUST reset here. The first FUNCTION grNav changes it

>

> 	'NEXt writes a link to pass PhotName(first field in the row for

> this photo)

> 		'to main frame in the frameset.

> 		response.write "<div align=center>"

> 		For cou = 0 to pnPgBr

> 				Response.write "<a

> href=""FrameDescription.asp?frPrId="  & pnAll(1,cou2St)  & "&" & choiqs

> & """ target=DescriptionFrame>"

>

>  '--------------- FOLLOWING IF creates sendDesc from the first loop. This

> is the number of the First item

> 	' in this set of thumbnails. Used to put the description of the

> first item of the

> 	' new list of thumbnails into the FramesDescriptions.asp page.

> This is th prId of that item

>

> 		If cou = 0 then

> 		sendDesc= pnAll(1,cou2St)

> 		End if

>  '--------------- END IF

>

> 	Response.write "<img src=""imagesPr\" & pnAll(0,cou2St) & """

> height=110" &_

> 		" width=83 vspace=6 border=0"" alt=""" &_

> 		pnAll(2,cou2St) &  """></a><br>" & vbCrLf

> 		cou2St=cou2St+1	' Used below to check if loop has reached

> limit of the entire array.

> 		' When each thumbnail is written, it goes up by 1.

>

> 		if cou2St > pnRl then

> 			'If counter is higher than number of the last row

> in the array, exit.

> 			'This means the loop will not have to count up to

> PnPgBr.

>

> 		Exit For

> 		' Since the THUMBNAILS are not in a table, they can just

> end on an <br>

> 			End if

> 			Next

>

>

> 	response.redirect "FrameDescription.asp?frPrId=" & sendDesc  & "&"

> & choiqs & " target=DescriptionFrame"

>

> 	END FUNCTION

> ---------------------------------------

> The URL that I'm concerned with is:

> http://www.shamrockcommunications.net/gal/framesetmain.asp

>

> The problem came up in useability testing. When a user selects a new

> category from the dropdown box, a new set of thumbnails appears, but the

> same project description remains in the larger frame to the right. It

> would be best if the first project in the new category would

> appear on the

> right.

>

> The response.redirect I have above sends the right information, but opens

> in the thumbnails section.

> A simple lo-tech approach would be to add the note at the top of the

> thumbnails, "Click on a thumbnail to change the display on the right."

> (Actually, I'm going to do that soon, so that's what you'll probably see.

>

> Slow loading: I also found out that, although this loaded fine on DSL,

> much too slow on dial-up. I'll be working on that, too.

>




> $subst('Email.Unsub').

>



Message #3 by jmuldoon@q... on Sat, 22 Dec 2001 19:17:50
Kim:



Did you mean files or windows? If I open two windows, I couldn't work with 

the frameset, could I?



> just let the "get projects" button open two windows at once (using

> javascript).

> 

> -Kim

> 

> > -----Original Message-----

> > From: jmuldoon@q... [mailto:jmuldoon@q...]

> > Sent: 22. december 2001 11:55

> > To: ASP Databases

> > Subject: [asp_databases] Redirect to a different frame

> >

> >

> > Redirect to a different frame

> >

> > Is there a way to use response.redirect to send a querystring to a

> > different frame? Below is a portion of code I tried that didn't work. 

The

> > part I'm having trouble with is the very last line. The correct

> > querystring is coming through, but the file is opening in the frame 

with

> > the thumbnails. (If anyone has the time, I describe the practical 

reasons

> > for doing this after the code):

> >

> >

> > -----------------

> >

> > 	FUNCTION mainThm(stThm)'Creates the list of photos as thumbnails

> > 	cou2St=stThm 'MUST reset here. The first FUNCTION grNav changes it

> >

> > 	'NEXt writes a link to pass PhotName(first field in the row for

> > this photo)

> > 		'to main frame in the frameset.

> > 		response.write "<div align=center>"

> > 		For cou = 0 to pnPgBr

> > 				Response.write "<a

> > href=""FrameDescription.asp?frPrId="  & pnAll(1,cou2St)  & "&" & choiqs

> > & """ target=DescriptionFrame>"

> >

> >  '--------------- FOLLOWING IF creates sendDesc from the first loop. 

This

> > is the number of the First item

> > 	' in this set of thumbnails. Used to put the description of the

> > first item of the

> > 	' new list of thumbnails into the FramesDescriptions.asp page.

> > This is th prId of that item

> >

> > 		If cou = 0 then

> > 		sendDesc= pnAll(1,cou2St)

> > 		End if

> >  '--------------- END IF

> >

> > 	Response.write "<img src=""imagesPr\" & pnAll(0,cou2St) & """

> > height=110" &_

> > 		" width=83 vspace=6 border=0"" alt=""" &_

> > 		pnAll(2,cou2St) &  """></a><br>" & vbCrLf

> > 		cou2St=cou2St+1	' Used below to check if loop has reached

> > limit of the entire array.

> > 		' When each thumbnail is written, it goes up by 1.

> >

> > 		if cou2St > pnRl then

> > 			'If counter is higher than number of the last row

> > in the array, exit.

> > 			'This means the loop will not have to count up to

> > PnPgBr.

> >

> > 		Exit For

> > 		' Since the THUMBNAILS are not in a table, they can just

> > end on an <br>

> > 			End if

> > 			Next

> >

> >

> > 	response.redirect "FrameDescription.asp?frPrId=" & sendDesc  & "&"

> > & choiqs & " target=DescriptionFrame"

> >

> > 	END FUNCTION

> > ---------------------------------------

> > The URL that I'm concerned with is:

> > http://www.shamrockcommunications.net/gal/framesetmain.asp

> >

> > The problem came up in useability testing. When a user selects a new

> > category from the dropdown box, a new set of thumbnails appears, but 

the

> > same project description remains in the larger frame to the right. It

> > would be best if the first project in the new category would

> > appear on the

> > right.

> >

> > The response.redirect I have above sends the right information, but 

opens

> > in the thumbnails section.

> > A simple lo-tech approach would be to add the note at the top of the

> > thumbnails, "Click on a thumbnail to change the display on the right."

> > (Actually, I'm going to do that soon, so that's what you'll probably 

see.

> >

> > Slow loading: I also found out that, although this loaded fine on DSL,

> > much too slow on dial-up. I'll be working on that, too.

> >




> > $subst('Email.Unsub').

> >

> 

Message #4 by "Kim Iwan Hansen" <kimiwan@k...> on Sat, 22 Dec 2001 20:44:03 +0100
i mean open two pages into the targets of your desire, that be within the

frameset or new windows.



in your case you'd want to use the menu and the main windows/frames/whatever

as your targets.



find some free copy & paste javascript through one of the search engines,

that shouldn't take you five minutes.



-Kim





> -----Original Message-----

> From: jmuldoon@q... [mailto:jmuldoon@q...]

> Sent: 22. december 2001 19:18

> To: ASP Databases

> Subject: [asp_databases] RE: Redirect to a different frame

>

>

> Kim:

>

> Did you mean files or windows? If I open two windows, I couldn't

> work with

> the frameset, could I?

>

> > just let the "get projects" button open two windows at once (using

> > javascript).

> >

> > -Kim

> >

> > > -----Original Message-----

> > > From: jmuldoon@q... [mailto:jmuldoon@q...]

> > > Sent: 22. december 2001 11:55

> > > To: ASP Databases

> > > Subject: [asp_databases] Redirect to a different frame

> > >

> > >

> > > Redirect to a different frame

> > >

> > > Is there a way to use response.redirect to send a querystring to a

> > > different frame? Below is a portion of code I tried that didn't work.

> The

> > > part I'm having trouble with is the very last line. The correct

> > > querystring is coming through, but the file is opening in the frame

> with

> > > the thumbnails. (If anyone has the time, I describe the practical

> reasons

> > > for doing this after the code):

> > >

> > >

> > > -----------------

> > >

> > > 	FUNCTION mainThm(stThm)'Creates the list of photos as thumbnails

> > > 	cou2St=stThm 'MUST reset here. The first FUNCTION grNav changes it

> > >

> > > 	'NEXt writes a link to pass PhotName(first field in the row for

> > > this photo)

> > > 		'to main frame in the frameset.

> > > 		response.write "<div align=center>"

> > > 		For cou = 0 to pnPgBr

> > > 				Response.write "<a

> > > href=""FrameDescription.asp?frPrId="  & pnAll(1,cou2St)  &

> "&" & choiqs

> > > & """ target=DescriptionFrame>"

> > >

> > >  '--------------- FOLLOWING IF creates sendDesc from the first loop.

> This

> > > is the number of the First item

> > > 	' in this set of thumbnails. Used to put the description of the

> > > first item of the

> > > 	' new list of thumbnails into the FramesDescriptions.asp page.

> > > This is th prId of that item

> > >

> > > 		If cou = 0 then

> > > 		sendDesc= pnAll(1,cou2St)

> > > 		End if

> > >  '--------------- END IF

> > >

> > > 	Response.write "<img src=""imagesPr\" & pnAll(0,cou2St) & """

> > > height=110" &_

> > > 		" width=83 vspace=6 border=0"" alt=""" &_

> > > 		pnAll(2,cou2St) &  """></a><br>" & vbCrLf

> > > 		cou2St=cou2St+1	' Used below to check if loop has reached

> > > limit of the entire array.

> > > 		' When each thumbnail is written, it goes up by 1.

> > >

> > > 		if cou2St > pnRl then

> > > 			'If counter is higher than number of the last row

> > > in the array, exit.

> > > 			'This means the loop will not have to count up to

> > > PnPgBr.

> > >

> > > 		Exit For

> > > 		' Since the THUMBNAILS are not in a table, they can just

> > > end on an <br>

> > > 			End if

> > > 			Next

> > >

> > >

> > > 	response.redirect "FrameDescription.asp?frPrId=" & sendDesc  & "&"

> > > & choiqs & " target=DescriptionFrame"

> > >

> > > 	END FUNCTION

> > > ---------------------------------------

> > > The URL that I'm concerned with is:

> > > http://www.shamrockcommunications.net/gal/framesetmain.asp

> > >

> > > The problem came up in useability testing. When a user selects a new

> > > category from the dropdown box, a new set of thumbnails appears, but

> the

> > > same project description remains in the larger frame to the right. It

> > > would be best if the first project in the new category would

> > > appear on the

> > > right.

> > >

> > > The response.redirect I have above sends the right information, but

> opens

> > > in the thumbnails section.

> > > A simple lo-tech approach would be to add the note at the top of the

> > > thumbnails, "Click on a thumbnail to change the display on the right."

> > > (Actually, I'm going to do that soon, so that's what you'll probably

> see.

> > >

> > > Slow loading: I also found out that, although this loaded fine on DSL,

> > > much too slow on dial-up. I'll be working on that, too.

> > >




> > > $subst('Email.Unsub').

> > >

> >

>




> $subst('Email.Unsub').

>



Message #5 by "Dallas Martin" <dmartin@z...> on Sun, 23 Dec 2001 18:59:20 -0500

Here's a code snippet wherein I reload the left frame of a frameset.



<snippet>

<script language="JavaScript">

function ReloadLeftFrame()

{

var url = window.location.href;

var user_id = url.substring(url.indexOf("user_id=") + 8 );

var strHref;

if (user_id > 0)

 {

   strHref = "givLeftFrame.asp?user_id="+ user_id;

      parent.leftFrame.document.location.href=strHref;

 }

}

</script>

</HEAD>

<BODY BGCOLOR="#FFFFFF" onload="ReloadLeftFrame();">

</snippet>



When the called page in the right frame is loaded, the "ReloadLeftFrame()"

function is called. The page in the right frame is created by ASP. The ASP

code adds the querystring "user_id=xxx" to the URL in the response.redirect

of the ASP page.



Dallas



----- Original Message -----

From: <jmuldoon@q...>

To: "ASP Databases" <asp_databases@p...>

Sent: Saturday, December 22, 2001 11:55 AM

Subject: [asp_databases] Redirect to a different frame





> Redirect to a different frame

>

> Is there a way to use response.redirect to send a querystring to a

> different frame? Below is a portion of code I tried that didn't work. The

> part I'm having trouble with is the very last line. The correct

> querystring is coming through, but the file is opening in the frame with

> the thumbnails. (If anyone has the time, I describe the practical reasons

> for doing this after the code):

>

>

> -----------------

>

> FUNCTION mainThm(stThm)'Creates the list of photos as thumbnails

> cou2St=stThm 'MUST reset here. The first FUNCTION grNav changes it

>

> 'NEXt writes a link to pass PhotName(first field in the row for

> this photo)

> 'to main frame in the frameset.

> response.write "<div align=center>"

> For cou = 0 to pnPgBr

> Response.write "<a

> href=""FrameDescription.asp?frPrId="  & pnAll(1,cou2St)  & "&" & choiqs

> & """ target=DescriptionFrame>"

>

>  '--------------- FOLLOWING IF creates sendDesc from the first loop. This

> is the number of the First item

> ' in this set of thumbnails. Used to put the description of the

> first item of the

> ' new list of thumbnails into the FramesDescriptions.asp page.

> This is th prId of that item

>

> If cou = 0 then

> sendDesc= pnAll(1,cou2St)

> End if

>  '--------------- END IF

>

> Response.write "<img src=""imagesPr\" & pnAll(0,cou2St) & """

> height=110" &_

> " width=83 vspace=6 border=0"" alt=""" &_

> pnAll(2,cou2St) &  """></a><br>" & vbCrLf

> cou2St=cou2St+1 ' Used below to check if loop has reached

> limit of the entire array.

> ' When each thumbnail is written, it goes up by 1.

>

> if cou2St > pnRl then

> 'If counter is higher than number of the last row

> in the array, exit.

> 'This means the loop will not have to count up to

> PnPgBr.

>

> Exit For

> ' Since the THUMBNAILS are not in a table, they can just

> end on an <br>

> End if

> Next

>

>

> response.redirect "FrameDescription.asp?frPrId=" & sendDesc  & "&"

> & choiqs & " target=DescriptionFrame"

>

> END FUNCTION

> ---------------------------------------

> The URL that I'm concerned with is:

> http://www.shamrockcommunications.net/gal/framesetmain.asp

>

> The problem came up in useability testing. When a user selects a new

> category from the dropdown box, a new set of thumbnails appears, but the

> same project description remains in the larger frame to the right. It

> would be best if the first project in the new category would appear on the

> right.

>

> The response.redirect I have above sends the right information, but opens

> in the thumbnails section.

> A simple lo-tech approach would be to add the note at the top of the

> thumbnails, "Click on a thumbnail to change the display on the right."

> (Actually, I'm going to do that soon, so that's what you'll probably see.

>

> Slow loading: I also found out that, although this loaded fine on DSL,

> much too slow on dial-up. I'll be working on that, too.

>




$subst('Email.Unsub').

>



Message #6 by jmuldoon@q... on Mon, 24 Dec 2001 00:27:00
Dallas:



Thanks. I'm going to give it a try.



Joe





> 

> Here's a code snippet wherein I reload the left frame of a frameset.

> 

> <snippet>

> <script language="JavaScript">

> function ReloadLeftFrame()

> {

> var url = window.location.href;

> var user_id = url.substring(url.indexOf("user_id=") + 8 );

> var strHref;

> if (user_id > 0)

>  {

>    strHref = "givLeftFrame.asp?user_id="+ user_id;

>       parent.leftFrame.document.location.href=strHref;

>  }

> }

> </script>

> </HEAD>

> <BODY BGCOLOR="#FFFFFF" onload="ReloadLeftFrame();">

> </snippet>

> 

> When the called page in the right frame is loaded, the "ReloadLeftFrame

()"

> function is called. The page in the right frame is created by ASP. The 

ASP

> code adds the querystring "user_id=xxx" to the URL in the 

response.redirect

> of the ASP page.

> 

> Dallas

> 

> ----- Original Message -----

> From: <jmuldoon@q...>

> To: "ASP Databases" <asp_databases@p...>

> Sent: Saturday, December 22, 2001 11:55 AM

> Subject: [asp_databases] Redirect to a different frame

> 

> 

> > Redirect to a different frame

> >

> > Is there a way to use response.redirect to send a querystring to a

> > different frame? Below is a portion of code I tried that didn't work. 

The

> > part I'm having trouble with is the very last line. The correct

> > querystring is coming through, but the file is opening in the frame 

with

> > the thumbnails. (If anyone has the time, I describe the practical 

reasons

> > for doing this after the code):

> >

> >

> > -----------------

> >

> > FUNCTION mainThm(stThm)'Creates the list of photos as thumbnails

> > cou2St=stThm 'MUST reset here. The first FUNCTION grNav changes it

> >

> > 'NEXt writes a link to pass PhotName(first field in the row for

> > this photo)

> > 'to main frame in the frameset.

> > response.write "<div align=center>"

> > For cou = 0 to pnPgBr

> > Response.write "<a

> > href=""FrameDescription.asp?frPrId="  & pnAll(1,cou2St)  & "&" & choiqs

> > & """ target=DescriptionFrame>"

> >

> >  '--------------- FOLLOWING IF creates sendDesc from the first loop. 

This

> > is the number of the First item

> > ' in this set of thumbnails. Used to put the description of the

> > first item of the

> > ' new list of thumbnails into the FramesDescriptions.asp page.

> > This is th prId of that item

> >

> > If cou = 0 then

> > sendDesc= pnAll(1,cou2St)

> > End if

> >  '--------------- END IF

> >

> > Response.write "<img src=""imagesPr\" & pnAll(0,cou2St) & """

> > height=110" &_

> > " width=83 vspace=6 border=0"" alt=""" &_

> > pnAll(2,cou2St) &  """></a><br>" & vbCrLf

> > cou2St=cou2St+1 ' Used below to check if loop has reached

> > limit of the entire array.

> > ' When each thumbnail is written, it goes up by 1.

> >

> > if cou2St > pnRl then

> > 'If counter is higher than number of the last row

> > in the array, exit.

> > 'This means the loop will not have to count up to

> > PnPgBr.

> >

> > Exit For

> > ' Since the THUMBNAILS are not in a table, they can just

> > end on an <br>

> > End if

> > Next

> >

> >

> > response.redirect "FrameDescription.asp?frPrId=" & sendDesc  & "&"

> > & choiqs & " target=DescriptionFrame"

> >

> > END FUNCTION

> > ---------------------------------------

> > The URL that I'm concerned with is:

> > http://www.shamrockcommunications.net/gal/framesetmain.asp

> >

> > The problem came up in useability testing. When a user selects a new

> > category from the dropdown box, a new set of thumbnails appears, but 

the

> > same project description remains in the larger frame to the right. It

> > would be best if the first project in the new category would appear on 

the

> > right.

> >

> > The response.redirect I have above sends the right information, but 

opens

> > in the thumbnails section.

> > A simple lo-tech approach would be to add the note at the top of the

> > thumbnails, "Click on a thumbnail to change the display on the right."

> > (Actually, I'm going to do that soon, so that's what you'll probably 

see.

> >

> > Slow loading: I also found out that, although this loaded fine on DSL,

> > much too slow on dial-up. I'll be working on that, too.

> >




> $subst('Email.Unsub').

> >

> 


  Return to Index