How to pass array in asp.net(c#) from one page to other?
-
Hi friends i have one serious problem i m unable to pass an array like string[] seatLayout=new string[100]; from one page named SelectBus.aspx to PassDetails.aspx.....i m stuked there? i need to pass array from one page to another. Can any one please help? :(( :((
-
Hi friends i have one serious problem i m unable to pass an array like string[] seatLayout=new string[100]; from one page named SelectBus.aspx to PassDetails.aspx.....i m stuked there? i need to pass array from one page to another. Can any one please help? :(( :((
well there are several ways you can pass data between pages, Query String, Session variables etc. string[100] is potentially huge data, depending on the content of each element. Why don't you persist the data to either database or file and pass a handle from one page to another page1.aspx: Save string[100] to database then call page2.aspx?id=some_id
ɟnsnʎ ʎlʇuǝƃıllǝʇuı uoıʇsǝnb ɐ ʞsɐ oʇ ʍoɥ [^]
-
Hi friends i have one serious problem i m unable to pass an array like string[] seatLayout=new string[100]; from one page named SelectBus.aspx to PassDetails.aspx.....i m stuked there? i need to pass array from one page to another. Can any one please help? :(( :((
Your first question is, why do you need to pass this array ? You should probably store it in a DB, and pass the id used to pull it from the DB. Having said that, you could concievably place the array on the URL, or use the Session.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
Hi friends i have one serious problem i m unable to pass an array like string[] seatLayout=new string[100]; from one page named SelectBus.aspx to PassDetails.aspx.....i m stuked there? i need to pass array from one page to another. Can any one please help? :(( :((
simply i m given it as [100] but i need only 5 to 10 thats all......because in one page user will select seats in the bus for reservations i need to pass these values to next page thats all...........
-
Hi friends i have one serious problem i m unable to pass an array like string[] seatLayout=new string[100]; from one page named SelectBus.aspx to PassDetails.aspx.....i m stuked there? i need to pass array from one page to another. Can any one please help? :(( :((
Hi, You can Use Querystring for Passing Array from one Page to Another page. I hope the following Sample Code will Help You. Let's start by creating the array in CreateArray.asp 'Create an array that contains 'the days of the week Dim aWeekDays(6) aWeekDays(0) = "Sunday" aWeekDays(1) = "Monday" aWeekDays(2) = "Tuesday" aWeekDays(3) = "Wednesday" aWeekDays(4) = "Thursday" aWeekDays(5) = "Friday" aWeekDays(6) = "Saturday" Now, to store the array contents in the querystring, we will loop from LBound(aWeekDays) to UBound(aWeekDays). For each element, we'll add an item to the querystring, having the array name, an equals sign, and then the value of the particular array element. 'Build the querystring Dim iLoop, strQueryString For iLoop = LBound(aWeekDays) to UBound(aWeekDays) strQueryString = strQueryString & "WeekDays=" & aWeekDays(iLoop) strQueryString = strQueryString & "&" Next 'Cut off the last character strQueryString = Left(strQueryString, Len(strQueryString) - 1) 'Now, create the actual hyperlink %> ReceiveArray.asp Bye Jai
-
Hi, You can Use Querystring for Passing Array from one Page to Another page. I hope the following Sample Code will Help You. Let's start by creating the array in CreateArray.asp 'Create an array that contains 'the days of the week Dim aWeekDays(6) aWeekDays(0) = "Sunday" aWeekDays(1) = "Monday" aWeekDays(2) = "Tuesday" aWeekDays(3) = "Wednesday" aWeekDays(4) = "Thursday" aWeekDays(5) = "Friday" aWeekDays(6) = "Saturday" Now, to store the array contents in the querystring, we will loop from LBound(aWeekDays) to UBound(aWeekDays). For each element, we'll add an item to the querystring, having the array name, an equals sign, and then the value of the particular array element. 'Build the querystring Dim iLoop, strQueryString For iLoop = LBound(aWeekDays) to UBound(aWeekDays) strQueryString = strQueryString & "WeekDays=" & aWeekDays(iLoop) strQueryString = strQueryString & "&" Next 'Cut off the last character strQueryString = Left(strQueryString, Len(strQueryString) - 1) 'Now, create the actual hyperlink %> ReceiveArray.asp Bye Jai
but how to retrieve the elements in the next page?????? :( :sigh: :^) :( :sigh: :((