如果用户登录时单击锚点标签,如何将Dateils插入Db中 [英] How To Insert Deatils Into Db If I Click On The Anchor Tag When User Logged In

查看:172
本文介绍了如果用户登录时单击锚点标签,如何将Dateils插入Db中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个锚标记,如果我单击它应该执行两个操作,一个是它应该检查用户是否登录,如果用户登录了,我想在db中插入一些详细信息,第二件事是,如果用户未登录它应该显示弹出窗口中的标志..请告诉我如何使用

Hi,



i had a anchor tag if i click on that it should perform two actions one is it should check whether user logged in or not,if user logged in i want to insert some details in to db,second thing is that if user not logged in it should show the sign in pop up..please tell me how to approach

推荐答案

1.在aspx页面上声明链接OnClick事件.
2.在页面后面的代码中定义OnClick事件.
3.在事件内部,检查是否已登录User.为此,请检查Session或存储了User登录详细信息的内容.
4.如果已登录用户,请创建与数据库的连接,并使用ADO.NET对象执行CRUD操作.
5.如果没有,请显示带有登录控件的 jQuery 模态弹出窗口.
1. Declare the link OnClick event on aspx Page.
2. Define the OnClick Event in Code Behind Page.
3. Inside the Event, check if User is Logged In or not. For that check the Session or something in which you have stored the User Logged In details.
4. If User is Logged In, create connection to Database and using ADO.NET objects do your CRUD operations.
5. If not, show jQuery Modal Popup with the Login Controls.


这篇关于如果用户登录时单击锚点标签,如何将Dateils插入Db中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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