Problem with Pages in ASP
Question posted by: Vini171285
(Member)
on
May 11th, 2008 09:02 AM
Hi..
I have a form,it consists of a six list boxes and depending on selection of that boxes i have to display six pages ..
i have used an array to store these values and case to go to particular pages,but the problem is all pages come in one window..
and i want that,first page should come user can fill it and after submitting that page,the next page stored in array should come..
so what can i do??
-
arrdesc=Array(Request.Form("desc1"),Request.Form("desc2"),Request.Form("desc3"),Request.Form("desc4"),Request.Form("desc5"),Request.Form("desc6"))
-
Dim desc
-
for each desc in arrdesc
-
select case desc
-
case 1
-
SecondPage()
-
case 2
-
SecondPage()
-
case 3
-
SecondPage()
-
case 4
-
ThirdPage()
-
case 5
-
ThirdPage()
-
case 6
-
FifthPage()
-
case 7
-
FifthPage()
-
case 8
-
FifthPage()
-
case 9
-
FourthPage()
-
end select
-
Next
|
|
May 11th, 2008 03:00 PM
# 2
|
Re: Problem with Pages in ASP
Hi ,
You can do modification in your code like this :
On Page1.asp , you should write following code :
- <HTML>
-
<BODY>
-
<form method="post" action "Page2.asp">
-
<Select id= "pageSelect">
-
<Option value="page1">Page1.asp</Option>
-
<Option value="page2">Page2.asp</Option>
-
</Select>
-
</form>
-
<BODY>
-
</HTML>
On Page2.asp write the code below :
-
<%
-
Dim page
-
page=Request.Form("pageSelect")
-
Select page
-
Case "page1"
-
Response.redirect "Page1.asp"
-
-
Case "page2"
-
Response.redirect "Page2.asp"
-
-
End Select
-
%>
-
Quote:
Hi..
I have a form,it consists of a six list boxes and depending on selection of that boxes i have to display six pages ..
i have used an array to store these values and case to go to particular pages,but the problem is all pages come in one window..
and i want that,first page should come user can fill it and after submitting that page,the next page stored in array should come..
so what can i do??
-
arrdesc=Array(Request.Form("desc1"),Request.Form("desc2"),Request.Form("desc3"),Request.Form("desc4"),Request.Form("desc5"),Request.Form("desc6"))
-
Dim desc
-
for each desc in arrdesc
-
select case desc
-
case 1
-
SecondPage()
-
case 2
-
SecondPage()
-
case 3
-
SecondPage()
-
case 4
-
ThirdPage()
-
case 5
-
ThirdPage()
-
case 6
-
FifthPage()
-
case 7
-
FifthPage()
-
case 8
-
FifthPage()
-
case 9
-
FourthPage()
-
end select
-
Next
|
|
|
May 18th, 2008 09:22 AM
# 3
|
Re: Problem with Pages in ASP
Hi Shweta,
Thanx for answering but u got my question wrong..
My problem is...
I am having 6 listboxes consisting of same options..
minimum 1 can be selected or maximum all 6 can be selected..
so suppose 2 are selected then we should go to first options page after submitting that page ,then we should go to second options page..
i.e. one by one it should go to pages as per selected in listboxes..
Hope this time i am clear..
Thanx..
|
|
May 19th, 2008 04:36 PM
# 4
|
Re: Problem with Pages in ASP
Hi,
After submitting main page on First.asp write this code :
-
<%
-
Dim Pages()
-
-
-
'Get the listbox values into the array
-
Pages(0) = Request.Form("lst1")
-
'
-
'
-
'
-
Redim preserve Pages(Ubound(Pages)+1)
-
pages(Ubound(Pages))= Request.Form("lst6")
-
-
-
''Store the arry in session variable
-
Session("myArray") = pages
-
-
-
''Redirect to first options page
-
-
If(pages(0) <> "") then
-
Response.redirect(Pages(0) & "&Cnt =1")
-
End if%>
On Second.asp write this code :
-
<%
-
Dim localarr
-
Dim arrindex
-
-
localarr = Session("myArray")
-
arrindex = REquest.QueryString("cnt")
-
-
''Check if array index is within array bounds
-
If(arrindex <= Ubound(localarr)) Then
-
-
''Redirect to next Options page
-
If(localarr(arrindex) <> "") Then
-
Response.redirect(Pages(arrindex+1) & "&Cnt = "& cnt & "")
-
End If
-
End if
-
%>
Quote:
Hi Shweta,
Thanx for answering but u got my question wrong..
My problem is...
I am having 6 listboxes consisting of same options..
minimum 1 can be selected or maximum all 6 can be selected..
so suppose 2 are selected then we should go to first options page after submitting that page ,then we should go to second options page..
i.e. one by one it should go to pages as per selected in listboxes..
Hope this time i am clear..
Thanx..
|
 |
Not the answer you were looking for? Post your question . . .
189,938 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|
|
|
Latest Articles: Read & Comment
Top ASP Forum Contributors
|