TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Micah David
NA
25
9k
How to check if a user in connected to another user on login
Aug 10 2016 12:30 PM
I have two lables but on must appear as a default when a user logs in<br />the two labels are Lable A, amd Lable B<br /><br />Now i have two tables called User Account table and User Connected table<br /><br />Example<br /><br />User Connected table<br />-------------------------------------------------------------------------------------------------------<br />ID UserName | FriendUserName | Status <br />--------------------------------------------------------------------------------------------------------<br />1 Mary22 | Stonek33 | true<br />-------------------------------------------------------------------------------------------------------<br />----------------------------------------------------------------- -----------------------------------<br />2 brown22 | Stonek33 | true<br />-------------------------------------------------------------------------------------------------------<br /><br /><br />User Account table <br />--------------------------------------------------------------------------------<br />ID UserName <br />-----------------------------------------------------------------------------------<br />1 Mary22 <br />-------------------------------------------------------------------------------------<br />----------------------------------------------------------------------------------<br />2 brown22 <br />-------------------------------------------------------------------------------------<br />----------------------------------------------------------------------------------<br />3 Stonek33 <br />-------------------------------------------------------------------------------------<br />----------------------------------------------------------------------------------<br />4 liter22 <br />-------------------------------------------------------------------------------------<br /><br />So now lets take for example that mary22, Mary22 is connected to Stonek33 and the status of their connection us true, so if mary logs in she wants to see those she is connect to, so when she clicks on names of any <br />of the users displayed on her page she will be redirected to the users page and she will see the lable showing yes connected.<br />But you can see from the table that mary22 is not connected to brown22 and so if mary or brown22 visits each others page they will see not connected lable.<br /><br />i ony created a html of it but i need help on the code behind<br /><br /><div>HTML </div><div> </div><div><div class="dp-highlighter"><ol class="dp-xml" start="1"><li class="alt"><span><span class="tag"><</span><span class="tag-name">asp:FormView</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"FormView1follow"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">OnDataBound</span><span>=</span><span class="attribute-value">"OnDataBound"</span><span> </span><span class="attribute">Width</span><span>=</span><span class="attribute-value">"100%"</span><span> </span></span></li><li class=""><span> <span class="attribute">AllowPaging</span><span>=</span><span class="attribute-value">"true"</span><span> </span><span class="attribute">OnPageIndexChanging</span><span>=</span><span class="attribute-value">"OnPageIndexChanging"</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">ItemTemplate</span><span class="tag">></span><span> </span></span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">asp:HiddenField</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"hfUserName"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">Value</span><span>=</span><span class="attribute-value">'<%# Eval("UserName") %>'</span><span> </span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">asp:HiddenField</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"hfFriendsUserName"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">Value</span><span>=</span><span class="attribute-value">'<%# Eval("FriendUserName") %>'</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">asp:HiddenField</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"hfStatus"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">Value</span><span>=</span><span class="attribute-value">'<%# Eval("Status") %>'</span><span> </span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">asp:LinkButton</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"btnFriend"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">ToolTip</span><span>=</span><span class="attribute-value">"follow user"</span><span> </span></span></li><li class=""><span> <span class="attribute">Font-Bold</span><span>=</span><span class="attribute-value">"True"</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">i</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">""</span><span> </span><span class="attribute">style</span><span>=</span><span class="attribute-value">"margin-right: 2px"</span><span class="tag">></span><span class="tag"></</span><span class="tag-name">i</span><span class="tag">></span><span> </span></span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">asp:Label</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"lblFriend"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">Text</span><span>=</span><span class="attribute-value">'<%# Eval("Status") %>'</span><span> </span><span class="attribute">CssClass</span><span>=</span><span class="attribute-value">" btn btn-twitter fa fa-user"</span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">asp:LinkButton</span><span class="tag">></span><span> </span><span class="tag"><</span><span class="tag-name">asp:LinkButton</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"btnNotFriend"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">ToolTip</span><span>=</span><span class="attribute-value">"follow user"</span><span> </span></span></li><li class=""><span> <span class="attribute">Font-Bold</span><span>=</span><span class="attribute-value">"True"</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">i</span><span> </span><span class="attribute">class</span><span>=</span><span class="attribute-value">""</span><span> </span><span class="attribute">style</span><span>=</span><span class="attribute-value">"margin-right: 2px"</span><span class="tag">></span><span class="tag"></</span><span class="tag-name">i</span><span class="tag">></span><span> </span></span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">asp:Label</span><span> </span><span class="attribute">ID</span><span>=</span><span class="attribute-value">"lblUnFriend"</span><span> </span><span class="attribute">runat</span><span>=</span><span class="attribute-value">"server"</span><span> </span><span class="attribute">Text</span><span>=</span><span class="attribute-value">'<%# Eval("Status") %>'</span><span> </span><span class="attribute">CssClass</span><span>=</span><span class="attribute-value">" btn btn-twitter fa fa-user-plus"</span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">asp:LinkButton</span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">ItemTemplate</span><span class="tag">></span><span> <br /></span></span></li></ol></div> </div>
Reply
Answers (
1
)
html simple registration form validation error
How to increase or decrease session timeout?