这就是我所拥有的。具有文本框和搜索按钮的sharepoint页面。文本框数据绑定到我的所有表格,并根据键入文本框的公司代码填写它们。
我正在尝试添加一个网址,该网址还会将用户带到新页面,在该网页上,他们会看到根据他们在原始文本框中输入的公司代码过滤的共享点列表。
到目前为止,我可以通过硬编码网址将网址转到我选择的任何公司:
http://mysite/Lists/Call%20Log/Company%20by%20Category.aspx?View={7C16BC72-8F1A-457A-9908-AF9E66DE97DC}&FilterField1=LinkTitle&FilterValue1=abccompany
无论出于何种原因,我无法或无法弄清楚如何设置filtervalue1 = <<text from textbox>>
。
以下是代码示例:
<WebPartPages:SPProxyWebPartManager runat="server" id="ProxyWebPartManager">
</WebPartPages:SPProxyWebPartManager>
Enter the CO ID and click "Search"
<asp:TextBox runat="server" id="tb_coID" Width="83px"></asp:TextBox>
<asp:Button runat="server" Text="Search" id="Button1"/>
<a target="_blank" href="http://site/Lists/Call%20Log/Company%20by%20Category.aspx?View={7C16BC72-8F1A-457A-9908-AF9E66DE97DC}&FilterField1=LinkTitle&FilterValue1=<<text from textbox here>>">
Click Here </a>to view Call Logs
答案 0 :(得分:0)
万一其他人在看这是我想出的问题的答案。
<script type="text/javascript">
function showReport() {
var coid = document.getElementById('ctl00_PlaceHolderMain_tb_coID').value;
window.open("http://site/Lists/Call%20Log/Company%20by%20Category.aspx?View= {7C16BC72-8F1A-457A-9908-AF9E66DE97DC}&FilterField1=LinkTitle&FilterValue1=" + coid, "_blank");
}
</script>
<WebPartPages:SPProxyWebPartManager runat="server" id="ProxyWebPartManager">
</WebPartPages:SPProxyWebPartManager>Enter the CO ID and click "Search"
<asp:TextBox runat="server" id="tb_coID" Width="83px"></asp:TextBox>
<asp:Button runat="server" Text="Search" id="Button1"/> & nbsp;
<a href="javascript:void(0);" onclick="showReport();">Click Here</a> to view Call Logs related to this Company<br>
<br>
我只需将这些代码行添加到我的页面顶部,它的工作效果非常好