.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

Assigning values programmatically to Taxonomy Web Tagging Control

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :SharePoint

I am trying to develop a custom field in a list that will allow selection from entire Term Store. Fortunately I learned about TaxonomyWebTagging control and its ability to allow selection from multipe termsets when used programmatically.

I am developing a custom field type that allows selection from multiple termsets using this control. The field type works fine when adding or displaying the terms. It however breaks when Editing. When values are assigned to the TaxonomyWebTagging control (on server side), it gives an error on client that "There was an error processign the request". (in a dialog box). No exception is raised on the server side.

I have made sure that value assigned are in correct format to the control.

There is no problem with the connection of control to metadata term store as when I cancel the dialog and start typing in the control, it resolves the term store values.

Any insight how to assign values in TaxonomyWebTagging Control will be highly appreciated.



Sharepoint Architect - NY, USA

View Complete Post

More Related Resource Links

using the linqDataSource control programmatically (dynamically)



my scenario is this: I want to use the linqDataSource control to bind data to a gridview for it's efficient built-in paging and sorting features *but* I don't want the data to be bound until the user has input various search parameters, so I need to bind the data from a button click event. Also, the search options will be somewhat complex in that there will be several optional search parameters, via various dropdowns and textboxes, so I can't just declaratively/statically setup all the WHERE parameters on the linqDataSource (at least I'm assuming I can't, or that it may result in poor performance if I do and just assign default values like the everything wildcard '%' for the cases the user doesn't use a particular search parameter). Given that brief description, here is an example of what I'm doing, but with only one WHERE parameter for simplicity, the real code will be adding anywhere from 1 to about 12 WHERE parameters depending on how the user sets the search options in the GUI.

the linqDataSource on the aspx page:

<asp:LinqDataSource ID="ldsMain" runat="server" 
        Select="new (field1, field2, field3, etc..)" 

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"

Control Values When Returning to Page


Why do controls value not persist when returning to a page (e.g. via browser back button)?  If I set control values without utilizing a post back the controls will maintain their last value when I return to the page.  If I set a control value and then call a post back, the control value is reset to the default value when returning.

I have many pages with a gridview, and a textbox which is used to filter the gridview contents.  I set the filter textbox, filter the gridview (postback), go to another page, and when I return to the gridview page (via back button), my filter textbox is reset empty, and the gridview is the original (unfiltered) data.

What concept am I missing here?

Thanks in advance...

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

Values in user control fields empty when AutoEventWireup=true ?

As a BizTalk developer I'm trying to build a ASP.NET website so some obvious things might be new to me (so please be gentle). I have a web form and I have a user control on it. This user control contains a panel with some user properties that are to be stored in a database. So far nothing fancy. The user control itself contains a panel and is working fine (all code to retrieve and store the values is working). I used the default settings of creating a user control and one of them was AutoEventWireup=true. This works fine because I also have some dropdown boxes (and other fields) that need to be filled with values from the database and that happens in the Page_load event. The panel specifies the 'DefaultButton' which calls a method when clicked to save the values after the user has changed them. On this click the code of the method is called, I confirmed that, but I found out that the values of my controls on the user control (for example the Textbox control) are empty. As a non-ASP.NET developer I couldn't figure out why. So I changed some settings like AutoEventWireup to false. Off course this resulted in my dropdown boxes no longer to be initially filled, but my surprise was big to find out my controls actually contained the values the user typed in. Logically I need both the values and th

Accessing a row's dropdownlist values AFTER the gridview control is in Edit mode

Hello, I have a gridview control. When it goes into Edit mode, there are 3 dropdownlists in one cell that are populated by separate stored procedures during the RowDataBound event. The 1st dropdownlist's value is used as a parameter to determine what the 2nd dropdownlist is populated with. The 2nd dropdownlist's value is used as a parameter to determine what the 3rd dropdownlist is populated with. Everything works fine when the row is first put into Edit mode. While I'm in Edit mode and I change the selection in the 1st dropdownlist, how do I access the control so I can feed this new parameter to the 2nd dropdownlist? I have the first 2 dropdownlists set for AutoPostBack so that the Page_Load event is fired when the user changes a value. I know how to get access to these controls via the FindControl method when the row is being databound but how do I find the control during the Page_Load event? Thanks for any help!!!   Penny  

Wizard Control set WizardStep.IndexOf() Programmatically

How can I set the value of WizardStep.IndexOf() programatically? eg.Dim strWizStep As ?? = "Me.wiz1_Step" & Session("arSteps").Item(h+1) 'ie. Me.wiz1_Step3 or Me.wiz1_Step4 etc wiz1.ActiveStepIndex = wiz1.WizardSteps.IndexOf(strWizStep)

WPF control size is larger than explicitly set width and height values.

I created a Canvas with fixed Width and Height (256x256). Next to it I put an Image control displaying a 256x256 texture without stretching. How is it possible that actual sizes of both controls on the screen differ so much? Here - is the screenshot illustrating size mismatch. And here - the TestLines256.png in case someone liked to check it (and maybe point out that I'm stupid and this texture is 180x180 and not 256x256 as I claimed). XAML with creation of the controls:   <Window x:Class="OversizedQuad.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" SizeToContent="WidthAndHeight"> <StackPanel Orientation="Horizontal"> <Canvas Width="256" Height="256" Background="Red" /> <Image Stretch="None" Source="TestLines256.png" /> </StackPanel>

get disable control values during postback

 Hi, I have a page it contains some criteria part based on criteria click upon generate button data will displayed on gird page also contains modify button where user can modify the grid data once user clicks modify button the selected criteria part will disable everything works as expected.. but i am not getting the disable control values during postback how to get the values during postback?   Thanks Maverick  

How to read checkbox values from programmatically created checkboxes?


I have a form that does a loop to create checkboxes.  Here is the code in the loop:

cbxDrives.Top = TopPosition;
cbxDrives.Left = LeftPosition;
cbxDrives.Text = d.Name; 
CheckBox cbxDrives = new CheckBox();this.Controls.Add(cbxDrives);

This creates multiple check boxes on the form, and this works fine.

However, in the code behind for my button that the user clicks to execute the form, I cannot figure how how to read the values for the checkboxes.  I've tried:

foreach (CheckBox cbxDrive in cbxDrives)


How to bind GroupBy Values in Nested Repater Control


In a dataset i m getting values like this

IdApplication    ApplicationDesc    Permissions

1                       User                      Add

1                       User                      Delete

1                       User                      Update

2                       Role                       Add

2                      Role&n

How to read control id and values from pdf file



 I have requirement like admin will uploads some pdf files ,which contain text box ,check box ...,

similarly we will have master table which contain some matched fields.

If pdf fields mached with master table fields then i will store mached fields pdf control id's in data base , next time if i open this pdf file i need to auto fill this matched fields in pdf file.

Can any one gudie me right direction please.

How to get gridview control row values


I have a gridview with a dropdownlist (ddlGrade) in one column and a textbox (txtText) and checkbox(cbxCheck) in another.

When the checkbox is checked I to fire an event that will use the data from other controls in that row.

In the method can get the checkbox value using:

public void onCheckedChanged_CheckedInfo(object sender, EventArgs e)

           Checkbox cbxChecked = (Checkbox)sender;


My question is... how do I get the value of the other two controls that are in the same row (dropdownlist and the textbox) at the same time? But not the values from any other rows?

Thanks, Travis

Creating Custom Control by Inherits BindingNavigator - How to Add ToolStripItem Programmatically


I'm creating a custom control which inherets the BindingNavigator.

I need do add one ToolStripButton at specific posistion (9 element) on the ToolStrip of the BindingNavigator.

So, I wrote the following code:

 tsb As
 .Name = "BindingNavigatorUndoChanges"

 .Image = My
 .ToolTipText = "Undo changes"


.Items.Insert(9, tsb)

My question is: In which event of the custom control should I put this code?

Many thanks for any kind of help.


Assigning values from a Database to a Label



I want to select all the values from a table in my database and then put each value in order into labels that are on the asp page.

I can Select all the values from that database fine but I am rather stuck as how to put the values into the individual labels? Here is the code I have connecting to my database.

  Dim cmd As New SqlCommand
            Dim myConnection As New SqlConnection("Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\Alerts.mdf;User Instance=true")

            cmd.Connection = myConnection
            cmd.CommandText = "SELECT DateTime, Description FROM EmailTemplateLoad"


        Catch ex As Exception

        End Try

How can I put the DateTime value into Label1 and the Decription into Label2??

I have had a nose about but can't seem to find the information I need.

Any pointers greatly appreciated.

People Picker control used in ASP.Net wizard control. Loses values on Postback?


I am using a people picker control in a custom visual web part with Visual Studio 2010, Sharepoint 2010.

The people picker control is on an asp.net wizard control.

On the wizard step with the people picker control, after postback the people picker control has selected values.

But when clicking the next or previous buttons of the wizard control, the people picker control does not retain its selected values.


Microsoft.SharePoint.WebControls.PeopleEditor pe

pe.AllowTypeIn = true;
pe.AutoPostBack = true;
pe.AllowEmpty = true;
pe.MultiSelect = false;
pe.SharePointGroup = "My SP Group Name";
pe.SelectionSet = "SPGroup";
pe.ValidatorEnabled = true;
pe.CommaSeparatedAccounts = pe.CommaSeparatedAccounts;

Any suggestions?


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