hi lily....
Tis will work fine.
But i leave a small work for u to finish ur task.
i.e., u need to check for minimum three checked items.
its also simple. A variable "intCount" is declared and incremented in the loop here.
use it and chk ur appropriate validation.
ASP.NET, code behind:
VB.NET
In chkboxlist1.aspx.
vb
------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intCount, i
Dim StoreListItems As String
Dim Store As String
Dim arr()
hdnStore = ""
StoreListItems = ""
intCount = 0
For i = 0 To CheckBoxList1.Items.Count - 1
If CheckBoxList1.Items(i).Selected = True Then
intCount += 1
Store += i & ","
End If
Next
arr = Split(Store, ",")
'hdnChk1 is a hidden variable
hdnChk1.Value = CheckBoxList1.Items(arr(0)).Text
hdnChk1.Value = hdnChk1.Value + "," + CheckBoxList1.Items(arr(1)).Text
hdnChk1.Value = hdnChk1.Value + "," + CheckBoxList1.Items(arr(2)).Text
Response.Redirect("chkboxlist2.aspx?arg=" + hdnChk1.Value)
End Sub
In chkboxlist2.aspx.
vb
------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim arr()
Dim displayItems As String
displayItems = ""
displayItems = Request.QueryString("arg")
arr = Split(displayItems, ",")
TextBox1.Text = arr(0)
TextBox2.Text = arr(1)
TextBox3.Text = arr(2)
End Sub