C# - Reload The Information Of The Sharepoint 2007 Webpart After A Button Is Clicked From Another Webpart?
Dec 29, 2010
I am new in sharepoint development. I have 2 webparts attached on a page. The first webpart (MyTestingWebpart1) basically it does only inserting of data and the other webpart (MyTestingWebpart[2]) displays the records from the database. Now my problem is when I try to click on the save button, somehow I don't know how to refresh the webpart that displays the newly inserted record. Is this possible?
I have added a query at the page load event of MyTestingWebPart[2]. Both of the webparts attached are web user controls.
In a WebPart class, I have one label and two buttons. When a button is clicked, I would like the label to identify the clicked button.
I have the code:
Private Sub TestWebPartClass_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender Dim Label1 As New Label() Dim Button1 As New Button() Dim Button2 As New Button()
[Code]....
How do I now add (in VB please) the event handlers so that, when a button is clicked, Label1 identifies the clicked button.
We have a web part on which we display some data in a grid. We are exporting grid's underlying datatable to Excel and displaying Open - Save - Cancel dialouge box on click of a server side button.Following is the code we are executing on click of server side button.
this.Page.Response.Clear(); this.Page.Response.AppendHeader("Content-Disposition", "attachment; filename=MyTasks.xls"); this.Page.Response.ContentType = "application/ms-excel"; this.Page.Response.Write("...here goes my well formated html...."); this.Page.Response.End();
Problem is that when i click on Cancel in the diaglouge box then dialogue box to Open/Save excel disappears but all the server side buttons placed on my web part becomes non responsive, on click of any of those buttons their server side click event does not get fired
We have a web part on which we display some data in a grid. We are exporting grid's underlying datatable to Excel and displaying Open - Save - Cancel dialouge box on click of a server side button.Following is the code we are executing on click of server side button.
[Code]....
Problem is that when i click on Cancel in the diaglouge box then dialogue box to Open/Save excel disappears but all the server side buttons placed on my web part becomes non responsive, on click of any of those buttons their server side click event does not get fired !!!
I have created one sample application for WebParts. It is working fine when I run it from Visual Studio or local environment.
But when, I have publish file in IIS virtual directory (in my PC or same PC) at that time it is stop showing Verb tool bar (minimize, close buttons of WebPart).
I have built a few custom applications that run on WSS 3 using the Visual Studio 2010 Web application template. When I compile the application, Visual Studio creates the assembly file in the bin directory which I copy over later to the production server (another machine) with WSS 3. The compiled application dll file is copied into the bin folder inside the virtual directory of WSS and runs fine in there
Never worked with Sharepoint, but need to add a WebPart to display a PDF document. How does this work? There is currently some code to add a ReportViewer (SSRS) WebPart, but I need to replace it to display a PDF file (from disk). The PDF file is from a local/network path that is not served publicly. I need to get the PDF content streamed in a web part, setting the content-type along the way. If it helps any, my thoughts are to respond on a different URL (page in the same site), that simply takes some token (get params?) and streams a byte[] and sets the content-type as application/pdf - I could well be completely off the mark. You will need to be quite specific with steps and code/sample/links in the answer.
I am facing error when I am deploying Visual Webpart in Sharepoint . Then its showing following error Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have a problem on adding a webpart to sharepoint page.
I have a blank page in the sharepoint, and I have a custom control uploaded to the site, on adding the webpart the the sharepoint page I get the following error:
"Attempted to use an object that has ceased to exist. (Exception from HRESULT: 0x80030102 (STG_E_REVERTED))"
I get that error even if the sharepoint page is totally blank and so is the web part.
I know it's usually the other way around, but I have some extenuating requirements that must be met (read as "No one bothered to do the research and now I have to bail them out")
I have a standard user control (ascx) that is to be imported into a SharePoint 2007 website. Due to a design constraint, a sharepoint web part that is also needed has to be nested inside of this user control.
So in other words, the user control would have to look something like this:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="foo.ascx.cs" Inherits="foo" %> <div id="container"> ...snipped... <!-- SharePoint web part goes here --> ...snipped... </div>
I have two Picture Libraries. One has pictures and the other contains the thumbnails created programmatically by me. I am displaying the thumbnails into a custom webpart. I need to display the original pictures on mouseover on the thumbnails displayed in webpart and the originals displayed should dissappear on mouse out.
We want the second user control to be able to read a value from the first user control.
One solution we have considered is an event in the first control, that updates a value in second user control. But not sure where to place / hook up the events so that this works.
I cannot get the Drag and Drop functionality of Web Parts is to work. I have a very simple test page with two WebPartZones.. In the OnInit method of the code behind I put the page in design mode. In the first zone I have a textbox.At runtime the text box renders as a web part. When I hover over the web part header my mouse pointer changes the 'move' pointer, but I cannot drag the item. I do not see it dragging and the part never moved. I am using Visual Studio 2010 with IE 8. I have tried IE8 in compatibility mode and regular mode. The results are the same. Here is the markup from my test page:
I'm currently working on a highly configurable Database Viewer webpart for WSS 3.0 which we are going to need for several customized sharepoint sites. but i fear it's necessary to recap the whole issue. As background information and to describe my problem as good as possible, I'll start by telling you what the webpart shall do:
Basically the webpart contains an UpdatePanel, which contains a GridView and an SqlDataSource. The select-query the Datasource uses can be set via webbrowseable properties or received from a consumer method from another webpart. Now i wanted to add a filtering feature to the webpart, so i want a dropdownlist in the headerrow for each column that should be filterable. As the select-query is completely dynamic and i don't know at design time which columns shall be filterable, i decided to add a webbrowseable property to contain an xml-formed string with filter information.
So i added the following into OnRowCreated of the gridview:
GetColumnNode() checks in the filter property, if there is a node for the current column, which contains information about the Field the DropDownList should bind to, and the query for filling in the items.
In cbx_PreRender() i check ViewState and select an item in case of a postback. In cbx_DataBound() i just add tooltips to the list items as the dropdownlist has a fixed width.
Previously, I used AutoPostback and SelectedIndexChanged of the DDL to filter the grid, but to my disappointment it was not always fired. Now i check __EVENTTARGET and __EVENTARGUMENT in OnLoad and call a function when the postback event was due to a selection change in a DDL:
[Code]....
When i have two or more filters set which return zero rows, and i change back one filter to something that should return rows, the gridview remains empty (although the pager is rendered). I have to completly refresh the page to reset the filters. When debugging, i can see in the overridden CreateChildControls of the grid, that the base method indeed returns > 0, but anyway.the gridView.RowCount remains 0 after databinding. Anyone have an idea what's going wrong here?
I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net. And I want to develop a WebPart, like a tab based control, like task manager, items (e.g. processes, users, etc.) are managed by tab on the top for different categories, and in each category tab, items are organized in list. I need to get information about which tab is selected in my requirement. Any reference code or document?
I have written the code for webpart in my VS 2005 and i am getting all the mode like(Browse,Desing,Edit etc..)but when i put that wesbite in my local IIS , and when run it i am getting only the browse optionbelow is the for loop code
[Code]....
tell what is the problem, in my vs 2005 enviorment i am getting all the option, but in local IIS i am getting only browse option