Click here to Skip to main content
15,910,277 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all,

I am developing Website using ASP.NET , i have on New user registration page i that i am having mobile number text i have one check box if the user select on the checkbox means the mobile number value should not display in gridview i set it s Personal i won't display to others but what is the issue means if the user who register he also not able to see his/her mobile number in gridview it displays as personal. Who login in they should need to see their mobile number if the user select the checkbox means others not able to see it...

Please some one help me how to code loop.
Posted
Comments
Uday P.Singh 13-Dec-11 12:45pm    
are you storing the mobile number in database?
Orcun Iyigun 13-Dec-11 13:09pm    
As Uday said if you are keeping the registration page data in a DB, you have a field for that checkbox and the registered user data. so basically with a if statement you can check is that checkbox is checked and the user is the registered user or someone else. if both statments is true you basically show the data else hide it :)

when user is filling the form and select my mobile no. is personal then use a field in database like status 'P' for Personal or 'N' for not-personal. according to the selection of check box.
when user login and match id of that from he has logged in if both are same then show the mobile number. else if anyone else logged in and id are not same then match the status and according to that show or hide number.
Try in this way.
 
Share this answer
 
if user has selected mobile no as personal then at time of login, save login id in session and in grid, bind login id as a column.
at time of display check login id with grid column (user id) if same then display mobile no other than not display.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900