关于网页表格 我想实现一个功能,就是让用户自己选择要显示的网页中的表格的行和列.比如说看股市行情中,用户自己可以选择要看的股票的名称,最高价格,最低价格, 成交量,最新报价等等.他可以选择看这些栏目中的几个和看哪些股票.谢谢啊. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在代码里用response.write输出html的table语句,当然具体要根据设置的条件实现,这是基本思路,所谓的用代码“画”表格 选择要看的信息的时候,在后台输出相应的要显示的东西的HTML代码,用ICallbackEventHandler接口来实现,这样可以实现同步,直接返回到客户端来显示 给你段参考代码public string GetCallbackResult() { if (!string.IsNullOrEmpty(ChatTo)) return FormatMessage(MessageManager.GetNewMessages(MaxId, ChatTo)); else return ""; } protected string FormatMessage(List<Messaging.DataProvider.MessageRecord> messages) { if (messages.Count == 0) return ""; string temp = ""; ArrayList messageId = new ArrayList(); foreach (Messaging.DataProvider.MessageRecord i in messages) { temp += "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">"; temp += "<tr>"; temp += "<td align=\"left\" width=\"100%\">"; if (i.ReceiveOrSend == false) temp += i.ChatTo + "对我说:"; else temp += "我对" + i.ChatTo + "说:"; temp += i.SendTime + " </td>"; temp += "</tr>"; temp += "<tr>"; temp += "<td width=\"100%\" align=\"left\"><font color=\"#C66FFF\">"; temp += i.Content + " </font></td> </tr> </table>"; messageId.Add(i.ID.ToString()); MaxId = i.ID; } return temp; } public void RaiseCallbackEvent(string Max) { MessageManager.UpdateIsRead(MaxId); } 上面是一个ID为messageSession1的DIV <script type="text/javascript" language="javascript"> function <%#this.ClientID%>_CallBack(){ <%# Page.ClientScript.GetCallbackEventReference( this, "", this.ClientID + "_GetResult", "")%>; } function <%#this.ClientID%>_GetResult(result){ if(result!="") { document.getElementById("messageSession1").innerHTML+=result; document.getElementById("messageSession1").scrollTop +=99999999; } } i=window.setInterval("<%#this.ClientID%>_CallBack()",1000); </script> 3道面试踢,来看看自己的水平? 下面的功能代码怎么写啊 大家帮我出个注意吧..最近的工作我很迷茫 Ajax 返回值 datalist里的ItemCommand事件求助 asp.net是干什么用的? javascript问题 双击listbox里面的选项,怎么样进行触发事件??? 为什么把datagrid的ButtonColumn由 HyperLink 改成 pushbutton 后 事件无法响应? 怎样动态添加DataGrid的列? 一个返回错误? 对一篇长文章进行分页,50分送上。
public string GetCallbackResult()
{
if (!string.IsNullOrEmpty(ChatTo))
return FormatMessage(MessageManager.GetNewMessages(MaxId, ChatTo));
else
return "";
} protected string FormatMessage(List<Messaging.DataProvider.MessageRecord> messages)
{
if (messages.Count == 0) return "";
string temp = "";
ArrayList messageId = new ArrayList();
foreach (Messaging.DataProvider.MessageRecord i in messages)
{
temp += "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">";
temp += "<tr>";
temp += "<td align=\"left\" width=\"100%\">";
if (i.ReceiveOrSend == false)
temp += i.ChatTo + "对我说:";
else
temp += "我对" + i.ChatTo + "说:";
temp += i.SendTime + " </td>";
temp += "</tr>";
temp += "<tr>";
temp += "<td width=\"100%\" align=\"left\"><font color=\"#C66FFF\">";
temp += i.Content + " </font></td> </tr> </table>";
messageId.Add(i.ID.ToString());
MaxId = i.ID;
}
return temp;
} public void RaiseCallbackEvent(string Max)
{
MessageManager.UpdateIsRead(MaxId);
}
上面是一个ID为messageSession1的DIV
<script type="text/javascript" language="javascript">
function <%#this.ClientID%>_CallBack(){
<%# Page.ClientScript.GetCallbackEventReference( this, "", this.ClientID + "_GetResult", "")%>;
}
function <%#this.ClientID%>_GetResult(result){
if(result!="")
{
document.getElementById("messageSession1").innerHTML+=result;
document.getElementById("messageSession1").scrollTop +=99999999;
}
}
i=window.setInterval("<%#this.ClientID%>_CallBack()",1000);
</script>