Web Forms :: Get Webpart Underlying Control And Add It To Panel

Aug 12, 2010


I get the error : Cannot modify the controls collection of a GenericWebPart. To create a new GenericWebPart, use the WebPartManager.CreateWebPart() method

View 3 Replies

Similar Messages:

Add PDF Viewer Panel To Sharepoint WebPart

Feb 8, 2011

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.

View 2 Replies

Web Forms :: Deployed Project Not Showing Webpart Verb Tool Bar (minimize, Close Buttons Of WebPart)

Jan 4, 2011

I am just started development in ASP.NET.

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).

View 1 Replies

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.

View 2 Replies

Web Forms :: How To Control The Title / Border And Others In A Webpart

Feb 7, 2011

how can I control the border ( currently it displays thin-line border) and control the display of heading (currently it display 'untitled') and other similar features.

<asp:WebPartManager ID="WebPartManager1" runat="server">
<Personalization Enabled="False" />
<asp:WebPartZone ID="WebPartZone1" runat="server" BorderColor="#CCCCCC"
Font-Names="Verdana" Padding="6">
<EmptyZoneTextStyle Font-Size="0.8em" />
<PartStyle Font-Size="0.8em" ForeColor="#333333" />
<TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
<MenuLabelHoverStyle ForeColor="#D1DDF1" />
<MenuPopupStyle BackColor="#507CD1" BorderColor="#CCCCCC" BorderWidth="1px"
Font-Names="Verdana" Font-Size="0.6em" />
<MenuVerbStyle BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px"
ForeColor="White" />
<PartTitleStyle BackColor="#507CD1" Font-Bold="True" Font-Size="0.8em"
ForeColor="White" />
<site:AboutUs ID="AboutUSControl" runat="server" />
<MenuVerbHoverStyle BackColor="#EFF3FB" BorderColor="#CCCCCC"
BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333" />
<PartChromeStyle BackColor="#EFF3FB" BorderColor="#D1DDF1" Font-Names="Verdana"
ForeColor="#333333" />
<HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
<MenuLabelStyle ForeColor="White" />

View 3 Replies

Web Forms :: Access Aspx Page Control In Webpart Class?

Jan 18, 2010

i have a hidden textbox in my aspx page. The aspx page also has a masterpage in the <% @Page> directive.

<input type="hidden" runat="server" name="txtType" id="txtType" />&nbsp;
actually in aspx.cs i am getting txtType.ClientID="ctl00_MainHeaderContent_txtType"

I have a webpart in a webpart zone in this aspx page. In the webpart CreateChildcontrols() I need to access this hiddenTextbox value. I am able to access it as

string TxtValue = this.Page.Request.Form["ctl00_MainHeaderContent_txtType"];

But instead of hardcoding I want to access as a control in the page or form. How can I do that I want to do as looping through the controls in the page but Page.Controls.Count gives 1 and that is MasterPage. How can I get the entire controls in the page and loop through and find the hidden textbox. I also tried as string TxtValue = this.Page.Request.Form["<%=txtType.ClientID%>"] in CreateChildControls() of the webp[art. But could not access hidden textbox like this.

View 2 Replies

Web Forms :: Accessing Custom WebPart Control Using HTML Browser DOM

Jun 10, 2010

does anyone know how to access a webpart using the HTML Document Object Model? for example: for a given page which contains a webpart manager and a webpartzone.


I cant access the custom control using the HTML DOM Like this: HtmlDocument doc = HtmlPage.Document;
HtmlElement element = doc.GetElementById("HostTest");
HtmlElement element1 = doc.GetElementById("silverlightControlHost");
HtmlElement element2 = doc.GetElementById("WebPartZone3");
HtmlElement element2Parent = element2.Parent;
HtmlElement element3 = doc.GetElementById("SLRoomConsumerPart1"); //element3 does not return anything at all just Null!

all of the other elements are returned except for element 3 which returns a null! Any controls (regardless if it is a custom control, ASP control, Usercontrol . i tried it by replaceing the custome control with an aspnet button. i go t a null value as well) placed in the <ZoneTemplate> Tag of the <WebpartZone> is not returned using the HTML DOM. I find this stupid and pointless, as the whole point of a webPart is that you can place all sorts of controls in it :
customcontrols, usercontrols html controls, html server controls, aspnet controls and you cant seem to get access to those controls using the HTML DOM model in codeBehind
<asp:WebPartZone ID="WebPartZone3" runat="server" Height="90%" Width="
<cc1:SLRoomConsumerPart ID="SLRoomConsumerPart1" runat="server" />
HtmlDocument doc = HtmlPage.Document;
HtmlElement my_WeBpart_Element = doc.GetElementbyId("myCustomWebPartControl1")
can anyone point me to a solution or a work around as i am trying to access the dom from silverlight 3 but should be exactly the same as doing it from the webpart'shosting page's code behind. so that i can reference the controls inside my web part from the code behind of the custom page once i get hold of the webPart Element referece.

View 6 Replies

Forms Data Controls :: Passing The Underlying Data Of The Databound Control?

Mar 30, 2010

In my asp.net web page i have a dropdown box. Say like i have to bind EmployeeName to this dropdown box to show up as items.

I am using a dataTable to bind to this grid by having two columns in DataTable (EmployeeId and EmployeeName). But i am only binding the EmployeeName to the dropdown list box.

In the UI, after the user selects an Employee, I need to pass that employee's id to a function. Is there any way, i can directly pass the underlying data (EmployeeID in the DataTable attached to this dropdown), when the user selects the EmployeeName from the dropdown. Or i will have to make a roundtrip to the database and get the selected Employee's Id and then pass it to the function.

View 2 Replies

.net - WelCome Control In Webpart Code?

Jun 14, 2010

I need to place a webpart on the page. The webpart need to change Welcome control title. I need to change "WelCome UserName" to "UserName".

I tried http://www.wictorwilen.se/Post/Having-fun-with-the-SharePoint-Welcomeascx-control.aspx , But it did not worked in Webpart.

View 1 Replies

C# - Develop A WebPart Like A Tab Based Control

Jan 9, 2010

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?

View 1 Replies

C# - Nesting A SharePoint Webpart Inside Of User Control?

May 4, 2010

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">
<!-- SharePoint web part goes here -->

View 1 Replies

Web Forms :: How To Find Control For A GridView Inside Panel Control

Apr 23, 2010

I am developing a asp database that is linked with SQL Database. When I am tryind to Find Control (GridView2) inside of another control (Panel2) that sits in Item Template for DetailsView, I got an error message:

Object reference not set to an instance of an object.
<asp:DetailsView ID="DetailsView1" HeaderText="Details" HeaderStyle-CssClass="labelheadRight" runat="server" AutoGenerateRows="False" DataKeyNames="pk_BackupDriveSerial"
DataSourceID="SqlDataSource1" GridLines="None"
CssClass="Detailsview" AllowPaging="True"
<asp:BoundField DataField="pk_BackupDriveSerial" ControlStyle-CssClass="dropdownsize"
HeaderText="Serial No" ReadOnly="True"
SortExpression="pk_BackupDriveSerial" >
<ControlStyle CssClass="dropdownsize"></ControlStyle>
<asp:BoundField DataField="BackupDriveMake" HeaderText="Make" ControlStyle-CssClass="dropdownsize"
SortExpression="BackupDriveMake" >
<ControlStyle CssClass="dropdownsize"></ControlStyle>
<asp:BoundField DataField="BackupDriveModel" HeaderText="Model" ControlStyle-CssClass="dropdownsize"
SortExpression="BackupDriveModel" >
<ControlStyle CssClass="dropdownsize"></ControlStyle>
<asp:TemplateField HeaderText="Type" SortExpression="fkid_BackupDriveTypes" ControlStyle-CssClass="dropdownsize"
<asp:Label ID="Label6" runat="server" Text='<%# Bind("BackupDriveMake") %>' Width="145px"></asp:Label>
<br />
<asp:TextBox CssClass="dropdownsize" AutoPostBack="true" ID="DropDownList5" runat="server" Text='<%# Bind("BackupDriveModel") %>' ></asp:TextBox>
<br />
<asp:Panel ID="Panel2" runat="server" CssClass="dropdownpanel" >
<asp:GridView CssClass="dropdowngrid" ID="GridView2" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="pkid_BackupDriveTypes" SelectedValue='<%# Bind("fkid_BackupDriveTypes") %>'
DataSourceID="SqlDataSource3" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView2_OnChange">
<RowStyle BackColor="#EFF3FB" />
<asp:BoundField DataField="pkid_BackupDriveTypes"
HeaderText="pkid_BackupDriveTypes" InsertVisible="False" ReadOnly="True"
SortExpression="pkid_BackupDriveTypes" Visible="False" />
<asp:BoundField DataField="BackupDriveMake" HeaderText="Make"
SortExpression="Make" />
<asp:BoundField DataField="BackupDriveModel" HeaderText="Model"
SortExpression="Model" />
<asp:CommandField ShowSelectButton="True" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
<asp:DropDownExtender ID="DropDownExtender2" runat="server" DropDownControlID="Panel2" TargetControlID="DropDownList5">


I also tried


View 5 Replies

Web Forms :: Lost Child Control After Postback In Panel Control

Nov 1, 2010

I had a little project is create dynamic control. My project had get detail of content and replace in sign string, Add control in sign. After click button I will find in control, I had added on page load in panel. I can't get value in child control panel, Don't have control in panel. My source is

protected void Page_Load(object sender, EventArgs e)
string config_design = GetConfigueKey(configDesign);
Genform(config_design, GetContent(config_design));
if (IsPostBack)
btn_submit_click(sender, e);
string config_design = GetConfigueKey(configDesign);
Genform(config_design, GetContent(config_design));
protected String GetContent(string designname)
string rev = "";
mClsDB = new clsConn();
DataTable dt = mClsDB.GetDataTable(strSql);
if (dt != null)
if (dt.Rows.Count > 0)
rev = dt.Rows[0]["STR_DESIGN_CONTENT"].ToString();
return rev;
protected void Genform(string designname, string content)
string rev = content;
mClsDB = new clsConn();

View 1 Replies

Forms Data Controls :: Gridview Getting Headertext From Underlying Datasource Column Name?

Feb 25, 2011

I have a GridView whose AutoGenerateColumns="False". However, I don't want to statically specify the HeaderText for the columns in HTML markup. Rather I'd like to set the HeaderText to be the name of the underlying SQLDataSource column name. How can I do this?


View 4 Replies

Web Forms :: Asp:panel Control Add

Jan 9, 2011

a.Aspx. file contain
<asp:panel id="pa_ID" runat="server">


a.Aspx.cs file contain


View 4 Replies

C# - How To Get Gridview Underlying Datasource

Mar 2, 2011

i have gridview in my asp.net web application under framework 3.5. I am binding the gridview with List. Inside the grid there is update and delete functionalities which are running fine. But my save functionality, for which i decided to extract the list back from the datasource and then through loop i will insert the new list to database. But when i tried to get it conventional way it returned me null.

I tried the following ways to retrieve the List back.

1. List<MyClass> list = (List<MyClass>gv.DataSource);

2. List<MyClass> list = gv.DataSource as List<MyClass>;

3. IDataSource idt = (IDataSource)gv.Datasource;

List<MyClass> list = (List<MyClass>)idt;

But no luck, each time i got null.

View 2 Replies

Web Forms :: WebPart Drag And Drop?

Feb 17, 2011

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:

<form id="form1" runat="server">
<asp:WebPartManager ID="WebPartManager1" runat="server">
<asp:WebPartZone ID="LEFT" runat="server">
<asp:TextBox ID="tb" runat="server" />
<asp:WebPartZone ID="RIGHT" runat="server">
<asp:EditorZone ID="EditorZone1" runat="server">

Here is the code behind:

protected override void OnInit(EventArgs e)
WebPartManager mgr = WebPartManager.GetCurrentWebPartManager(this);
mgr.DisplayMode = WebPartManager.DesignDisplayMode;

What am I missing?

View 2 Replies

Web Forms :: How To Set Background Color Of Webpart

Feb 15, 2011

I am trying to set different backgroundcolor of each webpart title. But unable to do that.

View 1 Replies

Web Forms :: WebPart Feature For Administrators Only

Mar 5, 2010

I need to set the webpart to administrators only. How can I allow only shared scope. User scope is not allowed even for administrators.

View 1 Replies

Web Forms :: How To Add Button (Verb) To WebPart

Jan 13, 2011

I seen some posts, some MSDN Materials...uh...Basically what i observed is every is creating a user control and adding it tot the web part..

I had a doubt that can we add button directly to the webpart in the title Zone? If yes how?

provide a simple example for adding custom verbs to the WebPart.

View 1 Replies

Web Forms :: Single Instance Of A Webpart

Mar 12, 2010

Is it possible to restrict users from adding more than one isntance of a webpart on a page?

View 1 Replies

Web Forms :: In Webpart Getting Only Browse Mode?

Apr 13, 2010

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


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

View 1 Replies

Web Forms :: Gridview Inside Webpart In C#?

Jan 1, 2010

I am trying to read the data from XMLDataSource into a gridview (in asp.net). It works when I perform below logic:

Dim ds As New DataSet()
GridView1.DataSource = ds.Tables(0)
and I hardcoded the resultant hyperlinks inside the GridView with some name using the following exp: (and it works).....

But when i embed the griview inside a webpart , configure the datasource, I am not able to read the data from the XMLDataSource. I get the following error: The DataSourceID of "GridView1" must be the ID of a control of type IDataSource. A control with ID "XMLDataSource1" could not be found.

View 3 Replies

Web Forms :: Cannot Get Dynamic Webpart Data

Apr 7, 2010

I get a problem in rendering dynamic webpart data. Firstly, I add a user control as webpart to a WebPartZone control by WebPartMnager.AddMethod() And then, it returns a WebPart object (adding method OK) -> No problem here it also shows the user control on my page. Everything look like perfect. aspnet_Paths and aspnet_PersonalizationAllUsers table also have data -> No problem here

You can see this photo : [URL] However, when I re-start browser or re-load my current page (ctrl + F5) then the user control which I added is disappear. You can see this photo : [URL]....................

View 6 Replies

Web Forms :: Inline Editing On A Webpart?

Jan 16, 2011

Is in-line editing possible on a webpart??I would like to enable a user to directly edit text within a webpart, without a postback and without launching its editor.Can someone show me how this would be done? How would I save the content using a callback?

View 2 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved