.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

Having trouble filtering data view inserted on DispForm.aspx by field value already on the page.

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :SharePoint
I have a DispForm.aspx page showing, of course, the names and values of fields of an item within a custom list that I have created.

I have inserted a dataview of another custom list onto this page.  Of course, when doing so, SharePoint Designer allows you to create a filter for this view.

I would like to filter this dataview using a value of a field of an item of the FIRST custom list (a value already shown on this page).

I mistakenly thought creating a data view parameter of "Form" source was the solution, but it is not.

Is there a way I can capture data appearing on the page (from the original DispForm) and use this value as a filter?

Any assistance would be most helpful.

View Complete Post

More Related Resource Links

Disable filtering on a Dynamic Data list view.


I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.

This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view

Changing aspx page causes session data to be lost...


Strange but true. Any ideas what might be causing this?


Add page numbers for paging in data view web part


Hello all,

Has anyone found a solution that will allow me to have page numbers for paging in a data view web part. For instance, if I have 40 items/rows and I set the paging to display 10 items, I'd like the paging to show 1 2 3 4 rather than showing 1-10 and having to click next over and over to get to a specific item.

I found this article, but it is for 2003 and doesn't seem to apply to 2007 or if it does I am not able to really figure out how.


Please help!

Thanks in advance.


Way of showing ID on the DispForm.aspx page without programming?

Is there a way of showing the ID system field on the DispForm.aspx page without programming.
I don't want to use a dataview, as new fields being added in the future won't appear automatically anymore this way on the DispForm.aspx page. 

I found somewhere that I could use a calculated field, with as formula =ID (so, in fact just copying the value of the ID field in the calculated field), which is one option.

Are there other options/solutions known?
Patrik | My Blog

Calculated date field displays differently in List View and Data View web parts

In SharePoint GUI I created a simple custom list with a calculated Date/Time field (Due).  The calculation is =[Created]+7.  I'm trying to display this data on a page using a DVWP.  But first, for testing purposes, I also created a second calculated Date/Time (TestCreate) field in my custom list that is simply =[Created]. In the List View from within SharePoint, the dates show as expected (for example): Created = 8/12/2010 3:45 PM Due = 8/19/2010 3:45 PM TestCreate = 8/12/2010 3:45 PM In SharePoint Designer, I added a Data View web part and the above three data elements (each configured to display mm/dd/yyyy hh:mm:ss tt).  I see the time displayed for the example list item as: Created = 8/12/2010 3:45:30 PM Due = 8/19/2010 10:45:00 AM TestCreate = 8/12/2010 10:45:00 AM I've tested a couple scenarios and the calculated fields always display five hours in the past (along with dropping the seconds).  It seems like the DVWP is returning the date in a different time zone (with no seconds).  The lcid is set right (1033).  I didn't see any time zone settings for the DVWP specifically.  I'm basically stuck.  Could someone help me figure this one out. Thanks.

How to pass page column value to data view parameters

Hi All, I have a page library with custom column, lets call it "FormCourseId". On that page I have data view which retrieves data from custom list filtered by page column "FormCourseId". In parameter wizard creates the following tag <ParameterBinding Name="ListCourseId" Location="Form(FormCourseId)" DefaultValue=""/> Then I try to use that parameter in XSLT of data view as a filter creteria.  <xsl:param name="CourseId"></xsl:param> It does not work for me. If I change data view parameter source from Form to Query String and pass parameter as url one it works fine. What is wrong with page column parameter binding? May be if FormCourseId column is not presented in form layout as a field(I do not need to show that field in user form of the page) it could not be treated as form parameter?

A customized EditForm.aspx page giving error because it has a "People and Group" field with a "Allow

My customized EditForm.aspx which has a "People and Group" column with the "Allow multiple selections" property as "Yes" was working fine until the Agusust cumulative update was applied into the MOSS server. Now it's giving me the error: "An unexpected error has occurred". Needless to say, when I change the "Allow multiple selections" property to "No", the customized EditForm.aspx page works fine.Forgetting whyMicrosoft introduced this error for now, is there a workaround that you are awre of?

Data View and Scheduled Start & End Dates Filtering

I have a data view that needs to display all pages that are current and the closing date is greater than or equal to today's date. The issue I am having is that the data view is displaying pages that are have the a future scheduled start date or the scheduled end date is past, i.e. something that has a start date of tomorrow, is displaying and a page that has an end date of yesterday is displaying. I can tried to filter the data view on the scheduled start and end dates but I can't see it in the Filter Options of the 'Common Data View Tasks'. I have also tried adding XSLT Filtering but am unsure how to set it up.  I have added the following as an XSLT filtering [@PublishingStartDate<=$Today or string-length(@PublishingStartDate)=0] I am wanting to check whether I have done this correctly or not. Some pages won't have a scheduled start date but all will have an end date. Below is the code from my data view: <WebPartPages:DataFormWebPart runat="server" ShowWithSampleData="False" AllowRemove="True" AllowHide="True" SuppressWebPartChrome="False" PartImageLarge="" ViewContentTypeId="" ExportMode="All" Dir="Default" MissingAssembly="Cannot import this Web Part." ID="g_fdf00570_38e8_4df9_8ab3_5ca3ed974c41" DataSourceID="" IsIncludedFilter=""

How to programmatically POST data to an aspx page?


Hi everyone,

I'm trying to POST data to an aspx page.

I've got a button click event (btnSend_Click) within which I want to programmatically POST data ("key1=value1", "key2=value2") to another aspx page ("ReceivingPage.aspx") on my site.  It would be very easy to do if it were a GET, cos I'd just append the data key/values to a query string of a HyperLink control. But How do I do this as a POST? 

Thanks for the help. 

How to use Page/Content Field data in a Navigation - how to include images in a navigation?



I look for a hint on how to accomplish the following:

I create a Internet-type of Site based on the Publishing Infrastructure/Features. The site is structured by subsites that are all based on same Masterpages and PageLayouts. In the PageLayouts there are the common fields like Title, Page Content, Page Image. And exactly the last one "Page Image" should appear in the navigation.

Searching the web pointed me to creating a custom PortalSiteMapProvider. In the GetChildNodes I figured out how to get the actual Url to the "Page Image" of a Node in the Sitemap. 

But here I'm stuck. How to I get this information (the image url) delivered to a menu control to actually draw an img src=...?The build-in Nodes don't seem to support such an additional property. And the build-in menu controls (asp:menu, sharepoint:aspmenu) neither.

What do I need to create to make use of the ImageUrl? A custom Web part? or ... ?

Any hints welcome


Thank you


Long time WinXP user, skipped Vista and starting to like 7

SharePoint Designer 2007 - Customize List View - Error when saving view ASPX page


We have a custom list definition that includes custom site columns.  When we try to open one of the list view aspx pages in SharePoint to update the view query we get an error when trying to save the page in SharePoint Designer 2007.  We receive a warning that the operation will customize the page from the site definition, which is fine.  And then get a general "Server error: ServiceRequestorID" alert.  ServiceRequestorID is a custom site column used by the list definition.

ServiceRequestorID field definition:

<Field ID="{FA39D24D-AB40-4b1d-BD80-94ABE34A7578}" Name="ServiceRequestorID" DisplayName="Service Requestor ID" StaticName="

Retreive Customer field value in dispform.aspx


Hi All,

I have customized newform.aspx in sharepoint to use a new Customer field (which I added as dropdownlist connect to my own customer table). Everything works Ok. I can see customers in create service request.

But now when I see existing service request from the list using dispform.aspx  it doesnt show the customer value. How can I do this? Thanks.


Correct Way to Insert Data from Text Boxes on ASPX page into SQL Database Using VB


Please help me, I have been trying this for a week now and this is how far I have gotten.


I am new to this, and I am using MS Visual Web Developer Express.


OK - This is what I have come up with, but when I run it I get the following error  (I decided to just try to use a simplified table just to get an understanding of the basic concepts):



Partial Class label_form
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Declaring variables
        Dim username, labelname, ownersname, address1, address2, city, state, zipcode, country, contactnumber, emailaddress, data_source, con, sql_insert

        ' Check if Necessary Text Is Missing ( will do this once I can get it to work with no empty text boxes)

        ' Get Values from TextBoxes
        username = txtUserName.Text
        labelname = txtLabelName.Text
        ownersname = txtOwnersName

Can a Dynamic Data page update a View?



I just started working with Dynamic Data (asp.net 4, VS 2010 express, C#) and have tried to simplify the displaying/not displaying of columns by using a simple, single table, updatable SQL view.  Adding and displaying the view work and the in-line edit and update controls are there and seem functional but I can't access any of the columns.

Does DD not support updatable views or have I missed something?


encrypt aspx page at client side view source

how can we encrypt ASPX page at client side view source ? So that nobody can see my controls and links.

Dynamic Data Field template edits - Tooltip text, Dynamic Data Page template edits - field sort


I have an ASP.net website build in VB 2010 web dev pro using 4.0 framework.  Its a dynamic data site and I am having some trouble formating some of the field and page canned templates.

Q1: Field Templates - the tooltip code (TextBox1.ToolTip = Column.Description) is within the ascx.vp pages for each of the field templates.  Where can I update each columns description (as the code references) so the tooptip will be column/field specific.  If its not as straight forward as that, I was trying to write an if/else statement because the tooltip code is set at the field type level (decimal, date, etc) and I want it to be column specific.  example;

if column.value = Financial Impact

then  TextBox1.ToolTip = "enter financial impact in whole dollars"

else TextBox1.ToolTip = "next fields tooltip text"



How to inject htlm code into text field and load it into the view page


 Hi to all,

I woul like to ask for advice how to inject HTML code into text field and load it into the view,

I am giving the user the possibility to add/edit text on the page using Text-Box control.

My goal is to let the user add Url link into the page. Example:

The user enter the word "[[About us]]" and the system needs to translate it into

<a href="<%=Url.Action("Details","Page", new{id="About us"}) %>">About us</a>

In the view i am using encoding: Html.Encode(Model.Page.Description).

I can write in the controller a method that will send to the view the correct syntax.

But the view encode all information therefore it's not working.


How sould i inject html code into existing text and load it into the view correctly ?


Any advice will be appreciated

Thank you


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