How can I pass textbox value from usercontrol(ascx) to another page (aspx) using Server.Transfer()

StackOverflow https://stackoverflow.com/questions/6827196

  •  26-10-2019
  •  | 
  •  

Question

I am writing one user control (webpart) in kentico. I want to pass textboxes' value from usercontrol to aspx page using Server.Transfer().

Can it be? If so, how can I do like that?

Best Regards,

Reds

Was it helpful?

Solution

I don't particularly like this method, I prefer to use Sessions to pass data between pages, but if you need to do this here how it's done according to the this page.

Here's TL;DR summary. It requires three scripts/pages:

Form.ascx - this will be the control that contains the text box value.

FormParsingScript.aspx (referenced in the Form.ascx in the Action attribute) - this will perform the actual Server.Transfer "FinalScript.aspx" call

FinalScript.aspx which will display the contents of Response.Form["TextBoxName"] (HTTP POST) or Response.QueryString["TextBoxName"] (HTTP GET)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top