获得地址栏的地址 我直接在后台代码中给文本框赋值,也就是把地址栏的完整地址获得再赋值给文本框怎么做啊?文本框后面有个“复制链接”的按钮,那再怎么复制列? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1. 取得地址栏的完整地址String currentURL = Request.Url.AbsoluteUri; String URL =Request.Url.ToString()参考 一、应用JavaScript代码获取:<script language="javascript">alert(document.location.href);</script>二、应用ASP代码获取:<%a=request.servervariables("server_name")%><%b=request.servervariables("script_name")%><%="http://"&a&b%> 2. 文本框后面有个“复制链接”的按钮,那再怎么复制列?<input id="Button" type="button" onclick="SelectCopy()" value="复制到粘帖板" /><asp:TextBox ID="TextBox1" runat="server" Width="594px"></asp:TextBox><script type="text/javascript" language="javascript">function SelectCopy() { if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0") { document.getElementById('<% = TextBox1.ClientID %>').focus(); document.execCommand('SelectAll'); document.execCommand('Copy'); } else { alert("Sorry, this only works for InternetExploder") }}有点缺陷,只支持IE~~ 急~~vs2005 web应用程序如何转换成web网站 文本框里的那些破事 gridview的简单问题 有哪位高手会修改yetanotherforum这个论坛的版权啊 1212 VS编辑器 每次从HTML 点设计页面编辑器报错重启~ 怎么样实现在asp.net页面中把datagrid中的数据导入excel中?? 如何把变量插入到html中啊。 B\S是什么(老鸟的菜问题) 在C#里有没有类拟于字符串取左边N个字符,或右边N个字符,或从中间取N个字符的函数!!在线等,解决后给分 ilist添加数据困惑? 求生成Code128A条码的web源码!
String currentURL = Request.Url.AbsoluteUri;
<script language="javascript">
alert(document.location.href);
</script>二、应用ASP代码获取:
<%a=request.servervariables("server_name")%>
<%b=request.servervariables("script_name")%>
<%="http://"&a&b%>
<asp:TextBox ID="TextBox1" runat="server" Width="594px"></asp:TextBox><script type="text/javascript" language="javascript">function SelectCopy() {
if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0")
{
document.getElementById('<% = TextBox1.ClientID %>').focus();
document.execCommand('SelectAll');
document.execCommand('Copy');
}
else
{
alert("Sorry, this only works for InternetExploder")
}
}
有点缺陷,只支持IE~~