.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Interface TabPage not updating on host control

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :Windows Application
Ok so I've got this form in C# with an interface, a tab control, and a
toolstrip. The interface allows users to create custom tab pages and
toolstrip menu's that are then added to a menu of the main form during
start up. These plugins come from external dll's. The problem I'm
having now is that, when I attempt to update my plugin tabpage with
it's associated custom menu item, then main tab control never seems to
get the update. In a step through I can see the Interface "Page"
member for the plugin being updated correctly but when the form
finishes the delegate the actual page you see in the tabcontrol
doesn't seem to get the update. I've recently started trying to get a
delegate to pass down through to the plugin but was having some issues
and wondered if anyone else had any better idea's.

namespace Foo
	public class Foo
		void Main()
			Application.Run(new MainForm);
	public class MainForm()
		Button btnAddPlugin = new Button();
		ToolStripPanel tspMenus =  

View Complete Post

More Related Resource Links

Stored Procedures & SqlDataAdapter not updating a calendar control


Hi all,

I have a database linked to a calendar. I had a peice of code that retrieved dates from a database and populated the calendar. I wanted to tidy up my code using stored procedures (they seem neater & i assume there's a benefit somewhere). so i came up with this, however it's not working. The calendar displays, but it's not being populated with the database entries. The SqlCommand & SqlParameter I have working elsewhere in my code; as with the SqlDataAdapter (which also worked before i tried to conver to a stored procedure!) but combining these three (SqlCommand, SqlParameter & SqlDataAdapter) seem to be causing me problems.

It's probably something stupid but if someone could take a look and point me in the right direction, I'd be very grateful.


Public Sub dbConnection()
        dbConnString = ConfigurationManager.ConnectionStrings("connString").ConnectionString
        sqlConn = New SqlConnection(dbConnString)
    End Sub

Public Sub EquipmentDDLSelection()

        Dim dbCMD As New SqlCommand("PopulateCalendar", sqlConn)
        dbCMD.CommandType = CommandType.StoredProcedure

        Dim parameterBookedEvents As New SqlParameter("@bookedEvents", SqlDbType.VarChar, 50)

Help with updating database with values from Repeater control using c#


Hello, I'm new to ASP.NET 3.5 with C#. I really need some help.

I used a Repeater control to create a simple (editable) list where, when a user logs in, they can edit their list of expenses.  The ASP page works fine.

 My issue is with the code-behind.  I am really confused with how to extract the values from the repeater control. The FindControl method does not seem to be working.  Also, the code I am using resets my 'Amount' values back to 0.00. (0.00 is the amount the user sees when they first encounter the page).

 Here's a portion of the code on the ASP page:

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"





<td><asp:Label ID="lblExpId" runat="server"  Text='<%# Bind("ExpId") %>'></asp:Label> </td>

 <td><asp:Textbox ID="lblExpense" runat="server" Width= "190px" Text='<%# Bind("ExpenseName") %>'></asp:Textbox> </td>

 <td><asp:Textbox ID="txtAmount" runat="server" Width= "100px"

how to build Control Panel which help me in updating my website easily ?

Hello all , i'm here not to ask about code but i need experience i want to ask how to build powerful  Website how to build Control Panel which help me in updating my website easily ? am i have to reference everything and update it so website updated too( in my opinion this is not the correct way because it may reduce the performance )i thought that make DLLs would be better and i don't know that i'm right or not .....i want to ask you about your Experience in building websites and your efficient ways in your work ?also if there are any useful books for me to read please tell me about them i want to gain some experience because i'll work as free lancer programmer for a while and i have no experience Thanks in advance :) ,

Select multiple controls on tabpage, Drag & Drop control(s) (WinForms)


I'm wondering, if somebody got some code or thoughts for selecting multiple control displayed on tab page and drag & drop control on tab page it self. Something like on windows desktop, where you can draw a rectangel with mouse cursor to select folder and files. Also, drag folder or files to different location.



Changes to Properties in the Property Window not Updating in HTML Control


I'm using VWD 2010 Express and have found that when I change a property like AutoPostBack from within the property window the corresponding tag (<asp:TextBox...>) was not updated with the property change to the tag.

Is there a setting that I can change in the VWD properties that will enable changes through the property window for a control to automatically update the HTML tag for that control?

DataGrid control properties not updating on resize event


I have a DataGrid control on a form and I'm binding it to an ArrayList that is populated dynamically as the user scrolls.  The array list is pre-populated with blank records equal in number to the number of records in the DB.  As the user scrolls, if they stop in a place where there are blank records I populate that data from the DB.  I'm using the VisibleRowCount and VertScrollBar.Value properties to determine where I am in the DataGrid.  


The problem is that if I scroll to the bottom of the control then maximize the control it's resize event fires, the VertScrollBar is redrawn proportionally to the number of records, but the Value and VisibleRowCount remain unchanged.  If I then grab and scroll the scroll bar up then back down to the bottom, the Value and VisibleRowCount update correctly.  Is there a way for me to get these values some other way or to force the scroll bar to refresh/update manually?

updating problem with ObjectDataSource control


hi all, i got confused about updating method with ObjectDataSource control. Those parameters just a nightmare for me. I tried use those parameters implicitly and explicitly, but coudln't get it working.

The task is to update the data from txtIllness and txtDiagnosis according to selected consultationID.

Any helps are greatly apperciated.

Thank you

Here is the code

public class ShowConsultation
    private readonly string constring;
    string name = HttpContext.Current.User.Identity.Name;
    public ShowConsultation()
        constring = WebConfigurationManager.ConnectionStrings["SurgeryConnectionString"].ConnectionString;
    public SqlDataReader GetConsultation()

        SqlConnection con = new SqlConnection(constring);
        SqlCommand cmd=new SqlCommand();
        cmd.CommandText = "SELECT Consultation.consultationID,Consultation.Illness,Consultation.Diagnosis,Consultation.Date,Patient.firstName,Patient.lastName,Patient.DOB,Patient.suburb,Patient.postCode FROM Consultation,Practitioner,Patient WHERE Practitioner.UserName=@UserName AND Practitioner.GPNo=Consultation.GPNo AND Patient.patientID=Consultation.patientID";
        return cmd.ExecuteReader(Com

DataBinding not updating underlying business object when changing control property from code


I have a custom data form control that in code generates databindings between the selected custom business object (LLBL) and the various controls on the screen. Everything works in that I set the DataContext to the selected business object and the data appears in the GUI. If the user changes anything on screen, the data is getting updated into the business object.

However, now I have some custom logic that when the user presses a button I need to update some fields. Currently I'm setting this data directly into the controls, setting the new value into the property that is bound. However, the data is not getting pushed back into the business object.  I had this same issue building WinForm apps in that databinding only fired if the user was in the control and left it.

Does the same thing apply to WPF? How can I get ANY change on say a TextBox's Text property whether via user interaction or from C# code to push that value into the bound business object property?


dynamic javascript of an .ascx control not updating on client upon async postback


I have a confusing state issue. I found a way around it, but I would like to know why this is happening. First of all, I am using .NET 3.5 and that can't change right now (an easy fix may be the fixed ID capabilities of .NET 4.0).

Type csType = this.GetType();
ClientScriptManager cs = Page.ClientScript;
string jScriptBlockName = "SignUpSignInNameAvailabilityScript";
if (!cs.IsClientScriptBlockRegistered(csType, jScriptBlockName))
{   //NOTE: verified code always enters this
    StringBuilder cstext2 = new StringBuilder();
    cstext2.Append("function GetSignUpSignInNameAvailabilityMessage() { var id = '"
          + CreateUserWizardStep1.ContentTemplateContainer.FindControl("iSignUpSignInNameAvailabilityMessage").ClientID
          + "'; alert(id); return id; }");
    cs.RegisterClientScriptBlock(csType, jScriptBlockName, cstext2.ToString(), true);

This code is in Page_Load of an ascx. The same control is drawn on two separate postbacks of an UpdatePanel in different places of the page thus giving them different client IDs. The code works correctly on the first refresh of web browser; but after UpdatePanel

Updating the AJAX Control Toolkit from VS 2005 to either VS 2008 or VS 2010


At work we've got a ASP.NET app written using VS 2005.  At the time I downloaded and installed the AJAX Control Toolkit from off of this website.  We've been using it ever since, in that website.

Now I'd like to upgrade that website to either VS 2008 or VS 2010, but I'm concerned about the AJAX Control Toolkit.  If memory serves, I think that it came with VS 2008, and I would assume it certainly is a part of VS 2010.  Do I have to remove any reference to the AJAX Control Toolkit, before trying to upgrade it?  Or after upgrading it?  How do I make it reference the AJAX Control Toolkit that's a part of VS 2008/VS 2010?

Updating a text within a div tag with textbox control.


Hello everyone, I have a question regarding to the text in the html code. I would like to know if there is a way to change the content text in the html with text that has been written in textbox. For example i have following text in html, so how can I replace this text by using a text box in the server side.


I will be grateful if someone gives me a little help. Thanks,

Control Ubuntu iptables from Windows host


Hello. I am writing an application, that will control the routing on ubuntu iptables firewall. I need a reliable way to execute commands on linux machine, but instantiate these commands from my .net code on Windows machine. Which mechanism can you advise? Or should I write a second mono app, that my main app will comunicate with, and the mono app will issue commands locally?

Thank you in advance for a tip.

Max Pavlov http://maxpavlov.com

wizard control for updating entity


are there solution to use wizard control to update existing entity (not create new), i.e. need to pre-load data into wizard fields, may be use viewstate? in this case how to make it?

Command Binding not working when the host control is added programatically in wpf


This is weird. I have a UserControl (MyControl) with a button inside. I have added a command to this button whose command target is another user control which is again added to the same window.

When I add the UserControl statically in xaml to the CustomControl's host space, the CommandBinding system works fine, where as the same doesn't work if the UserControl is added programatically (on Loaded event of this Window).

What could be the reason. Am I missing something in here ?!?


A better representation of my words as an image. Also I have uploaded my source code with binaries @ https://code.google.com/p/commandbindingsample/

Image @ http://codelog.blogial.com/files/scenario.png


How can i dispose a WebBrowser Control which host on a UserControl


I found that, if I create a usercontrol that contains webbrowser, the usercontrol could not been disposed. Here is my code, could anybody help me?

public partial class Form1 : Form

    public class UserControl1 : UserControl 
      public UserControl1()
        this.Controls.Add(new WebBrowser());
        //this.Controls.Add(new TextBox());

      protected override void Dispose(bool disposing)

    public Form1()

    private void button1_Click(object sender, EventArgs e)

Updating Database with gridview control


I am sure I am not the first to ask this question but I cannot find an answer in these or any other forums. I guess I am not wording the question right.

In short I have a gridview populated but a database via an SQLDatasource. I have an Edit column in the datagrid and an updatequery in the datasource. When the Edit is click the line goes into edit mode, the user then clicks Update and I get an error. 

Could not find control 'DropDownList1' in ControlParameter 'Frequency'.

The only complication is that there is a drop down control when the "EDIT" column is selected. The dropdownlist gets it list from another SQLDatasource. This all works fine.

Here is the code snip:

        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateEditButton="True" 

            AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend