Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hi all,
i do have a requirement that to maintain the conversations between admin and user in my application. for thet i have created corresponding table to store the details in db, and also the functionality in c# is also completed, i.e retrieving corresponding info between these two. but i want to display their conversations as like facebook and whatsapp, type. i.e
13 march 2015
(right side)
user: hi
user: i've completed task.
(left side)
Admin: k, good,
Admin: please look at another
14 march 2015
Admin: please check your email once.
user: k, sure i will do it.
.......................like this i want.
how can i show this type of viewing in aspx page, please help me to slove this.
in order to show this i have taken one panel control and inside 2divs one for showing from and another for to messages. and also alignment is set. but it is static, in order to achieve above type of display we need to write in dynamic way, but i am unable to achieve that through dynamic coding, can anyone help me how to 2 write the code inorder to display in above format.
Posted
Updated 12-Mar-15 21:05pm
v2
Comments
Sinisa Hajnal 13-Mar-15 9:51am    
Have two columns of divs and depending who talks you write left or right while your layout stays static. Or you could put floats and absolute positions...or div across the screen and inside another div with float left or right and relative position.

Good luck

1 solution

Hi pavan,

you can try this one. I have tried it with background colour, and it worked. hope it will work with yours also.

Take a Repeater to show the message. And the only thing you have to maintain is the text-align, style property of the div. Here is the solution.

ASP.NET
<asp:repeater id="Repeater1" runat="server" xmlns:asp="#unknown">
     <itemtemplate>
        <div style="text-align:<%# Eval("align")%>">
            <%# Eval("message") %>
        </div>
     </itemtemplate>
</asp:repeater>


You need to get another column align. put the value of this in your stored procedure as the chat of admin or user (left & right).
try it..hope it will fixed your problem.
 
Share this answer
 
v2

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