Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 20th, 2007, 12:30 AM
Registered User
 
Join Date: Apr 2007
Location: Hyderabad, Andhra Pradesh, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to kaushikpulpa
Default Check BOx

There are multiple pages . On each page dynamic checkboxes. I check some checkboxes on first page i go to next page & check 2 more checkboxes . so when i return back to first page the checked checkboxes becomes unchecked. So how do i avoid this ?

with thans and regards,
Kaushik Chandra Pulpa
  #2 (permalink)  
Old August 20th, 2007, 08:27 AM
Friend of Wrox
 
Join Date: May 2006
Location: Northampton, United Kingdom.
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Add some code so that when a check box is ticked set a variable.
On return to the page if the variable is set then fill in the tick on the page


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   If Session("CheckBox1IsChecked") = "Y" Then
     CheckBox1.Checked = True
   End If
End Sub


Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
    If CheckBox1.Checked = True Then
       Session("CheckBox1IsChecked") = "Y"
    End If
End Sub


Make sure that to start with the Session("CheckBox1IsChecked") is set to something other than "Y"



  #3 (permalink)  
Old August 30th, 2007, 08:01 AM
Authorized User
 
Join Date: Aug 2007
Location: mumbai, maharashtra, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi kaushik,
this is Shakti.

just set the viewstate property of that checkbox to true,
now every time the page goes to server the state of that control is maintained in its viewstate property.
so no need to write any code.

reply ur comments.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check box help? dstein4d Access VBA 2 February 27th, 2008 09:54 AM
VBA - Check box KennethMungwira Access VBA 2 May 22nd, 2006 10:43 AM
please help (get check box value) qadeerahmad General .NET 3 September 24th, 2004 08:46 AM
Check box Error surendran BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 July 25th, 2004 11:36 PM
how to get value from check box..... cici Classic ASP Professional 2 May 15th, 2004 08:35 AM



All times are GMT -4. The time now is 10:38 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.