I have a simple form for this scenario written in razor/webmatrix. I would like to have a user be able to login to an external website with the login credentials provided by my db.Query via a foreach loop. The login works if I don't use a foreach loop. It simply returns the first row from the DB Query, and logs in. When I add the foreach loop, it opens the login page without any credentials. Any help would be appreciated. My code is below:
var selectQueryString = "SELECT user_id,password FROM user_table
var user_row = db.Query(selectQueryString);
<form name="UpdateOrRac" method="POST" action="Login Page URL would be here">
@foreach (var row in user_row){
<div>
<input name="txtUserID" value="@row.user_id" readonly="readonly" />
<input name="txtPassword" value="@row.password" readonly="readonly" />
<input type="submit" value="Login" />
</div>
}
</form>