ASP. NET and JS show record information on layers

Source: Internet
Author: User

JS file (named Function. js here)

Function MM_reloadPage (init)
{// Reloads the window if Nav4 resized
If (init = true) with (navigator) {if (appName = "Netscape") & (parseInt (appVersion) = 4 )){
Document. MM_pgW = innerWidth; document. MM_pgH = innerHeight; onresize = MM_reloadPage ;}}
Else if (innerWidth! = Document. MM_pgW | innerHeight! = Document. MM_pgH) location. reload ();
}
MM_reloadPage (true );

Function MM_findObj (n, d)
{// V4.01
Var p, I, x; if (! D) d = document; if (p = n. indexOf ("? ")> 0 & parent. frames. length ){
D=parent.frames[n.substring(p%1%].doc ument; n = n. substring (0, p );}
If (! (X = d [n]) & d. all) x = d. all [n]; for (I = 0 ;! X & I <d. forms. length; I ++) x = d. forms [I] [n];
For (I = 0 ;! X & d. layers & I <d. layers. length; I ++) xw.mm_findobj(n,d.layers+ I }.doc ument );
If (! X & d. getElementById) x = d. getElementById (n); return x;
}

Function MM_showHideLayers ()
{// V6.0
Var I, p, v, obj, args = MM_showHideLayers.arguments;
For (I = 0; I <(args. length-2); I + = 3) if (obj = MM_findObj (args [I])! = Null) {v = args [I + 2];
If (obj. style) {obj = obj. style; v = (v = 'show ')? 'Visible ':( v = 'hide ')? 'Ddden ': v ;}
Obj. visibility = v ;}
}

Create a template column in The DataGrid

<Asp: TemplateColumn>
<ItemTemplate>
<Div onMouseOver = "MM_showHideLayers ('layer <% # DataBinder. eval (Container, "DataItem. f_ID ") %> ','', 'show') "onMouseOut =" MM_showHideLayers ('layer <% # DataBinder. eval (Container, "DataItem. f_ID ") %> ','', 'hide') ">
<Font color = blue> <U> details </U> </font>
</Div>
<Span id = 'layer <% # DataBinder. eval (Container, "DataItem. f_ID ") %> 'style =" position: absolute; left = 420; top: 100; width: 300; z-index: 1; layer-background-color: # FFFFCC; border: 1px none #000000; visibility: hidden; ">
<Table width = "100%" border = "0" cellpadding = "10" cellspacing = "1" bgcolor = "#000000">
<Tr>
<Td bgcolor = "# FFFFCC">
<% # DataBinder. Eval (Container, "DataItem. f_Memo") %>
</Td>
</Tr>
</Table>
</Span>
</ItemTemplate>
</Asp: TemplateColumn>

Include <script src = Function. js> </script> (if the JS file is in the same directory as your aspx file), f_ID in the template column above is to display the table's primary key (that is, DataKeyField in the DataGrid ), f_Memo is the information displayed when you move your mouse over "details.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.