web-parts

SQL joins and logic

瘦欲@ 提交于 2019-12-11 09:07:03
问题 I am working with a SharePoint web part that I am designing in C#. I need to query a SQL Server 2005 database to return the names of machines that are associated with a particular customer, selected by the user. The problem is that there are different types of machines, and the names themselves are stored in several other tables. Here is the structure as it pertains to this question: I have a table "customerInfo" which contains the ID and name of each customer. The ID is the primary key. A

Sharepoint query with elevated privileges

天涯浪子 提交于 2019-12-11 09:04:58
问题 A Webpart needs to access a Sharepoint List (read mode). If the user is admin, there isn't problem (works as espected), but if the user hasn't permissions to access, I must use "RunWithElevatedPrivileges" method. The problem is that seems that the query don't return the correct results. What I'm missing? SPList demoList = null; SPSecurity.RunWithElevatedPrivileges(delegate() { SPSite oSite = SPControl.GetContextSite(HttpContext.Current); // ADDED SPWeb oWeb = oSite.OpenWeb(); // ADDED

Custom PropertyGridEditor etc. for web part edit zone?

ε祈祈猫儿з 提交于 2019-12-11 05:49:52
问题 I want to change the appearance of the default editor parts, and am a little unsure of how to go about doing this, as there seems to be a surprising lack of documentation on the subject. I've been able to create a custom declarative catalog with some trial and error and overriding the RenderCatalogPart method, and now wish to do something similar with my AppearanceEditor and PropertyGridEditor. I've tried just changing the style of the editor parts using CSS, but they are already arranged

Change “access denied…” text string for document library web part

☆樱花仙子☆ 提交于 2019-12-11 04:41:13
问题 I have a MOSS publishing site and a document library with it's own unique permissions. On the site home page (default.aspx) I have a document library webpart that shows a list of documents. If the user does not have permissions to view the documents the web part currently displays the message "Access denied. You do not have permission to perform this action or access this resource." is there a way to change this message to something more friendly? 回答1: If inheriting doesn't work out, you

ASP.NET Regular Expression Validator Not Working on Internet Explorer 7

狂风中的少年 提交于 2019-12-11 03:23:04
问题 I am using the following Regular Expression Validator to ensure the password enter meets the requirements of 1 upper case, 1 lower case, 1 number, and 1 allowed special character: <asp:RegularExpressionValidator ID="rev_txtNewPassword" runat="server" Display="Dynamic" ErrorMessage=" Password does not meet requirements" ControlToValidate="txtNewPassword" ValidationGroup="password" ValidationExpression="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#$%^&*]).{8,16}$"></asp

Custom visual web part properties sharepoint

帅比萌擦擦* 提交于 2019-12-11 02:18:00
问题 I'm having trouble creating visual web part properties in visual studio 2012.. I was refered to http://msdn.microsoft.com/en-us/library/ee231551.aspx, but then was unsuccessful.. looked in the Web part and found the .ascx, ascx.cs and the ascx.g.cs I've been trying to find the webpart.cs file but then I cant. Is there a way I can create it or maybe I'm looking in the wrong place.. 回答1: There is no webpart .cs files in Visual Web Part created in VS 2012. You can add Web Part properties to ascx

SharePoint: Do not see any Filter Web Parts

只谈情不闲聊 提交于 2019-12-11 01:29:56
问题 In the official Office 2007 site there are numerous reference to Filter Web Parts. When I try to add one of them, the Web Part list in my Sharepoint doesn't show any Filter Web Parts. Please post if anyone experienced the same and any resolution. Thanks 回答1: in MOSS activate the Office SharePoint Server Enterprise Site Collection features Feature 回答2: Maybe you are using wss 3.0 ( Windows SharePoint services) and not the MOSS 2007? wss does not have filter web parts. 回答3: As Nico said they

Set web part personalizable property from JavaScript

允我心安 提交于 2019-12-11 00:58:08
问题 I have defined a personalizable property on a web part and I would like to modify its value from JavaScript. Is it possible? 回答1: You would have to use AJAX to send a message to the server. There's no way to set it from JavaScript without going to the server. The AJAX could be as simple as a PageMethod call though. 来源: https://stackoverflow.com/questions/286786/set-web-part-personalizable-property-from-javascript

Datareader skips first result

余生颓废 提交于 2019-12-10 23:57:28
问题 I have a fairly complex SQL query that pulls different types of products from a database based on a customer ID. It pulls three different types of products, identified by their unique identifier number ranges (i.e., IDs 1000-1999 are one type of product, 2000-2999 are another, and 3000-3999 are yet another). SELECT b.fldMachineName, m2.fldRotaryPressName, mids.fldMachine_ID FROM dbo.tblCustomerGeneralInfo c LEFT JOIN dbo.tblMachine_IDs mids ON c.fldCustomer_ID = mids.fldCustomer_ID LEFT JOIN

Web Parts and Offering Files For Download?

白昼怎懂夜的黑 提交于 2019-12-10 21:53:57
问题 Can anyone suggest the best way to offer a file for download within a SharePoint web part? The file will be dynamically created on request, but I still need to end up with the standard page being displayed as well as the file being downloaded. 回答1: In the end I dynamically added an iFrame to the web part during the reload after the user chooses the 'Export' option, and within that loaded a standard .aspx page which handles the sending. This got around the issue of having to send a Response