使用javascript打开弹出窗口
我想在我的 c#.net 应用程序中使用 javascript 打开一个弹出窗口。这是我的网络表单中正文标记中的代码,
<script language=javascript>
function openWindow(strEmail)
{
window.open('CheckEmail.aspx?email=' + strEmail + , 'Check Email','left=100,top=100,toolbar=no,scrollbars=yes,width=680,height=350');
return false;
}
</script>
这是我在 Page_Load 部分中的代码,
this.btnCheck.Attributes.Add("onclick", "return openWindow(" + txtEmail.Text + ");");
现在我正在尝试从文本框“txtEmail”传递字符串,因此在我的弹出窗口中我可以获取 request.querystring 但我是不太确定语法是怎样的。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不需要最后一个
+
获取查询字符串
,在 CheckEmail.aspx 页面中,您可以在 textEmail.Text 周围的函数内的 CS 端使用 Use a
'
No need of the last
+
and in CheckEmail.aspx page you can get the query string as
Use a
'
in the CS side inside the function around the textEmail.Text如果 txtEmail 控件可见,为什么不在客户端代码中获取电子邮件。
Why don't you get the email in the client code if the txtEmail control is visible.