Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show the full message when click on label message in asp.net?

Tags:

asp.net

at present i am displaying the full message at a time in label in grid like this.

<asp:TemplateField HeaderText="Message" ItemStyle-CssClass="gridlabeltextleftalign">
      <ItemTemplate>                        
                    <div style="word-wrap: break-word; width: 240px; text-align: left">
                              <asp:Label ID="lblMessage" runat="server" Font-Size="12px" Text='<%#DataBinder.Eval(Container.DataItem, "Message") %>'></asp:Label> 
                             </div>

                        </ItemTemplate>

                    </asp:TemplateField>

i want display message in single line when click on it then display the whole message .

pls tell me .

like image 277
Sravanti Avatar asked May 25 '11 06:05

Sravanti


1 Answers

show a fixed length string (not full message ->eg: mes...) at first.

Declare a protected string in page load and then bind it in each page load. After this directly assign the protected string to a javascript array.

see the code below:

In page load

      protected string protectedString = "";

In Javascript function that should be called on MouseOver event:

  JavascriptArray = "<%= protectedString %>";

Set the array as innerHTML of DIV.

Hope this helps...

like image 105
Harun Avatar answered Sep 28 '22 06:09

Harun