.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

Problem With Using Trigger for Setting Label Content

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :WPF
Basically, I have a label and depending on the Object type of the current data source item I want to control what the content of the label is. The trigger I am trying is: <Label Margin="222,21,242,134" Name="MyLabel"> <Label.Resources> <DataTrigger Binding="{Binding Path=/EntryType}" Value="Object.Type1" x:Key="myTrigger"> <Setter TargetName="MyLabel" Property="Content" Value="{Binding Path=/Object.Property1}"/> </DataTrigger> </Label.Resources> </Label> The problem is that I am getting this error: 'Content' member is not valid because it does not have a qualifying type.   Do I need to use some sort of converter or something? Or am I aproaching this worng?

View Complete Post

More Related Resource Links

Zones and setting each Zone with slightly different content

I have created a web application with intranet as Zone,Now I wanted to extend this web application on another server as internet with anonymous access but the internet will have slightly different content on webpages such that the same webpage in internet should not show some portion in a webpart (CEWP I have clickable images in this webpart, for internet anonymous users it should show only certain images ).and also some pages and libraries in internet should be not be accessible using search or links.Is this possible if so any guidelines on how to do it ???

setting label using modalpopup selected value


Hi all:

I have a modalpopup control which has  a gridview and search criteria. User selects a records and clicks modalpopup ok button ( which is set as modalpopup's okbutton). I have attached an event to okbutton click event. and inside this event, I am setting a label control which in on main page which called this modalpopup. I debugged code, it comes inside that event but doesnt set value. below is my event code.

protected void btnOkCustomers_Click(object sender, EventArgs e)


Int32 CustomerID = Convert.ToInt32(GridView2.SelectedDataKey.Value);

orders = new Orders();

DataSet CustomersDs = orders.GetCustomerById(CustomerID);

lblCustomerName.Text = "sadasdad"; // CustomersDs.Tables[0].Rows[0]["first_name"].ToString();




Please suggest me solution to this.

Asif Hameed

Read an XML file, setting uname/pw, Accept, Content-Type

Hi; To read some REST XML data we need to set the username, password, and tell it for the http request Accept: application/xml Content-Type: application/xml Is there a sample anywhere showing how to do this? thanks - daveVery funny video - Reporting as a Metaphor

Change label text on master page from the content page.

Hello. Can I access the objects (for example change the label text) on the master page, from its contents page code? If yes, how can I approach that? Thank you Artashes

problem on Page_PreRender with RangeValidator control and programmatically setting Maximum and Minim

I am new to the ASP.NET /C# dev. I run into a weird bug when using the RangeValidator Control inside a Formview. I have my DateTime field with validator and it work fine until I submit the page, it actually insert the row into the database but then when the page reload I get the following exception.Server Error in '/Budget' Application. The value '' of the MaximumValue property of 'RV_AjoutUtilisateurDate' cannot be converted to type 'Date'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The value '' of the MaximumValue property of 'RV_AjoutUtilisateurDate' cannot be converted to type 'Date'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): The value '' of the MaximumValue property of 'RV_AjoutUtilisateurDate' cannot be converted to type 'Date'.] System.Web.UI.WebControls.RangeValidator.ValidateValues() +1077011 System.Web.UI.WebControls.RangeValidator.ControlPropertiesValid() +12

Problem with import using SharePoint Content Deployment and Migration API

Hi all, I have a requirement to develop a web part to copy folder (With sub folders and files) between document libraries of different site collection. I am using SharePoint Content Deployment and Migration API for this project and getting following error on import.   Does anyone have any idea what is the meaning of the following error?     I will appreciate if anyone can point me the direction to get rid of this error..   Thank you in advance for your valuable time and effort.   -MMRAhman    Error:   “Cannot complete this action. Please try again.”   stackTrace from log :   [8/1/2010 10:54:24 PM]: Progress: Starting content import. [8/1/2010 10:54:24 PM]: Progress: De-Serializing Objects to Database. [8/1/2010 10:54:24 PM]: Progress: Importing Folder /sites/projects/mmr/Documents/Forms/Document. [8/1/2010 10:54:24 PM]: Progress: Importing Folder /sites/projects/mmr/Documents/Forms/Folder. [8/1/2010 10:54:24 PM]: FatalError: Cannot complete this action.   Please try again.    at Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)    at Microsoft.SharePoint.SPField.set_SchemaXml(String value)    at Microsoft.SharePoint.Deployment.ContentTypeSerializer.UpdateContentTypeFields(SPContentType sourceContentType, SPContentType targe

Problem with Content Query Webpart and Custom Userfields

Dear Community, I am using Sharepoint 2007's content query webpart to access content types from 2 lists each contained in a different sitecollection. To achieve this, I used this tutorial: http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx. The tutorial worked great. By using the property CommonViewFields and modifing the XML Stylesheets accordingly, i could access almost every field. Even User Fieldtypes like editor and author were accessible by adding (editor,User) or (author,User) to the CommonViewFields property. But when I tried to access the custom made userfield "Username" in the same way (adding Username,User to the property), the webpart threw an error and couldn't be displayed anymore. When I changed it to Username,Text , no error occured but it naturally didn't show up, since it is the wrong fieldtype. I hope some of you can help me, since all my researches on this topic only brought up some more people with the same problem, but no solution to it. Thanks in advance, SoundofSilence

Sending an e-mail with the content of a GridView in asp.net 2.0. problem

Hi experts,  I am Sending an e-mail with the content of a GridView in asp.net 2.0. Everything is working fine , but my problem is that  it is also sending "DELETE" LINKLabel to the email. Is there anyway so that only Content of Gridview will go to email and "Delete" Link will not go. Is it possible ??? Thanks in Advance

Problem setting Foreground with Visual State Manager (WPF - .Net v4.0

0 down vote favorite I have a WPF application, and I am attempting to style a TextBox using the .Net v4 Visual State Manager. Specifically, I am attempting to set the colors of the Foreground and Background for the MouseOver state. What is happening is that, while the background and border are changing perfectly, the foreground is not. If the brushes that I am using get their color via a StaticResource, then the foreground does not change at all. If the brushes that I am using get their color via a DynamicResource, then when I mouse over a TextBox, the foreground of all TextBoxes change. Clearly, either I'm doing something wrong, or what I want to do is simply not possible with VSM (which would be rather disappointing). Here are the resources that I am using:   <Color x:Key="ControlBackgroundColor" R="178" G="178" B="178" A="255" />  <Color x:Key="ControlForegroundColor" R="0" G="0" B="0" A="255" />  <Color x:Key="BorderColor" R="127" G="127" B="127" A="255" />  <Color x:Key="MouseOverControlBackgroundColor" R="0" G="0" B="0" A="255" />  <Color x:Key="MouseOverControlForegroundColor" R="255" G="2

Problem in setting up Windows Authentication in Windows 2008 RC2

Hi,We have a working version of application (Intranet) with uses Windows Authentication deployed in Windows 2003. The application uses HttpContext.Current.User.Identity.Name to get the logged-in user. Here impersonate is turned off.Right now, we are move to Windows 2008 RC2 where this Windows Authentication problem arised. I have Digest Authentication and Windows Authentication enabled. And also I have enabled Anonymous Authentication enabled to avoid the Login dialog of IIS in the end-user IE. Now I am getting HttpContext.Current.User.Identity.Name as Empty. When I impersonate using username and password, I am used to login using that user but all the users uses the same user to login.Does any has solution for this?Deployment Server - Windows 2008 RC2 (IIS 7.5)Development - Windows 7 (IIS 7.5)I am new to IIS 7.5. Please give me a solution

Problem setting up approve/reject settings in Absence Request and Vacation Management Template

Hi I have recently installed and set up the absence request and vacation management template in SharePoint Services 3.0 and all seems to be going reasonably well apart from one hitch. I have edited the setup workflow so that manager is sent an email on request, employee is sent an email on approval/rejection and payroll are sent an email on approval for their records. However, even though the Personal Vacation option in the Absence Type list is set to Yes for Approval Required, the workflow is automatically sending out the email to say their annual leave has been approved as soon as they request it. Has anyone come across this before or know where I may be going wrong? Thanks for any help you can give. Jo

Logon Trigger blocking problem

I'm trying to learn how to use microsoft sync framework using the following example, but am having a problem with a logon trigger blocking something.  If I disable the trigger it will work, but that really isn't an option.  Normally, if something is blocked it is placed in a blockedLog table with the name of the user and application.  If we need to allow access then we can put this information in the BlockedExceptions table to allow it through.  Initially, the .Net SqlClient Data Provider gets blocked.  After adding it to the accepts table, I still get a blocking error due to the trigger, but I can't determine what is actually being blocked.  The table never fills with any information about what gets blocked after fixing the initial .Net SqlClient Data Provider error and I have not been able to figure out anything using the profiler or activity monitor. Sync Example in question:http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3422 CREATE TRIGGER [BlockLogins] ON ALL SERVER WITH EXECUTE AS 'DBTrigger' FOR LOGON AS BEGIN DECLARE @Allow bit SET @Allow = 'TRUE' IF (SELECT COUNT(*) FROM DB.dbo.Programs WHERE AppTitle= APP_NAME()) = 0 BEGIN -- ** Other allowed apps and users are in BlockedExceptions ** -- If it is a non-application that any user is allowed to run then let it through.

Cannot crawl complex URL's without setting a site-wide rule to 'crawl as http content'. Help!

I have pages within a site that use a query string to provide dynamic data to the user (http://<site>/pages/example.aspx?id=1). I can get the content source to index these dynamic pages only if I create a rule which sets the root site (http://<site>/*) to 'include complex urls' and 'crawl sharepoint content as http content'. This is NOT acceptable as changing the crawling protocol from SharePoint's to HTTP will prevent any metadata from being collected on the indexed items. The managed metadata feature is a critical component to our SharePoint applications. To dispel any wondering of whether or not this is simply a configuration error on my part refer to http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/4ff26b26-84ab-4f5f-a14a-48ab7ec121d5 . The issue mentioned is my exact problem but the solution is unusable as I mentioned before. Keep in mind this is for an external publishing site and my search scope is being trimmed using content classes to only include documents/pages (STS_List_850 and STS_ListItem_DocumentLibrary). Creating a new web site content source and adding it to my scope presents 2 problems: duplicate content in scope and no content class defining it that I know of. What options do I have?

Adding Trigger To UpdatePanel from Content Page

Hi guys,    I got an updatepanel which contains a normal panel on MasterPage. The updatepanel does not contain content place holder. On the content page, I have to add triggers to updatepanel for buttons that are dynamically created on "page_load" event. The problem is that, since the page_load event of content page is being called before master page's page_load event, UpdatePanel is not being created. So that, whenever i try to add triggers in page_load event of content page, i got an error like "A control with ID 'ctl00$editableContent$ctl42' could not be found for the trigger in UpdatePanel 'up1'." How can I resolve this problem? The code below is for adding triggers to updatepanel for buttons.MasterClass master = (MasterClass)Page.Master;            AsyncPostBackTrigger trig = new AsyncPostBackTrigger();            trig.ControlID = button.UniqueID; // i have tried button.ID but that does not work as well :)                        trig.EventName = "Click";            master.UpPanel.Triggers.Add(trig);Regards,Kemal

Problem setting variable/param in XSLT for XML control in .NET 4.0

I am using an XML control in VS2010 with .NET 4.0.I am trying to sort XML data into a table. I have a drop list with the sort key, and a button that is supposed to display the table with a new sort.Here is the code the button calls:</p><p></p><p style="text-align: left;" mce_style="text-align: left;"><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><span class="Apple-style-span" style="border-collapse: collapse; line-height: 13px;" mce_style="border-collapse: collapse; line-height: 13px;" mce_fixed="1"></span></font></p><p><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"></font></p><p><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">private void PopulateXML( Xml MyXML)</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: h

Dynamically Setting the property value FilterValue1 of the Content Query WebPart? Inline? codeblock?

I want to dynamically set the FilterValue1 property of a Content by Query to the querystring ID. I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck Without having to code my own webpart, any way to change the value with a small C# code block? How about with javascript? Thank you!    

Problem running jquery script in Content Page

Hi!! I have a master page in asp.net and a content page with some basic asp.net controls like textbox,buttons,treeview....i have a jquery script in the content page and reference set to the jquery file..The script changes the text property of a button on the keydown event set for the textbox...the script works fine if i copy and paste it in a normal page...the script only ran once when i worte it for the first time the next day when i tried to run the script it was not working..i m facing this problem for running the script in content page and i a m not aware of how to write jquery script for the content page.. i m really not finding any solution where i am wrong i have even tried setting the internet explorer security setting to low..plz plz plz plz plz plz help me on Thanks!!
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