.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Count words in the ascx file

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).

Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?

Thanks for helping, unfortunately I'm not a programmer.

View Complete Post

More Related Resource Links

Upload .doc-file and count no. of words?



I've been searching for a while now, but i can't find an answer that really suites my needs.
My plan is to have ha page in my asp.net (C#) project where the user can upload a .doc file, maybe also docx.
Then i want the application to automatically extract some info from the uploaded file. The most important bit is to count the number of words of the document.
I suppose that it's possible to retreive all the info about the document as when you right click the file and look at the properties?
It's easier with docx, because it's based on xml, while .doc isn't, right?

I'm clueless how to get started, so any links, hints or tips are very appreciated!

Thanks in advance!

CSS stylesheet in ascx file

This may be a stupid question, but I can't seem to get my ascx file for my user control to recognize a class in my stylesheet. I put the link at the top of the ascx file, but I'm new to user controls and not sure if this isn't working because I don't have <head></head> section at the top like aspx pages do. Or maybe I'm trying to get something to work that won't work, but I'd like to reference a CssClass on my linkbutton in the user control. I can, however, put a <style></style> section in the ascx page and it works fine, but I'd like to keep all of this in one css file and not have my styles spread out over many pages in case I ever have to make a change in the future. Thanks in advance! Chad

ascx file in asp.net mvc

In my application i want to create ascx file for creating table . As table is used in 4-5 web pages so i think of to create ascx file.can any gives me pointer how should i go for this any link?how can i pass data to ascx file in asp.net mvc?do i need to use ViewData["asda"] property to do this?

Protecting .ascx file in Visual Web Developer 2010 Express

Hello, I am working on an application that has several user controls (.ascx) of which I do not want to give away the code of. I have tried to search about it, but didn't get very far. I am using visual web developer 2010 express edition, so I cannot publish my website. Also, it doesn't have dotfuscator. What can I do?   Kind regards, LeBesjamain

Insert Into SQL Server, With Current File Uploader Count

I have a Multiple File Uploader named "Attachments1" , and to get the cound I used "Attachments1.items.count"... then I have a Insert Into Command for SQL Server, that Inserts information into the table for every item in "Attachments1", you can see the below code... For Each item As AttachmentItem In Attachments1.Items             Dim objConn2 As New SqlConnection("Data Source=XXX")             objConn2.Open()             Dim objCmd2 As New SqlCommand("INSERT INTO clientport (name, event, phone, email, date1, password, path, path2, filename, number)" & "VALUES (@name, @event, @phone, @email, @date1, @password, @path, @path2, @filename, @number)", objConn2) But for the "number" Column, I would like to insert the Count for that file... For example if Attachments1 has 3 files it will insert into the database the time (which works fine)  the probem is the number column doesnt make file1 for the first file, file 2 for the second file, and file3 for the third file... Instead it puts file3 for all three rows when it Inserts into the DB.  my code is below to get the count.   Dim strcommandtext As String = ""    

Getting file count on folder basis

Hi, I am getting the count of items modified in last 30 days. But I would like to get it a folder and sub folder basis. How to achieve this. [CODE]  int coa = 0; foreach (SPListItem item in AuditList.Items) {    DateTime CurDate = DateTime.Now;    DateTime gesDate = item.File.TimeLastModified;    TimeSpan t1 = CurDate - gesDate  ;    if (t1.TotalDays <= 30)   {         coa++;    } } Console.WriteLine("count is" + coa); [/CODE] How to achieve the above . Thank you

Folder's file count getting mismatched



I have a folder, which contains sub folders. For example: Doc is the root folder. Inside it has 2 sub folders named Doc1 and Doc2.

Doc1 contains 2 sub folders - fol1 and fol2.

"fol2" folder does not contain any files, where as "foc1" has a file in it. I am trying to get the count of files modified in last 30 days. Against each of the sub folders,and the corresponding parent folder i want to show the count of modified items. I am getting the sub folders count, but that count is not getting updated to the parent folder.

I am missing a small part of updation, but not sure where it is. This is the code i have used:


public static void GetOpenItems()
SPFolder folder = list.RootFolder;
int mouas = 0;

if (folder != null && folder.Name.CompareTo("Forms") != 0)
//Get Individual Folder Total
 foreach (SPFolder subFolder in folder.SubFolders)
  if (subFolder.Name.CompareTo("Forms") != 0)
  mouas = CountFilesInFolder(subFolder, System.DateTime.Now.AddDays(-30));
  subFolder.Item["Files_Count"] = mouas;

static int CountFilesInFolder(SPFolder folder, DateTime startDate)

Load control template file /_controltemplates/TaxonomyPicker.ascx failed

What is problem
Load control template file /_controltemplates/TaxonomyPicker.ascx failed: Could not load type 'Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker' from assembly 'Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

Scan PDF file and return words


I've a problem while using ASP.

My situation is I want to convert every documents' contained words into database and upload those document to server.

For example: MS word, MS Power Point, MS Front Page and PDF files.

Those words needed to store into database and let others to search by content.

Thank You !

Load control template file /_controltemplates/TaxonomyPicker.ascx failed



Recently, we try to migrate WSS2007 solution to  SF Server 2010. And I job is to check if all the WSS 2007 solutions can work on SF Server 2010. Unfortunately, there is one weird error came out when I did a tag mapping with Microsoft.SharePoint.WebControls.PeopleEditor with my own custom people edit, it throws me this error.

Load control template file /_controltemplates/TaxonomyPicker.ascx failed: Could not load type 'Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker' from assembly 'Microsoft.SharePoint.Portal, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

This never occurs in WSS2007 or SF 2010, BUT it DOES occur in SF Server 2010 RTM. I reflect the Microsoft.Sharepoint.Portal.dll, and I cannot find any TaxonomyPick class at all. And I searched this solution all over the world and none of the solution(these solution inclues replace "&#44"
with ";" or change TaxonomyPicker.ascx to TaxonomyPicker.ascxbackup) is working.

Apparently, this TaxonomyPicker is obsolete in RTM. I dont know why it is still in RTM folder and it seems this causes some problems.

Please help!

Thank you.


Load control template file /_controltemplates/SearchArea.ascx failed


I came across this error in the event viewer after migrating my WSS v3 to Sharepoint Foundation 2010

Load control template file /_controltemplates/SearchArea.ascx failed: 'Microsoft.SharePoint.WebControls.SearchArea,Microsoft.SharePoint,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c' is not allowed here because it does not extend class 'System.Web.UI.UserControl'.

Any ideas?

Load control template file /_controltemplates/SearchArea.ascx failed:


Hi! I upgrade from wss 3.0 to spf 2010, i found a error 7043 and the error is shown below:

Log Name:      Application

Source:        Microsoft-SharePoint Products-SharePoint Foundation

Date:          10/18/2010 11:47:26 AM

Event ID:      7043

Task Category: Web Controls

Level:         Error


User:          WIN-WVLXK22C2TJ\Administrator

Computer:      WIN-WVLXK22C2TJ


Load control template file /_controltemplates/SearchArea.ascx failed: 'Microsoft.SharePoint.WebControls.SearchArea,Microsoft.SharePoint,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c' is not allowed here because it does not extend class 'System.Web.UI.UserControl'.

can anyone help me to solve this problem?



Missing linksection.ascx File

For unknown reasons, my linksection.ascx file is missing and now "Site Settings" won't load.  Does anyone know where I can download a copy of this file?

A large 76mb xml file best way to count the number of nodes before processing




For the general processing I am using a XMLReader due to the size of the file and technically only need a once time read per file.

But the external company who made this starts it by doing a count of the nodes to say how many inserts/updates are to be done this is done by basically looping through the xml file counting them and then they recreate the xmlreader again to finally process it.

It just seems a bit clumsy to me, understandably the size of the file means we can't just load it into memory but is there another low cost method to count the nodes without having to recreate the xmlreader each time.


Could we stream the file instead and use XMLDocument or Xdocument (giving us linq capabilities) to improve the efficience as I imagine there must be some sort of performance hit re-creating a XMLReader 2 to 3 times.



For example would this use more memory than say xmlreading and looping the whole thing through to get a count.

using (XmlReader reader = XmlReader.Create(filename, settings))
                    XPathNavigator nav = new XPathDocument(reader).CreateNavigator();
                    XPathNodeIterator xPathIt = nav.Select("//root/theNode");
                    int c = xPathIt.Count;

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is
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