user-controls

User control retains focus incorrectly after TextChanged postback when UC is contained within a detailsview control

柔情痞子 提交于 2019-12-25 04:43:26
问题 I reference a previous post: Focus lost on partial postback with UserControls inside UpdatePanel where an excellent solution works perfectly for web-page controls within a form. However, I have placed my UC inside a detailsview template-field (for Edit+Insert). The UC contains an UpdatePanel needed to adjust the text-formatting and control's style(s) following the TextChanged event of the UC-textbox (AutoPostback=True) during the Edit-mode and Insert-modes of the DetailsView. As such, when

can I define my own panel control with asp.net usercontrols

孤街浪徒 提交于 2019-12-25 04:26:51
问题 I want something like that: <my:MyFancyPanel> <asp:Label Text="Hello"> </my:MyFancyPanel> I tried but it seems my usercontrol doesn't accept any content. 回答1: you need to make it a Templated Usercontrol 来源: https://stackoverflow.com/questions/3829728/can-i-define-my-own-panel-control-with-asp-net-usercontrols

Is it possible to handle a MasterPage event in a UserControl (C#)

怎甘沉沦 提交于 2019-12-25 04:22:22
问题 I've seen code to handle MasterPage events in the content Page, but if I'm loading a UserControl dynamically into the Page, can I handle the event in the UserControl instead? Basically I have a button on the MasterPage, when it's clicked I need to make the UserControl do something, such as display text or change a value in a form. Failing that, is it possible to make an event from one dynamically loaded UserControl fire in another on the same page? I could then replace the button in the

Is it possible to handle a MasterPage event in a UserControl (C#)

ぃ、小莉子 提交于 2019-12-25 04:22:03
问题 I've seen code to handle MasterPage events in the content Page, but if I'm loading a UserControl dynamically into the Page, can I handle the event in the UserControl instead? Basically I have a button on the MasterPage, when it's clicked I need to make the UserControl do something, such as display text or change a value in a form. Failing that, is it possible to make an event from one dynamically loaded UserControl fire in another on the same page? I could then replace the button in the

Access `DependencyProperty` via XAML and evaluate it?

▼魔方 西西 提交于 2019-12-25 04:18:10
问题 I just created a DependencyProperty for my custom button. The property is called IsChecked . If IsChecked == true my button shall change its background color to something else and keep this color until IsChecked == false . Here is my DependencyProperty : public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register("IsChecked", typeof(bool), typeof(MainMenuButton), new PropertyMetadata(false)); public bool IsChecked { get { return (bool)GetValue(IsCheckedProperty);

Winforms UserControl is not using the inheritance tree I have created. What am I doing wrong

我怕爱的太早我们不能终老 提交于 2019-12-25 04:09:24
问题 I am working on a wizard form framework that will allow me easily create wizard forms. I have a WizardForm form that has a panel on it. My plan is to dynamically load UserControls into this panel on the form. Each UserControl that is loaded onto the form panel must implement certain properties (allowNavigateNext, AllowNAvigate previous etc.). So I have created an interface to enforce that contract so that any custom user control can be used in the wizard as long as it implements that

how to get the User control Value which is nested inside the datagrid to String

本小妞迷上赌 提交于 2019-12-25 03:56:16
问题 I need to access the Value of User control which is present inside the data Grid.as shown below Actually what i want is once the data is bind to the grid it will check whether there is a value in the Expence column of the Datagrid if the value is null then the user control will be visible where user can select the value and will click save. my aspx code: <asp:UpdatePanel ID="UPChargesGrid" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:DataGrid ID="dgDestination" runat=

Why isn't my UserControl keeping its initialization?

爱⌒轻易说出口 提交于 2019-12-25 03:14:33
问题 I have a UserControl for which I think I'm initializing some of the members: // MyUserControl.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace MyNamespace { public partial class MyUserControl : UserControl { private string m_myString; private int m_myInt; public string MyString { get { return m_myString; } set { m_myString = value; } } public int

Calling a vb linkbutton’s(within a user control) click event from javascript

只愿长相守 提交于 2019-12-25 03:11:03
问题 how can i call a VB function - deleteevent() in usercontrol.ascx.vb from a javascript function in clickhandler(e) in usercontrol.ascx. The call should cause a postback because i need the usercontrol to display the changes. i am currently trying to do it by using a linkbutton with style display:none, and calling its click event from the javascript function. But i dunno how to call the click event. i had to pass a value to the vb function from the javascript, but i am taking care of it using a

MenuItem in Window, CommandBinding in UserControl

天涯浪子 提交于 2019-12-25 02:51:50
问题 I have a window: <Window x:Class="SomeNamespace.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="350" Width="525"> <Window.CommandBindings> <CommandBinding Command="ApplicationCommands.Copy" CanExecute="CommandCanExecute" Executed="CommandExecuted"/> </Window.CommandBindings> <DockPanel> <Menu DockPanel.Dock="Top"> <MenuItem Header="File"> <MenuItem Command="ApplicationCommands.Copy"/> </MenuItem> <