Search Results

Search found 7104 results on 285 pages for 'dynamic usercontrols'.

Page 46/285 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Caching Web UserControl by Propety is not working (Grr!)

    - by PapillonUK
    Here's my code behind: <PartialCaching(60, Nothing, "UsrCtl_WebUserControl.CacheString", Nothing, True)> _ Partial Class UsrCtl_WebUserControl Inherits System.Web.UI.UserControl Private _CacheString As String Public Property CacheString() As String Get Return _CacheString End Get Set(ByVal value As String) _CacheString = value End Set End Property End Class Here's the user control embedded in a page: <uc:wuc ID="wuc" runat="server" CacheString="A" /> And in another page: <uc:wuc ID="wuc" runat="server" CacheString="B" /> According to the docs this control should maintain a different, 60 second cached version for each value of the CacheString property. It doesn't work - it caches for 60 seconds, but only one cached copy is created regardless of what I put in the CacheString property. Anyone any ideas what i'm doing wrong? - After 4 hours of this I have no hair or nails left - please save my monitor from the brick.

    Read the article

  • VB.NET if button1 caused post back then....

    - by Jonesy
    Hi folks, I have a situation where I need to ignore parts of page load sub inside a isPostback = true. Basically inside the isPostBack I want something like if button1 caused postback.... do this else do this... Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If IsPostBack = True Then If TextBox1.Text <> String.Empty Then CheckDate() End If End If End Sub

    Read the article

  • Issue with dynamically loading a user control on button click

    - by Kumar
    I have a page in which I am loading a user control dynamically as follows: Default.aspx: <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </cc1:ToolkitScriptManager> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> Default.aspx.cs: protected void Page_Load(object sender, EventArgs e) { var ctrl = LoadControl("~/UserCtrl1.ascx"); ctrl.ID = "ucUserCtrl1"; PlaceHolder1.Controls.Add(ctrl); } Below is the code for UserCtrl1.ascx <asp:Label ID="Label1" runat="server"></asp:Label> <asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" /> <br /> <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder> I am dynamically loading another user control when the Button1 is clicked UserCtrl1.ascx.cs protected void Button1_Click(object sender, EventArgs e) { Label1.Text = "UserControl - 1 button clicked!"; var ctrl = LoadControl("~/UserCtrl2.ascx"); ctrl.ID = "ucUserCtrl2"; PlaceHolder2.Controls.Add(ctrl); } Below is the markup for UserCtrl2.ascx <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Label ID="Label2" runat="server"></asp:Label> <asp:Button ID="Button2" runat="server" Text="Button2" OnClick="Button2_Click" /> </ContentTemplate> </asp:UpdatePanel> UserCtrl2.ascx.cs protected void Button2_Click(object sender, EventArgs e) { Label2.Text = "UserControl - 2 button clicked!"; } After the page loads when I click the Button1 in UserCtrl1 the click event fires and I am able to see the Label1 text. It also properly loads the UserCtrl2, but when I click the Button2 in UserCtrl2 the click event dosent fire and even worse when I click the Button2 twice the UserCtrl2 control dissappears from the page. How can I fix this?

    Read the article

  • Why are controls within custom panel (C# winforms) disappearing in designer?

    - by Brandon
    I have been able to create a custom C# winforms control that is basically a panel with a fixed banner (header/footer). I want to base other user controls on this "banner panel". I've gotten past the problem with the designer here. I can successfully add controls to the inner content panel. Everything looks fine while designing. However, when I recompile, the controls I added to the content panel disappear. They are still there (in code) but aren't displayed in the designer. Is there any thing that I need to do to set the drawing order of the controls?

    Read the article

  • c# - create invisible user control

    - by dhh
    Hey, I need to create a user control in C#.Net, which can be added to the application without being visible - just like the FolderBrowserDialog. It's a new window which I'll be using often so I think this is the right way. The window will be opened by envoking the showDialog-Method as known from the other dialog. Any Idea? Thanks and regards, Daniel

    Read the article

  • User controls in masterpage and anonymous user

    - by Senad Uka
    I am developing a master page which includes the user control that generates a menu from the list with a specific logic. Before including the control into master page I successfully configured anonymous access to the site. After including the control and deploying - site prompts for user name and password. I allowed the anonymous access to the list. Oh yes ... It worked on SHarepoint 2010 beta, but the problem happens when deploying to the Sharepoint 2010 final release. Additional data: I am using Sharepoint Server 2010 with Standard features, standalone instalation on Windows Server 2008 R2 for deployment, and Visual Studio 2010 Ultimate for development of masterpage and user control.

    Read the article

  • In an ASP control how can I get the text in a <Contentemplate> tag in the control code?

    - by uince81
    Hi, In my page ASP.net page I'm using a custom control like this: <MyNamespace:MyControl runat="server" ID="myControl"> <contenttemplate> This is the text I want to use </contenttemplate> </MyNamespace:MyControl> In the c# code of the control how can I obtain a string containing the text between the <contentemplate> tag (eg. "This is the text I want to use") ? Can you give me the code? Thank you!

    Read the article

  • User Control - dependency property to Change Image Issues

    - by mflair2000
    i'm having issues setting the Image from a dependency property. It seems like the trigger doesnt fire. I just want hide/show and image, or set the source if possible. public static readonly DependencyProperty HasSingleValueProperty = DependencyProperty.Register("HasSingleValue", typeof(bool), typeof(LevelControl), new FrameworkPropertyMetadata(false,FrameworkPropertyMetadataOptions.BindsTwoWayByDefault)); public bool HasSingleValue { get { return (bool)GetValue(HasSingleValueProperty); } set { SetValue(HasSingleValueProperty, value); } } public LevelControl() { this.InitializeComponent(); //this.DataContext = this; LayoutRoot.DataContext = this; } //Control Markup <Grid x:Name="LayoutRoot"> <Image x:Name="xGreenBarClientTX" HorizontalAlignment="Stretch" Height="13" Margin="7,8.5,7,0" Stretch="Fill" VerticalAlignment="Top" Width="47" Canvas.Left="181.67" d:LayoutOverrides="Height" > <Image.Style> <Style TargetType="{x:Type Image}"> <Style.Triggers> <DataTrigger Binding="{Binding HasSingleValue}" Value="True"> <Setter Property="Opacity" Value="100"/> </DataTrigger> <DataTrigger Binding="{Binding HasSingleValue}" Value="False"> <Setter Property="Opacity" Value="0"/> </DataTrigger> </Style.Triggers> </Style> </Image.Style> </Image>

    Read the article

  • Good Replacement for User Control?

    - by David Lively
    I found user controls to be incredibly useful when working with ASP.NET webforms. By encapsulating the code required for displaying a control with the markup, creation of reusable components was very straightforward and very, very useful. While MVC provides convenient separation of concerns, this seems to break encapsulation (ie, you can add a control without adding or using its supporting code, leading to runtime errors). Having to modify a controller every time I add a control to a view seems to me to integrate concerns, not separate them. I'd rather break the purist MVC ideology than give up the benefits of reusable, packaged controls. I need to be able to include components similar to webforms user controls throughout a site, but not for the entire site, and not at a level that belongs in a master page. These components should have their own code not just markup (to interact with the business layer), and it would be great if the page controller didn't need to know about the control. Since MVC user controls don't have codebehind, I can't see a good way to do this. I've searched previous SO questions, and have yet to find a good answer. Options so far In an attempt to avoid turning the comments section into a discussion... RenderAction This allows the view to call another controller, which will be responsible for interacting with the BLL and whatever data is necessary to its corresponding view. The calling view needs to be aware of the sub controller. This seems to provide a nice way to encapsulate partial views and controls, without having to modify the calling controller. RenderPartial The calling controller is still responsible for executing whatever code is associated with the partial view, and making sure that the model passed to the partial view contains the data it expects. Effectively, modifying the partial view potentially means modifying the calling controller. Annoying especially if this is used in multiple places. Portable Areas Place each control in its own project/area?

    Read the article

  • Wpf user control button command is not firing in viewmodel

    - by mani1985
    hi, i have a user control in which there is a button. i wrote icommand in the viewmodel for the button to call some function. when i use this user control in some other page ,the user control button click is not working. my xaml Save my view model private ICommand _insertNewNote; public ICommand InsertNewNote { get { if (_insertNewNote == null) { _insertNewNote = new RelayCommand( param = this.InsertNewExceptionNote()); } return _insertNewNote; } } public void InsertNewExceptionNote() { //... } my problem is when i use this user control in some page like this the user control is getting displayed in the page. but the button in the user control is not firing when i click it. user control view model icommand is not at all initialized. please provide me a solution. Thanks in advance.

    Read the article

  • How to fix the flickering in User controls.

    - by Royson
    In my application i am constantly moving from one control to another. I have created no. of user controls, but during navigation my controls gets flicker. it takes 1 or 2 sec to update. I tried to set this SetStyle(ControlStyles.OptimizedDoubleBuffer, true); or SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); but it didn't help... Each control has same background image with different controls. So what is the solution for it.. Thanks.

    Read the article

  • Animate UserControl (When It Gets Collapsed) in WPF

    - by sanjeev40084
    I have two xaml file one is MainWindow.xaml and other is userControl EditTaskView.xaml. In MainWindow.xaml it consists of listbox and when double clicked any item of listbox, it displays edit window (EditView userControl). Whenever edit window gets displayed, it plays an animation (sliding from right to left). The EditView userControl has two buttons 'Save' and 'Cancel'. Now I want to add animation (sliding edit window from left to right) when any of the button (Save or Cancel) button is clicked. When 'Save' or 'Cancel' button is clicked, it Collapse the edit window. Here is the story board which slides window from right to left. <Storyboard x:Key="AnimateEditView"> <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="EditTask" > <EasingThicknessKeyFrame KeyTime="0" Value="100,0,0,0"> <EasingThicknessKeyFrame.EasingFunction> <ExponentialEase EasingMode="EaseOut"/> </EasingThicknessKeyFrame.EasingFunction> </EasingThicknessKeyFrame> <EasingThicknessKeyFrame KeyTime="0:0:1" Value="0,0,0,0"> <EasingThicknessKeyFrame.EasingFunction> <ExponentialEase EasingMode="EaseOut"/> </EasingThicknessKeyFrame.EasingFunction> </EasingThicknessKeyFrame> </ThicknessAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="Control.MouseDoubleClick" SourceName="lstBxTask"> <BeginStoryboard Storyboard="{StaticResource AnimateEditView}"/> </EventTrigger> <Window.Triggers> Here is the xaml within MainWindow. <ListBox x:Name="lstBxTask" Style="{StaticResource ListBoxItems}" MouseDoubleClick="lstBxTask_MouseDoubleClick"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Rectangle Style="{StaticResource LineBetweenListBox}"/> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Taskname}" Style="{StaticResource TextInListBox}"/> <Button Name="btnDelete" Style="{StaticResource DeleteButton}" Click="btnDelete_Click"/> </StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <ToDoTask:EditTaskView x:Name="EditTask" Grid.Row="0" Grid.RowSpan="3" Grid.ColumnSpan="2" Visibility="Collapsed" > Any suggestions?

    Read the article

  • User control attributes at design-time

    - by ciscoheat
    I'm testing a simple User Control in Visual Studio 2008: A Panel named Wrapper with some controls inside. Can Visual Studio handle this at design time? public partial class TestControl : System.Web.UI.UserControl { [Description("Css class of the div around the control.")] [CssClassProperty] public string CssClass { get { return Wrapper.CssClass; } set { Wrapper.CssClass = value; } } } When setting the CssClass property, it doesn't update the css of the Panel at design time. Am I hoping for too much?

    Read the article

  • Adding Custom Properties

    - by j-t-s
    Hi All I have created a user control, and now I want to add custom properties to it so they will appear in the Properties toolbar in Vis. Studio. How can this be done? My custom property will be: "Animation Type" with options "Fade | Blink | Scroll | Blend" thank you

    Read the article

  • ASP.NET Controls with Highly Customizable GUI

    - by micha12
    We are developing an ASP.NET web application where some of the features that we will need to implement are quite standard: for example, a chat between users, a forum, etc. There are ASP.NET chats and forums components available. However, they all have a predetermined GUI and html markup that is almost impossible to change and very difficult to customize. And this is a very common situation for most controls like grids, etc.: you have very low control over the html markup that is being generated by the control. In our case, our web app will have its own web design created by a professional web designer in PhotoShop, and then it will but transformed into html markup that will then be transformed in aspx pages. We would ideally like to create the html markup for the forum and chat by ourselves, and use only the non-GUI part of the ASP.NET components. Is this approach feasible? Has anyone dealt with such approach in practice?

    Read the article

  • User Controls Importing Problem (asp.net)(vb)

    - by Phil
    I have this class that contains vars for db connection; Public Shared s As String Public Shared con As String = WebConfigurationManager.ConnectionStrings("foo").ToString() Public Shared c As New SqlConnection(con) Public Shared x As New SqlCommand(s, c) I import this to my page like this; Imports DBVars I'm then able to access these vars from my page. But if I try to import them into a user control the variables are not available. Am I making an error or is this expected? Thanks.

    Read the article

  • Call any webservice from the same $.ajax() call

    - by Andreas
    Hi! Im creating a usercontrol which is controled client side, it has an javascript-file attatched to it. This control has a button and upon click a popup appears, this popup shows a list of my domain entities. My entities are fetched using a call to a webservice. Im trying to get this popup usercontrol to work on all my entities, therefore i have the need to call any webservice needed (one per entity for example) with the same $.ajax() call. I have hiddenfields for the webservice url in my usercontrol which you specify in the markup via a property. So far so good. The problem arise when i need some additional parameters to the webservice (other than pagesize and pageindex). Say for example that one webservice takes an additional parameter "Date". At the moment i have my parameters set up like this: var params = JSON.stringify({ pageSize: _this.pageSize, pageIndex: _this.pageIndex }); and then i call the webservice like so: $.ajax({ webserviceUrl, params, function(result) { //some logic }); }); What i want to do is to be able to add my extra parameters (Date) to "Param" when needed, the specification of these parameters will be done via properties of the usercontrol. So, bottom line, i have a set of default parameters and want to dynamically add optional extra parameters. How is this possible? Thanks in advance.

    Read the article

  • asp.net custom web user control -- button

    - by jreedinc
    Is it possible to create a custom button -- web user control? I want certain java scripts to trigger when buttons are clicked. If so, are there any articles out there that explain the basics? I completely understand that I can load javascript via .js link or dynamically at page load, but I would like to just drop a control on the page without manually adding code to every page on every one of my projects.

    Read the article

  • How can I automatically highlight a specific character in link text using JQuery + CSS?

    - by Chris McCall
    I'm adding hotkeys to a web application in order to enable keyboard shortcuts for our CSRs to use, to reduce injury and increase calls-per-hour. I'm using an ASP.net UserControl to inject javascript into the page and it's working great. I want the control to "just work", so that when hotkeys are assigned, using a declarative syntax, if the hotkeyed letter exists in the link text, it will be highlighted automatically, so the developer doesn't have to do anything, and also to maintain consistency in visual cues. Here's the code to assign hotkeys, if it matters: <uc:HotKeysControl ID="theHotkeys" runat="server" Visible="true"> <uc:HotKey ControlName="AccStatus$btnInvoiceEverBill" KeyCode="ctrl+v" /> <uc:HotKey ControlName="AccStatus$btnRefund" KeyCode="ctrl+u" /> <uc:HotKey ControlName="thirdControl" KeyCode="ctrl+p" /> </uc:HotKeysControl> I want something like: <a href="whatever" name="thirdControl">Make a <span class=hotkey">P</span>ayment</a> ...but I'm not married to the idea of injecting a <span/> in there if there's a better way. How can I do this in CSS or JQuery? Is there a way to pass in a letter to a CSS style and have it change the color of the text displayed? Should I generate javascript to highlight the text when the page loads? What would/did you do in this situation?

    Read the article

  • Creating a templated silverlight control that has a story board.

    - by Mrt
    I'm trying to create a templated silverlight control that has a simple animation (swap a few color properties). An example would be a control that is similar to the 'questions' menu item in stackoverflow. So the consumer of the control can specify the background color and the background color for the mouseover event. I've run into the issue that I can't use template binding for a storyboard animation (http://stackoverflow.com/questions/1336689/is-it-possible-to-use-templatebinding-in-a-storyboard-in-silverlight). Whats the best work around to this ? Cheers, MrT

    Read the article

  • How can I fix "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the conte

    - by slolife
    I have a user control (ascx) that I have added two public properties to: RequestTypeId and GroupId. Both have the attribute set. In my aspx page, I have a ListView, and in the ItemTemplate, I place my control reference, like so: <ctrl:ServiceTypeGroup runat="server" RequestTypeId="<%#RequestType.RequestTypeId%>" GroupId='<%#Eval("Id").ToString()%>' /> Setting the RequestTypeId works fine. Setting the GroupId fails with the following error: "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control." What do I need to do to my user control code to allow binding a Eval() expression to one of its properties? Or is it not possible?

    Read the article

  • What causes markup-controls to be null?

    - by Earlz
    Ok, I have a very strange problem. I have a regular UserControl with some controls in the markup. At Page_Load these controls are still null. And I have tried EnsureChildControls It is laid out like this: Masterpage - Page - mycontrol1 - mycontrol2 - problemcontrol ProblemControl is where the controls are null. MyControl1 contains MyControl2. MyControl2 is another UserControl which contains ProblemControl in it's markup. Masterpage is nothing special and Page contains MyControl1 in it's markup. The only oddity is that ProblemControl is created dynamically at Page_Init. Everything works fine until I get to ProblemControl where none of the controls are being created. ProblemControl has the proper things all set such as the Page and Parent property. I do not see any problems. The source code for all of these(except ProblemControl) is pretty extensive, so I'm hoping someone can just give me some troubleshooting tips for this problem and if anyone has encountered it before. Also, I can place ProblemControl on another Page control and it will work fine, it's something about mycontrol1 and/or mycontrol2. But we've never had any problems with mycontrol1 and mycontrol2 doesn't have anything I can see wrong with it. (which I've been tediously analyzing for the past few hours). Has anyone else had this same problem? Are there any common things to check for?

    Read the article

  • Windows user control hosted in IE is not working.

    - by kumar
    Hi i have hosted a windows user control in IE. Every thing is working fine, if i open the application in the same machine where the Web application is hoste. if i access the same appication from a remote client IE, A blank box is coming with a small image in the corner. I have added the site as trusted site in the IE and made all the security settings needed. let me know, what am i doing wrong. Thanking you.

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >