.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

How to validate the Sharepoint's InputFormTextBox control

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :SharePoint
validating the Sharepoint's rich text box control.

View Complete Post

More Related Resource Links

validate sharepoint datetime control

Hi   i am using sharepoint datetime control. i need to validate  user entering past date. (should not allow).   <asp:CompareValidator ID="Comparevalidator1" runat="server" ErrorMessage="The date must be greater than today"                                     ControlToValidate="dtExpiryDate" Operator="LessThanEqual" Type="date" ValueToCompare='<%# DateTime.Now.ToShortDateString() %>' />   The above code throwing error.   Rgds, Vinay

validate sharepoint datetime control

Hi   i am using sharepoint datetime control. i need to validate  user entering past date. (should not allow).   <asp:CompareValidator ID="Comparevalidator1" runat="server" ErrorMessage="The date must be greater than today"                                     ControlToValidate="dtExpiryDate" Operator="LessThanEqual" Type="date" ValueToCompare='<%# DateTime.Now.ToShortDateString() %>' />   The above code throwing error.   Rgds, Vinay

Choosing Between a User Control or Web Part for SharePoint

SharePoint will only display Web Parts on a page. However, there are publicly available shims that allow you to write user controls and have them be displayed as a Web Part. From SharePoint's point of view, the shim is a Web Part. From the point of view of the user control, the shim is simply a control in .NET that is including the user control

Take Control: Use SharePoint to Manage Your Windows Services


In this article, we show you how to integrate a Windows Services-based solution with SharePoint. The results enable you to provision, start, stop, and remove service instances through SharePoint 3.0 Central Administration.

Pav Cherny

MSDN Magazine April 2009

Problem in Custom Control Unable to find Control To Validate Property


I make a custome control by taking a TextBox and A Regular Expression Validator.When i Use this on a .aspx page it works fine.But when i use this on .ascx page and dynamically load user control on a place holder in .aspx page it through an Error

Unable to find control id '_ctl0:txtEmail' referenced by the 'ControlToValidate' property of '_ctl0:txtEmailRequired'


My Custome control Code is this"--

public class EmailValidator:System.Web.UI.Control, INamingContainer{

private System.Web.UI.WebControls.TextBox textBox;

private System.Web.UI.WebControls.RegularExpressionValidator regularExpressionValidator;

public EmailValidator(){

textBox = new TextBox();

regularExpressionValidator = new RegularExpressionValidator();

IsErrorTextBelow = true;

IsRequired = false;

SharePoint read/recognize a Digital Signature in Word (XML Content Control Mapping)?

I am using Content Control Mapping to pull certain fields from a Word Document and include it as columns when a document is uploaded into a Document Library. We're using MOSS 2007 and Word 2007. It is required that the user digitally signs the document before uploading.  Is there a way to get the signature to appear as a column in a similar fashion?  I'm new to this mapping business, and Google hasn't been much help. I realize I could use the Collect Signatures workflow, but that seems cumbersome to 1) have the user submit it, 2) have an admin open each document and start the workflow and 3) have the user THEN sign the document.  That's more steps than simply manually opening and verifying digital signatures. I figure I'm missing something obvious here.  Any help or ideas would be appreciated.

How to Fire events on SharePoint DateTime Control in visual web part

Hi All, I am working on visual webpart of SharePoint 2010. I am using a <SharePoint:DateTimeControl> i m trying  to fire OnDateChanged event on it. I am not getting the Appropriate way to create the event. please help me out!!!!   void ToDate_OnDateChanged(object sender, EventArgs e)         {                         if (ToDate != null)             {                 DateTime min = Convert.ToDateTime(FromDate.SelectedDate.ToString());                 DateTime max = Convert.ToDateTime(ToDate.SelectedDate.ToString());                 int noofdays = Convert.ToInt32((max - min).TotalDays);                 txtNoOfDays.Text = noofdays.ToString();             }         }    <SharePoint:DateTimeControl runat="server" Calendar="Gregorian"  

Creating Custom ASP.NET Control for use on a SharePoint 2010 OOTB WebPart

I am currently trying to develop a custom asp.net control that can be deployed to SharePoint 2010 and then included on something like a New item form. I have been able to build the control as part of a webpart but it needs to be done as a stand alone control that can be used on various webparts including the out of the box webparts like the WebPartPages:DataFormWebPart. Are there any good examples of building a custom control, deploying it to SharePoint and then using SharePoint designer to add that control to an existing web part?

validate control A depending on if control B has any value (diff types)

I've ready everything I can find on the built-in validators but can't figure out how to do the sort of validation I need on the client-side (I can do it on the server-side).  Business rule I want to enforce (review the gridview snippet below) is if user checks the CheckBox_EditLifeCycleRpt control but doesn't enter a value in the TextBox_LifeExpectancy control then the validation should fail.  <asp:TemplateField HeaderText="Life Expect*" SortExpression="LifeExpectancy"> <EditItemTemplate> <asp:TextBox ID="TextBox_LifeExpectancy" runat="server" Text='<%# Bind("LifeExpectancy") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label_LifeExpectancy" runat="server" Text='<%# Bind("LifeExpectancy") %>'></asp:Label> </ItemTemplate> <ControlStyle Width="50px" /> </asp:TemplateField> <asp:TemplateField HeaderText="Life Cycle Rpt" SortExpression="LifeCycleRpt"> <EditItemTemplate> <asp:CheckBox ID="CheckBox_EditLifeCycleRpt" runat="server" Checked='<%# Bind("LifeCycleRpt") %>' /> </EditItemTemplate&g

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

Sharepoint 2010 BI Center The DataSourceID of 'TopNavigationMenu V4' must be the ID of a control o

Dear Experts, I had installed SharePoint 2010 Foundation in my Windows 7 64 bit OS.  It did not have performance point server so, I later installed SharePoint 2010 Server Enterprise Version. But when I created a Business Intelligence Site Collection. I am getting this error: The DataSourceID of 'TopNavigationMenu V4' must be the ID of a control of type IHierarchicalDataSource. A control with ID 'topSiteMap' could not be found. Please help. Thanks & Best Regards, Benn  Bennz

Validate a People Picker control

Hi,I would like to validate a People Editor field. I have tried using the property Allow Empty, but unfortunatly it doesnt work. I have used a Required field validator. Luckily it works to some extent. But the problem starts if there is any postback happening on the page. After the postback, it takes the value to be empty even if there is an entry in the control.Could anyone help me if there is any perticular property to be enabled or any other solution to acheive the validations on People Editor Control Raj

AJAX tabcontainer, User Control and Sharepoint UserProfile

Hi All, I am working on following requirement. There is AJAX control, tabcontainer which is added in a user control which inturn is loaded in a sharepoint web part. Controls added int the tabcontainer include textboxes, a drop downbox and a button.On Page load I am connecting to sharepoint logged in user profile and display the information in the tabcontainer. I have kept provision to change the values for some fields which the user can change. On click of submit button the data should get saved to the same user profile and the tabcontainer should get refreshed with the new values entered. Problem Faced: On Page load all the values get populated to the controls placed in tabcontainer. But when I do any change in the control and click on submit, the changed values are not getting displayed instead old values are retained. Please help me in handling postback event. Following is the piece of code on page load and submit button protected void Page_Load(object sender, EventArgs e)         {             using (SPSite ospSite = new SPSite("http://omistestsrv:1995"))             {                 try           

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

SharePoint Services 3.0 Customizing the SiteMapPath Control

Hello, I have a simple, standalone Server running Windows SharePoint Services 3.0, over Windows Server 2008. I have basic knowledge about WSS implementation. In the default.master file there is a SiteMapPath Control with ID=ContentMap I wish to modify. I did create a Library with a short name for the URL, then renaming it to its full name for displaying, as the first one remains still, so when open in a browser it looks like (for example): http://sharepoint/ppts/Forms/AllItems.aspx But on the title area on the page it shows its full name: "Powerpoint Presentations 2010" and on the mentiones SiteMapPath control too. I added a WebParts page in this library and called it: "scheduling.aspx", now you may be guessing what I want to do. When I open the page in a browser it actually shows scheduling (without the aspx extension) on the SiteMapPath control. At first I just thought on removing the control from the default.master page, but my curiosity pushed me to research if what I want to do, is even possible.  I would like to show something like the text that is set on the page's Title Area "Events Scheduling, instead of the file name... (without the extension), so the SiteMapPath control render like: Research and Development Group - Powerpoint Presentations 2010 - Events Scheduling instead of: Research and Development

Creating dynamic Tab Control in SharePoint


Hello Every one

I have to create dynamic TAB control which display relivance as tabs using jQuery.

Thank you



Customize Live Search.

ObjectDataSource Control Disabled/not appearing in Toobox for Visual Studio 2010 SharePoint Project

  1. I've created a SharePoint Project in Visual Studio 2010.
  2. Added Visual webPart .
  3. In the usercontrol of the webpart in trying to add ObjectDataSource control, but this control is not availble in Tool box under Data tab. it appears only if i right click on datatab and select "Show All", but still the ObjectDataSource Control is Disabled and even i cannot drag and drop it on the Webpart.
  4. Also i've created a sample Business Class, with all the mandatory attribute like





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