本文介绍了存储用户登录的UserID以便稍后在存储过程中用于DB插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2015中构建一个简单的VB WEb应用程序。 

I am building a simple VB WEb Application in Visual Studio 2015. 

我有一个有效的登录过程,为每个注册用户分配一个与其用户名绑定的'UserID',并在登录时进行验证。

I have a working login process that assigns each registered user a 'UserID' that is tied to their userName and verified upon login.

在应用程序中,用户可以注册某些事物,这些事物会触发在数据库中创建条目的存储过程。我通过下拉列表和文本框捕获大多数值,并且在INSERT
查询中没有问题传递给SQL存储过程。  

Within the app, the user can sign up for certain things which triggers a stored procedure that creates an entry in the database. Most values I capture through Drop Down lists and text boxes and have no issues passing to a SQL Stored procedure in an INSERT query.  

我遇到的问题是如何传递当前登录用户的UserID,而不提示用户在点击提交按钮之前输入自己的用户ID。 

The issue I am running into is how to also pass along the UserID of the currently logged in user without prompting the user to enter their own userID before hitting the submit button. 

我已查看过申请状态和会话状态,但实施时遇到了问题。 

I have looked into Application State and Session State, but am having trouble implementing. 

https://msdn.microsoft.com/en-us/library/ms178594.aspx

https://msdn.microsoft.com/en-us/library/ms178594.aspx

https://msdn.microsoft.com/en-us/library /94xkskdf.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1

https://msdn.microsoft.com/en-us/library/94xkskdf.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1

https://msdn.microsoft.com/en-us/library /z1hkazw7.aspx

https://msdn.microsoft.com/en-us/library/z1hkazw7.aspx

https://msdn.microsoft.com/en-us/library/6ad7zeeb.aspx?cs-save-lang=1&cs-lang=vb#code -snippet-1

https://msdn.microsoft.com/en-us/library/6ad7zeeb.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1

任何指导或提示都将不胜感激。

Any guidance or tips would be appreciated.

推荐答案

另请参阅Web开发的地方: https://forums.asp.net/

See also the place for Web development: https://forums.asp.net/


这篇关于存储用户登录的UserID以便稍后在存储过程中用于DB插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 19:55