我们如何在javascript上调用aspx.cs函数 [英] how can we call aspx.cs function on javascript

查看:282
本文介绍了我们如何在javascript上调用aspx.cs函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在JavaScript或弹出窗口加载时调用aspx.cs函数?

我希望单击页面上的任何链接,如果这是当前用户的第一次,它将显示一个弹出窗口,要求在弹出的文本框中输入他的名字,然后单击提交.提交后,此值将保存在数据库中.

帮帮我.

How can we call an aspx.cs function on javascript or on popup window load?

I want that on click of any link of page, if it is the first time by the current user, it shows a pop up, asks to enter his name in the textbox of popup and click on submit. After submitting this value will be saved in a database.

Help me.

推荐答案

After getting your requirement the solution i think is that

1. you create a page on which you put the links.
2. by clicking that link you want to show a pop up to get the 'Name' of user, so i think you shoud create another .aspx page and on the click of link open the new page as a popup fill the required fields on that page and on the submit button send the 'user name' on the first page using query string.
3. on the first page you can check if there is some value in query string you can save it in database.


类似于 PageMethod 最适合您的情况. Google for PageMethod.
Sounds like PageMethod fits in best in your case. Google for PageMethod.


这篇关于我们如何在javascript上调用aspx.cs函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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