Cathryn Posted November 4, 2003 Posted November 4, 2003 I have an aspx page that loads a ascx control. On the ascx page, I have text fields that I would like to store the users input into session variables. How do you set that up with ascx pages? Do I declare the session variables on the aspx page that loads the control or can I do it on the ascx page? Does anyone have examples of doing exactly this?:) Quote
Moderators Robby Posted November 4, 2003 Moderators Posted November 4, 2003 You can do the session variable save from whichever pages' event triggers it. Quote Visit...Bassic Software
Cathryn Posted November 4, 2003 Author Posted November 4, 2003 So on the page load of the aspx page, do I declare the session variable? For example: If Page.IsPostBack Then 'Load report generated from input Else Session("Subject") = "" SubPageCtrlMain = LoadControl("modules/dcInput.ascx") MainPage.Controls.Add(SubPageCtrlMain) End If There is an excute query button on the dcInput.ascx page which automatically posts back to above. I can't get it to do any execution on it's own even. (asp:button) So, how would I then save the client input? Quote
abarham Posted November 5, 2003 Posted November 5, 2003 Try... <asp:LinkButton OnCommand="btn_Click"</asp:LinkButton> <script language="VB" runat="server"> Sub btn_Click() Session("Subject") = "Hello" Response.Redirect(Request.ApplicationPath) End Sub </script> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.