如何访问“开始页面”? aspx.cs page_load代码中的值? [英] How do I access an "opening page" value in aspx.cs page_load code?

查看:126
本文介绍了如何访问“开始页面”? aspx.cs page_load代码中的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含带有用户名的文本框的html页面。



上面的一个按钮使用window.open来打开一个aspx弹出窗口将显示用户的配置文件信息以进行编辑。



我需要在aspx.cs的Page_Load函数中查询我的数据库,以便用用户填充aspx页面信息。



问题:如何获取Page_Load函数的用户名,以便我可以运行SQL查询?



谢谢



我的尝试:



aspx.cs页面不知道window.opener ...因此我无法通过它访问html页面的元素。

I have an html page containing a textbox with a user name.

A button on the above page uses "window.open" to open an aspx popup which is going to display the user's profile information for editing.

I need to query my database in the aspx.cs's "Page_Load" function to populate the aspx page with the user's information.

Question: How do I get the user's name to the Page_Load function so I can run the SQL query?

Thanks

What I have tried:

The aspx.cs page doesn't know about "window.opener..." so I can't access the html page's elements through that.

推荐答案

单向要做到这一点是在window.open()方法中将userid添加到查询字符串。然后,正在打开的页面可以从查询字符串中获取值。
One way to do it is in the window.open() method add the userid to the querystring. Then the page that is being opened can get the value from the querystring.


这篇关于如何访问“开始页面”? aspx.cs page_load代码中的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆