Web user control in asp .Net page - asp.net

i have a dropdown control with Listitems in Web User control. Am using the web user control in an asp .net page. using find control am able to find the control dropdown but could not get the itemlist. Can any body help me to resolve the issue...?

You should not need to use find control. Expose it as a property of your web user control instead.
If you still want to use FindControl, it is likely you can not find the item list because FindControl does not return a DropdownList. You will need to cast the control returned as a DropDownList to access its Items property

Related

Have to bind data to User Control using Telerik RadGrid inside another user control?

Basically I have created a user control containing a Telerik RadGrid, inside the control I have another two controls that have Telerik RadGrid inside them. I am trying to bind the modified data back into the User Control inside the parent user control. I have checked that the data is correct after they have been edited but when the form is binded again the inner controls have the same data as the form is first loaded. I am using RadWindow. Coworkers have suggested that it works with asp.net form controls however it seems that there is an issue with Telerik controls. Is there a easy way to force a rebind of the control?
There is a Rebind() method you can call to enforce this. This method causes the refresh and reloads the data and calls NeedDataSource.

How to make a UserControl object behave as a Design-Time control container in "ASP.NET"

How to make a UserControl object behave as a Design-Time control container in "ASP.NET". I want to be able drag any controls inside UserControl in design time. I found this but it is for Windows Forms and not for ASP.net WebFoms.
You can't drag controls into the user control from the designer-view of the page, but you should be able to drag controls from the designer-view of the user control.
If you're looking for something more than that, you'll need to develop a custom server control that inherits from TemplateControl, and you'll need to specify the correct attributes so that it's usable in the design-view.

ASP.NET custom server control not retaining values after post back

I have a custom server control (composite control having dynamically created dropdown boxes and textboxes). I have enabled AJAX in order to avoid page reload.The server control is used inside the ASP.NET webcontrol having few buttons which controls the visibility of the server control. Now I enter values in the dropdown box and texboxes and click on any other button. After this postback the last entered values are gone! The control is not remembering the values. Can anyone help me? How can I retain the values after post back?
Ensure that the controls are given the exact same ID after each postback. Also you might want to try initialising your dynamic controls (DropDownList and TextBox) during Page_Init if possible.
If your custom server control is create dynamically all the controls, then you need to recreate them on every post, and you need to create them before the Page_Load(), or else the asp.net cant know them to filled with the post data.
To solve this, if you can not create them before the Page_Load(), then you can fill them by your self with the posted data by using the Request.Form[YourCustomControl.UniqueID] for all controls.
You need to re-create on each postback, see This article

Can you set a asp.net web user control property using jQuery?

Can you set a asp.net web user control property using jQuery
I don't think it's possible, since the controls' properties are evaluated before the PreRender phase. Every property setting made by jQuery happens after the page is rendered so it's useless.

Redirecting Data From One WebForm to Another

I'm using the Infragistics tool for ASP.NET.
I have a WebForm, webform1, where I placed a WebDataGrid control of infragistics. Now, I want a user to select the row and have it redirect the data to a textbox on another WebForm, webform2.
How can I get the selected row from webform1 to webform2?
You have a number of options:
You can reference the PreviousPage property in the Page property of WebForm2. See Cross Page Posting in MSDN for more information.
You could do a Response.Redirect and then URLEncode your values and send them in the QueryString as GET values which can be referenced from the next page.
You can change your logic so that you encapsulate all of the functionality you require onto one Web Form, using either a MultiView or Wizard control.

Resources