test.Controls.Add(GetButton(thisReader["session_id"].ToString(), "Join Session"));
I made a modification to the code above, switching it to:
test.Controls.Add(GetButton(thisReader["session_name"].ToString(), "Join Session"));
The reason for this change was to use the session_name in the URL instead of session_id. However, this caused issues as the results on the next page were not displayed correctly due to session_id not being passed. For more details, please see the original question asp.net url generation.
Response.Redirect("EnterSession.aspx?session=" + e.CommandArgument.ToString());
How can I resolve this problem?
C# portion of entersession.aspx:
public partial class _EnterSession2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SessionID.Value = Request.QueryString["session"];
// Label2.Text = DateTime.Now.ToString();
if (User.Identity.IsAuthenticated)
{
string userName = User.Identity.Name;
//Username.Value = User.Identity.Name;
Username.Value = userName.ToLower();
HiddenField1.Value = User.Identity.Name;
}
}