.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

Control template issue

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :WPF
Can you tell me why the button text is not using my template color from this code template please?
I am expecting it to be Red.

<ControlTemplate x:Key="RoundedButton" TargetType="{x:Type Button}">

View Complete Post

More Related Resource Links

Menu control rendering issue with IE8



Using VS2010, I created an ASP.NET 4.0 web application and simply added a couple of menu items below the "Home" menu item in the master page that's created by the project wizard. I made no other changes - no code, no stylesheet changes.

If I run the app locally then everything is fine. I suspect because the local IIS is responsive enough for the problem not to occur.

If I deploy the app to a web host (discountasp.net) then I see the menu render vertically for less than a second before it renders correctly. If I refresh the page a few times then usually I can see the menu vertical flash but sometimes I can't, so there's some sort of timing consideration.

I'm using IE8. The problem doesn't seem to occur with either Firefox 3 or Chrome.

Have others seen this problem?

Any suggestions for a fix?

I can supply the zipped up project if anyone wants it.


Issue with Remember Me on User Login control


Hi everyone,

     I hope you can help me, I tried Google, but none of the solutions worked. Using VB.net and Membership, I have a login control in my master page with a remember me check box. When I check this box and login, some pages indicate that I am not logged in. If I go to another page, it will then indicate that I am still logged in. I have isolated one page that always indicates I am not logged in the first time I visit it, but if log in a second time and then go to it, it will finally recognize me as a user that is properly logged in. 

Some pages that this occurs on is in the top level, some pages are in a sub folder.

My MasterPage has the following Form Code:

<body bgcolor="#E0ECF9" topmargin="0" leftmargin="0">

    <form id="form1" runat="server">

My Aspx file has a troubleshooting label, several Gridviews and several DetailViews:

    <asp:Label ID="lblErRep" runat="server" Text=""></asp:Label>

My aspx.vb file has 1 line of code (Protec

Where is the Visual Studio 2008 Web Control Library Template


Does a project exist for grouping user controls? Visual Studio 2005 had this template but it does not appear to exist in 2008.

We will be creating several User Controls and would like them grouped accordingly.


Thanks in advance for any responses.

Can't get ClientID of ASP control in Rendering template

Hi, I've made custom field with its own rendering template. Inside template i need to show/hide some controls, but i cant get ClientID of them. Inside rendering template : <%@ Assembly Name="XXX, Version=, Culture=neutral, PublicKeyToken=72277ea422a3515d" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Control Language="C#" AutoEventWireup="true&q

Creating a volume control slider/setting one template property based on another

So, what I want to do, is to make a volume control that looks like a right angle triangle with the 90 degree angle on the bottom right, and then when you click on it, the area to the left of the selected point is shown in a different color.  In other words, I've created a slider with the right background, what I can't do, is work out how to show the selected area by filling in the triangle.  I have worked out how to bind the height of my triangle on the left to the value of the control, but right now, the rate of rise is exactly half of what I need it to be.  I need to know how to change the template for the area to the left of the selection ( which is the repeat button ) so that the background is twice the height that it is right now.  No matter what size I make the slider, the area is always 1/2 the size it needs to be, so I am sure if I could get it to double inside my template, it would work fine. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">       <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">         <Setter Property="SnapsToDevicePixels" Value="true"/>         <

Menu Control expansion weired issue.

Menu control expands on load (vertically, 100%) and then contracts to its horizontal position. The code I am using- ASPX page: <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal" DataSourceID="SiteMapDataSource1">                    <DynamicMenuStyle CssClass="DynamicMenu" /></asp:Menu>   CSS:  .DynamicMenu{ display: none;} This can be live at www.jaindata.com Can someone please help? Thanks, Swapneel Shah 

Issue with Repeater control.

Hello. I have a Repeater control which contains asp:Button control in ItemTemplate. I want to handle Button's Click event, but when I'm clicking that Button the error is thrown: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.But on other computer that piece of code is working.I set EnableEventValidation to false, but it's still not working. Please help me out. 

Get visual clues back when using a control template

This something I dropped for a while.  I am attempting to use a control template to get a left and right (sort of jukebox) look.  When I do this all visual clues such as selection are lost.  The XAML for the listbox and the control templates are as follows: <Window x:Class="Window3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window3" Height="300" Width="513" > <Window.Resources> <Style x:Key="NoButtonBorder" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True" Content="{TemplateBinding Con

The OTHER Menu control issue...

Ok, everyone knows that the z-index is messed up in IE8 and that requires patches or workarounds...What I can't seem to find a solution to is the white background on the DynamicMenu parts of a Menu control.  Setting the background color to transparent or not setting it all doesn't seem to have any effect.  This is only a problem in IE8, Firefox 3.6.8 renders the dynamic menus without the white background.

Adding a custom control to the SharePoint 2010 Team Site Wiki Page Template ( wkpstd.aspx ) programm

Topic This is maybe my last post about the Team Site Wiki Page customization with the aim of exceeding its limitations. This time we are going to customize the unique template ( wkpstd.aspx) by replacing the control that renders the editable content by a custom one. In this post example, we will take advantage of the use of this custom control to render not editable additional contents, for instance, a header and a footer that could be the same for a specific Wiki Page Library. Of course, we are not going to really customize the template, but we are going to use a delegate control to replace the control at runtime. Here are the screen shots of the result: We can see a non editable Header and Footer on the Team Site Wiki Page In edit mode these additional contents are not rendered, but we can add new content as usual And of course, after having saved the page, the new content is rendered wtih the non editable Header and Footer. Steps required   If you look at the Team Site Wiki Page template, wkpstd.aspx, you can see the control that is rendering the editable content/ <SharePoint:EmbeddedFormField ID="WikiField" FieldName="WikiField" ControlMode="Display" runat="server" /> We are first going to create a custom EmbeddedFormField control Then, we are going to use a delegate control to replace the native EmbeddedFor

how to find control from header template of a datalist?

 Hi,I have a textbox in header template of a datalist. From code behind i've to access these textbox from page_load event.I tried with the following code. DataList.Controls[0].FindControl("myControl") But it have error. how to solve it? 

Insert and Edit Pages with Web User Control Template for another table

Hi, I have an Address template(web user control) which holds the fields of the Address table.  The Address template is embedded in the School Insert Page.  I want to insert a new school together with its address(which means I have to insert a record into the address table).  Can you let me know how I can pass the newly generated addressId to update school table?  Also, how can I associate the Address.cs in the App_Code with the Address template?  I want it to be able to scaffold columns which needs to be hidden from user in the address table.  When I click on Insert School, the Address template shows in "insert" mode, I just need to link the two together. Thanks for your help! CC  

Can't access a control in a listview layout template with codebehind

While running ItemDetabound upon load of a listivew, I am trying to access the text in a label of the LayoutTemplate of a different Listview.  It works fine if I try access the same labels under the same names if they are in the same listview, but not if they are in a different one.  It was working for a while, can't figure out what I changed, but now says that object doesn't exist.   Here is the html code for the labels: <LayoutTemplate> <table ID="Table2" runat="server" cellpadding="0" cellspacing="0"> <tr ID="Tr1" runat="server" style="padding-left: 0px"> <th ID="Th1" runat="server" style="text-align: left; white-space:nowrap; "> <asp:Label ID="Label1" runat="server">Label 1</asp:Label> </th> <th ID="Th2" runat="server" style="white-space:nowrap; width: 150px" >

Rooms and Equipment Reservations Application template using WSS 3.0 issue.

I have set up a conference room reservations site using the RER template, I have questions...The template functions pretty much as I want out of the box, except for two items.1.)  Any User can delete any other user's reservation.2.)  Any User can delete a resource.Does anyone know of a way to resolve these issues?  All users need contribute permissions to use the site.

FontSize does not get altered when set in a control template for a button.

Hi,  I am new to WPF.  I wanted to customize the look and feel of a button , so defined this custom style/control template :        <Style x:Key="TaskbarButton" TargetType="{x:Type Button}">         <Setter Property="OverridesDefaultStyle" Value="True"/>         <Setter Property="SnapsToDevicePixels" Value="true"/>         <Setter Property="HorizontalContentAlignment" Value="Center"/>         <Setter Property="VerticalContentAlignment" Value="Center"/>         <!--<Setter Property="Width" Value="105"/>         <Setter Property="Height" Value="35"/>-->         <Setter Property="Width" Value="118"/>         <Setter Property="Height" Value="40"/>         <Setter Property="FontFamily" Value="Tahoma"/>         <Setter Property="FontSize" Value="13"/>         <Setter Property="FontWei

LoginView Control Issue

I'm using VWD 2010 Express, and I'm working on a school lesson that I actually did approximately 2 years ago In VWD 2005 with no problems.  I am just learning to program, so my knowledge is very limited.The lesson walks me through creating a master page and then I created a page called "Login.aspx".  On the login page, I am dropping a LoginView control into the ContentPlaceHolder section, and then I'm supposed to type "Welcome !" into the LoginView box for the LoggedIn template, but the LoginView box is very small and when I start typing, the first couple of letters go into the LoginView box, and then they start showing up on the far left outside of the LoginView control.  When I try to click back in the LoginView window, it will only select the entire control, and I can no longer modify what's in the box (unless I go to Source view).  I can't even begin to explain how frustrating this is!!!  It's tough enough trying to learn this stuff and now my development tool is giving me grief!  I don't understand why it worked fine in VWD 2005, but not now (and I'm using the same exact lesson material).

Cannot populate XAML items in template control that in contained within another template control

I have a template control Bookmark, and in MainWindow.xaml, this works just fine: <sdl:Bookmark> <sdl:Bookmark.Bookmarks> <sdl:BookmarkItem Name="test" Extent="-121.89,33.60,-117.09,36.32"> </sdl:BookmarkItem> </sdl:Bookmark.Bookmarks> </sdl:Bookmark> But, I also have a template control Titlebar which inside of its XAML contains a Bookmark control and in MainWindow.xaml, this does NOT work: <sdl:Titlebar x:Name="Titlebar"> <sdl:Titlebar.Bookmark> <sdl:Bookmark.Bookmarks> <!-- Doesn't like this --> <sdl:BookmarkItem Name="test" Extent="-121.89,33.60,-117.09,36.32"> </sdl:BookmarkItem> </sdl:Bookmark.Bookmarks> </sdl:Titlebar.Bookmark> </sdl:Titlebar> I get this error: Error 11 The tag 'Bookmark.Bookmarks' does not exist in XML namespace 'clr-namespace:SDL.ArcGIS.Client.Toolkit;assembly=SDL.ArcGIS.Client.Toolkit'. Line 45 Position 22. C:\Projects\SDL.ArcGIS.Client.Toolkit\SDL.ArcGIS.Client.Toolkit.WPFTestApplication\MainWindow.xaml 45 22 SDL.ArcGIS.Client.Toolkit.WPFTestApplication Bookmark does have a member property in the Titlebar class that is set to the template bookmark in OnApplyTemplate.  I tried making a dependency property for the Bookmark property too, but that didn't
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