Often, if something is in the UserControl, it is either because the functionality in the control is significant enough to be split into its own reusable container, which could be reused on another page. If this control will actually be reused on another page, it really should not refer to the query string parameters, because the control should not make any assumptions about which page it is on. What if this control is included on another page whose query string parameters are named differently? Or maybe on another page this value will come from a database or ViewState or will it be automatically determined in some way? So my general rule is that if you are going to create a UserControl, never, never make any assumptions about which page it is placed on.
Like most people, you can still access the Request.QueryString property inside the UserControl, but this is probably not a good idea. Creating a property in a control that is set on a container page is a much better idea.
The best idea, in my opinion, and what I almost always do is to create a LoadData control method (or something like that) in a control with parameters for all the required query string values. Thus, you have one entry point for this data, so itโs clear at what point these values โโare set and what they get. If you go along the property path, there is always a problem if all the properties were set and whether they were set at the right point in the page life cycle (there may be difficulty during postback)
source share