User Control Issues (ascx)

  Ok, so i'm a newb when it comes to ASP.NET, so i'm sure this will be a dumb question.    Everything i've always done is WinForms.

 

I have a main page.. with a Title and Navigation menu. When clicking one of the linklabels on the navi bar, it dynamically populates a panel with a user control. 

This control has a drop down on it. 

The problem i'm having is, when the drop down index is changed... the code behind doesn't execute AND it causes post back and the user control then dissappears. 

 

suggestions?

0
Firemaple
5/4/2009 3:38:57 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
1102 Views

Similar Articles

[PageSpeed] 20

Post some code on what you are trying to accomplish. Sounds like a nasty problem.


Mark as answered for quick learning. Mark as don't understand for the concept.
0
xequence
5/4/2009 4:33:48 PM

the problem is the viewstate is not maintained.  therefore dynamic control will disappear on postback


Lynn

Please mark replies that have helped you as answers.

http://www.sis.pitt.edu/~lberan/collegeMathTutorPittsburgh/index.html
0
lberan
5/4/2009 4:37:41 PM
Reply:

Similar Artilces:

Web User Control to Web User Control...
Hi, I have 2 User controls on a page and want Control1 to call a method of Control2. Is this Possible? Example: Con1 = Datalist showing products, each with a Quantity Box and a Button. Con2 = Repeater showing Cart Preview (name, Price) in page.aspx. When I click on the button on the DataList in Con1 it adds the item into the Session based Cart. However it does not update the Cart Preview. I need to call BindPreview() in Con2 in order to update the Cart Preview... Does that make sense? argh! any help much appreciated! PeteWeb Design Nottingham, UK Well I can call BindPreview() from m...

access controls on web user control x from web user control Y
I have 2 web users controls in a page and I would like to get or set the selected values of a few dropdown boxes on web user control X from web user control Y and I also would like to know how to access functions that are on a web user control X from a web user control Y, is this possible? How can I do it? User can access and set the values of the User Control from .aspx page through properties,using javascript and in code-behind of aspx page.The details of it are shown below Using PropertiesIf the Sample.ascx control has two textboxes and submit button.You can access the valu...

calling user control (.ascx) in web form?
Hi, I have a user control file which is displaying a data grid, the code including "Sub Page_Laod()" ... Originally, this part is in my .aspx page ... now I seperate it in a user control file, and use <%@ Register TagPrefix="dg" TagName="dgCC" Src="\ss1\control\dg.ascx" %> to call the user control file in my .aspx page. I have 2 questions ... 1) which one is faster? Using user control or includes the data grid part in my .aspx page directly? I create a user control coz' other pages might need to use the same data grid. 2) In my user control page,...

Problem in accessing web form data in user controls when create user control dynamically
HI. I have a problem using web user control. I designed a user control named NewsForm. This user control contains some web form elements like <asp:textbox>. When I add it in an .ASPX page, all things may be true. I can know which user filles in textbox (for example and other controls) <%@ Register TagPrefix="uc1" TagName="NewsForm" Src="NewsForm.ascx" %> and <UC1:NewsForm id="newsForm" runat="server"></UC1:NewsForm> But when i create it in code behined dynamically, however user control has web form controls but their value are blank for example //aspx co...

Web Form and Web User Control
Hello, I have a Web User Control (ascx) that includes a button. This button has an onclick event method. This Web User control is included into a Web Form. (thru LoadControl). However, when I click on the button, the event method is not executed. What should I include in order it works fine? Thanks in advance. GAA. Using Loadcontrol is using dynamic controls and when using dynamic controls you must recreate the same dynamic controls ono postback to econstruct the page control tree. It is best if you do this during the Page PreInit event. How complex are your controls ...

How to access individual controls from a form containing the web user control containing those controls
 Below is a block of code in my .aspx form named default.aspx. In this form I load a web user control. I then add it to a place holder control.(Lines 3 and 4 below) So how do I access the individual controls in my web user control? I want to set the properties on those controls, but I am baffled as to how to access the control. For example I have a text label control named "label3". How do I access this control. Because for example, under certain situations I want to hide that control. ( Label3.Visible = false;)  1    if(!Page.IsPostBack) 2&nb...

Calendar control in web user control (ascx)
I have a web page called calendar.aspx It has calendar control and onselectionchanged i have a procedure (Change_Date). Protected Sub Change_Date(ByVal sender As System.Object, ByVal e As System.EventArgs) If Not Request.QueryString("textbox") Is Nothing Then Dim strScript As String = "<script>window.opener.document.forms(0)." + Request.QueryString("textbox").ToString + ".value = '" strScript += CalPopup.SelectedDate.ToString("MM/dd/yyyy") strScript += "';self.close()" strScript += "</" + "script>" RegisterClientScriptBlock("Calendar_ChangeDate", strScript) End If ...

custom web user control and web form
Guys,          I am trying to develop a context menu control for all of my pages. what i am trying to do is that i want the control to pick a datasource from the markup and then check whether its an xml file or a datatable. I created a class called datasource.   /**************************DataSource Class****************************/  public class DataSource { /// <summary> /// This is to identify unique elements from the markup /// </summary>protected string _ID; /// <summary> /// This will be the Datasource ID e...

Web User Control Not rendering in Web Form
I have created a Web User control that is made up of a Multiview with 2 views inside the Multiview. I have buttons on both views and a gridview on 1 view. My question is when I drop this Web User Control on a Web Form all I see is [MultiView"MultiView1"] and when I view the from in the browser I dont see the Web User Control. I was wondering if someone could please tell me why the Web User Control is not displaying or rendering.     Thanks In Advance Hi, Please check your aspx file for correct reference, like following example: TestControl.ascx:<%@ Control ...

Validating web user control(ascx) in parent page (aspx) -- .NET 1.1
Hi,  I have a user control which has some asp.net server controls like drop down list, list box etc. These fields are required. I'm using this control in a parent page which has its own server controls which are also required. The button on the parent page which is supposed to validate the controls is not working after I add the web user control.  Is there a work-around for this scenario  other than manually calling Page.Validate() and checking for Page.IsValid property ? I tried calling a javascript on button click which calls Page_ClientValidate() whic...

web controls and web user control
i have a problem in a web form , I have a webform that contains a web user control which in turn contains a html input form ,the web control events don't fire up ,When I click button ,no effect ,I don't know what is the effect of the html form which is in the web user control on the web controls in the web form ?? can any one help me the web control event should be handle in the code behind page, is the event handler for the button you are clicking registered? You can try double clicking the button, should give you the default btn_click event handler in code behind. Also, make ...

Persisting data in a web user control, which contains a list of other web user controls.
 Hi All, I have a control I've created, which can have a number of child controls - also user controls - stored as an ArrayList, which can be added wither a design time or programmatically.My problem is when I add to the list programmatically, it doesn't persist them. So if I add 3 child controls in step 1 of a wizard, with the aim that those three will be visible inside the parent in step 3, what happens is that the parent has no child controls and the item count is 0.Can anyone help? Thanks in advance.Code:Parent Control Markup: <%@ Control Language="C#" Auto...

Solution for web forms that look just like paper forms ? User controls ? Adobe fillable forms ?
 I am looking at ways to web-enable a series of company forms that need to have the form itself look just like the paper version.  It would be great if I could use an image of the form itself as a background, and then draw the UI components on top of this.  Then there is the question of printing these forms complete with the data that was filled in.   What are some options for doing this kind of application ?  Im open to 3rd party solutions as well.  Our company currently has a desktop application which does this, but I want to come up with a web based solu...

Access a Web User Control Method from a Web Form
I'm trying to pass the Selected Index value from a web user control in a web form to the user controls selectedIndexchanged Sub.  I can't seem to figure out how to pass the information that I need to the user control and have it execute the sub routine. In the SelectedInedxChanged Sub I have a switch Statement and I want to get the index value from the web form where the user control is located and compare it to each case and then to have it execute the code for the case that it matches. What do I need to do? Hi, I am not sure if I understood your question correctly. I su...

Access SqlDataSource on Web Form from a Web User Control...
Hello, I want to access a SqlDataSource on a Web Form fromout. a Web User Control. To do this, I have in my code behind of the Web User Control the folowing code: DropDownList1.DataSource = (this.Page.FindControl("SqlDataSource3") as SqlDataSource);DropDownList1.DataTextField = "Name;DropDownList1.DataValueField = "NameIDropDownList1.DataBind(); But, the control (ic. SqlDataSource3) is not found. Even other controls like labels and buttons are not found with the FindControl. What am I doing wrong? Thanks Andromedaris     This is not much of a surprise,...

Web resources about - User Control Issues (ascx) - asp.net.web-forms

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Now you can control your GoPro Camera from Apple Watch
One of the nicest features of the GoPro camera is the ability to control it using the iPhone app. With the GoPro App , you can easily control ...

Control a car's features with a glance? Not science fiction
Filed under: Emerging Technologies , Infotainment , Technology Press a button to change your car's climate controls? Turn a knob to view your ...

Arizona leaders welcome 'Leave No Child Behind' successor, less federal control
azcentral.com Arizona leaders welcome 'Leave No Child Behind' successor, less federal control azcentral.com The Senate gave final approval ...

FTC and healthcare cost control
... Pennsylvania, and lead to reduced quality and higher health care costs for the area’s employers and residents….the merged entity would control ...

Google seems more determined than ever to take control of Android
... to ad money. However, Google grabbed the lion’s share of the smartphone market by giving Android away. That means it lost the ability to control ...

Fox Presents Ben Stein As An Awesome, Stupendous Gun Control Genius
Fox News host Neil Cavuto was super-impressed with “great writer and thinker” Ben Stein's opposition to gun control. “The problem is not gun ...

Jennifer Hudson On Gun Control: ‘We Are Acting Like Animals. We Need It’
Jennifer Hudson On Gun Control: ‘We Are Acting Like Animals.

The NFL Should Seize Control Of The Cleveland Browns
Drew Magary’s Thursday Afternoon NFL Dick Joke Jamboroo runs every Thursday during the NFL season. Email Drew here . Read more...

Shocking Facts About U.S. Gun Control
The Second Amendment has been the subject of debate for centuries now, and you might be surprised to find where that still-unsettled dispute ...

Resources last updated: 12/10/2015 10:00:39 PM