使用onmouseover在框架中渲染文本 [英] Rendering text in a frame with onmouseover
问题描述
假设:我想在与另一个框架中的网格分开的框架中呈现文本.当光标经过单元格时,必须渲染文本,而当我移出单元格时,文本必须消失.我得到了数据,但是很奇怪,如果两个单词之间有空格,尽管有数据,但文本不会出现.
Suppose: I want to render text in a frame separated from a grid in another frame. When the cursor passes over a cell the text must be rendered and when I move out the text must disappear. I get the data but strange if there''s a space between two words, the text will not appear, although the data are there.
我在转发器中检索数据,并使用repeater_itemdatabound操作它们.
I retrieve the data in a repeater and I manipulate them with repeater_itemdatabound.
代码:
Sub Repeater_ItemDataBound(ByVal s As Object, ByVal e As RepeaterItemEventArgs)
'here I retrieve the data
Dim reader As SqlDataReader = cm.ExecuteReader()
While reader.Read()
'Response.Write(reader("DSOmschrijving"))
If reader("DSOmschrijving") <> "" Then
var1 = 1
var2 = reader("DSOmschrijving").ToString
End If
End While
' Test to render them
' response.write(var2) ---> and indeed the text is rendered on
' the screen(principal frame).
' here the text must be in frame2
If var1 = 1 Then
LabDSCode.Text = "<td bgcolor='#999999'>" &
"<a href='details.aspx?ds=" & dataLLDCode &
"&didsug=" & var2 &
"' onMouseOver=parent.frames[1].document.open();parent.frames[1].document.write('" & var2 & "');parent.frames[1].document.close();>".ToString &
"     " & "</a>"
Else
End If
cn.Close()
reader.Close()
' If I delete all the spaces ( ) it works , but otherwise not.
如果有人知道解决方案?
If there''s someone who knows a solution ???
很多东西....
推荐答案
我假设您正在使用AJAX来完全正常工作. ;您为什么不将问题标记为关于ASP.NET?
I assume you''re using AJAX for this to work at all. Why did you not tag your question as being about ASP.NET ?
添加一个额外的表格元素对我来说似乎很奇怪,为什么不布置您的表格并只操作它的内容呢?
Adding an extra table element seems odd to me, why not lay out your table and only manipulate it''s contents ?
这篇关于使用onmouseover在框架中渲染文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!