.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

How to create Webpart pages dynamically ?

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :SharePoint

Hello friends,

I need to programatically  create a webpart page on my sharepoint sit on the activation of a feature and after creation of that page, i need to add a webpart. How i will do that? Is it possible create a Webpart page dynamically?


View Complete Post

More Related Resource Links

Dynamically Create Controls in ASP.NET by Using Visual C# .NET

This article demonstrates how to dynamically create a control for an .aspx page. The sample project does the following:
Creates two TextBox controls.
Verifies that the contents (TextBox.text) and the attributes of the TextBox are saved across posts to the server.
Illustrates handling events that are posted by a dynamically-created control

Dynamically Create Controls in ASP.NET with Visual Basic .NET

This step-by-step article describes how to dynamically create controls for an ASPX Web page.

The sample project does the following:
It creates two TextBox controls.
It verifies that the TextBox contents (TextBox.text) and attributes are saved across posts to the server.
It describes how events that are posted by a dynamically created control are handled.

Create a Outlook Task from Custom WebPart in Code



I have a requirement to create a Outlook Task , from a custom webpart through code .

Is this possible?

has any body tried this , if yes can you please give me an insight on how to acheive it.

Some sample Code would be highly appreciated.



How to dynamically create user controls ?



can you explain how to create user control dynamically in a web form ?When i am creating server controls of user controls are not instantiated and it is not getting initialized .when i am tyying to initialize its properties error occurs tha object instance not created .

Any suggestion ? 

how do i create a webpart for sharepoint 2010 that allows users to create their own subsite..



how do i create a webpart for sharepoint 2010 that allows users to create their own subsite..

for e.g..

i create a webpage in vs 2010 which allows users to create their account by specifying username and password..and make it a webpart and after that for that user a subsite should be created under sharepoint 2010 top level site.....how could i achieve that..

Want to Create Table Dynamically With text Control in WinForm Csharp

Hello To All... from Many Days i m tryng to create a simple table using csharp in WinForm.Which will include textbox in each cell according the Passed No of Col & Row. but not getting the proper result. Actually i want to trace each cell data and want to save each cell data to data base : eg. in cell 11(1col & 1row) i m having Combobox which having some item list and when the user select the list item the data will save to the database. Regards, Praveen    What is the Key of Life ... Its Sharing Your Thought & Knowledge ...

How to create a dynamically populated items in a listbox and use it as a navigation?

Hello, I am trying to create navigation inside a listbox menu. I load data from xml to populate a list. Each item in the list box should be a link or button. Then, I create a frame to load xaml pages in it. I tested to load pages employing button control, outside listbox with on click event and it worked well. However, I cannot make it work with list box items. I am hoping to get help from you. Any sample or ideas are highly appreciated. Below is the code:  XML: <?xml version="1.0" encoding="utf-8"?> <Pages> <page id="page01"> <name>Page 01</name> </page> <page id="page02"> <name>Page 02</name> </page> </Pages> C# to initiate a click o n listbox item and get the path to page: private void SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { ListBoxItem lbi = ((sender as ListBox).SelectedItem as ListBoxItem); string itemName = lbi.Content.ToString(); if ( Nav_ListBox.SelectedItem.Equals("Page01" ) ) { ContentFrame.Source = new Uri("Pages/Page01.xaml", UriKind.RelativeOrAbsolute); } } XAML:  <ListBox x:Name="Nav_ListBox" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Background="#FFF2F2F2" ItemTemplate="{DynamicReso

How to Create Page layout only for webpart zone

HI Guys, I want to Create Page layout for Publishing site in SP2010 so do i need to create Page Layout Based on Page content Type ? i have created page layout based on Page content type but when i save page i got error Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page. Please assist me.   Thanks Ronak Thanks Ron

How to create a custom webpart - similar to page viewer webpart but one that will be able to get a p

we want to pass a link to moview items from a list, the page viewer seems god to display the movies but it doesn't support connections....?

dynamically create columns from xml

<?xml version="1.0" encoding="utf-8" ?> <mappings root="sound" child="item" delimiter=",">    <mapping pos="0" name="product" type="Element" />    <mapping pos="1" name="partID" type="Attribute" />    <mapping pos="2" name="numberInStock" type="Element" />    <mapping pos="3" name="numberOnOrder" type="Element" />    <mapping pos="4" name="deliveryDate" type="Element" />    <mapping pos="5" name="supplierStreet" type="Element" />    <mapping pos="6" name="supplierCompany" type="Element" />    <mapping pos="7" name="supplierPhone" type="Element" />    <mapping pos="8" name="orderedBy" type="Element" /></mappings>this is my xml file what i need is a table with 9 columns say item,product....orderedBy

Dynamically Drop and Create tables, overcoming 4000 charachter limit

We have a Navision SQL-server database for 7 companies. Each table starts with the name of the company. Except for the CompanyName-part, the tables names are equal. I made a Foreach loop that dynamically transfers tables/data from the the Navision-database to a staging-database. I also want to Drop and re-Create the tables dynamically. However, if I try to do that via an expression in a SQL Task, SSIS complains about the 4000 character limit. What is a better way to do this? I want to execute SQL-commands and have SSIS replace part of the tablename with the contents of a variable (being the name of one the 7 companies). I have no access to the Management Studio or the DB so I need it to be done within the package. What is the best way to do that?

Dynamically Create a Database (LINQ to SQL)

 Hello... I want to create an install script for a simple little CMS I have created for myself... I want to pass the connection string and then create my tables. I found the following example on MSDN: http://msdn.microsoft.com/en-us/library/bb399420.aspx My question is how do I pass the username and password to the DB... or even better if there is an example of this somewhere that would be great.   Thanks!

What is the best way to dynamically create a scrollable list of forms that when clicked expand for e

Hello, What is the best way to dynamically create a scrollable list of forms that when clicked expand for entry? More details: In my XAML I have a TabControl. One particular TabItem looks like this:   <TabItem Name="Tab_Forms" Header="4" Width="50" Height="20" Background="{x:Null}" BorderBrush="{x:Null}"> <Border Name="Tab_CategoryTabSelected_Border" BorderThickness="10" BorderBrush="Transparent" Padding="3"> <... What do I use here? ...> </Border> </TabItem> At the location <... What do I use here? ...> I need some sort of scrollable control.  The scrollable control can be part of the XAML above. However, the contents of that scrollable control will be entirely code generated. Within that scrollable control will be a vertical list of forms by name with an expansion/contract button next to the name.  When the user clicks the expansion button, the form expands into view, and may be longer than the viewable area, and the user will need to be able to enter data into the entry fields.  I need the tab key to go from field to field as would be expected. If the user is on the last viewable field and there are more fields below, when the user hits the tab key, the for

create webpart for tabs

Hi,I want to create a webpart which contains few tabs and each tab should point to different URL with some parameter.can you please suggest how it can be done using custom coding..using SP Objects.thanks

Permissions:disable controls by roles(access pages too)(dynamically :each new role has special grant

HelloI have an application of many pages of consultation and same time I have a module of adding users by roles and creating accounts by role.(the application is ready but i cant manage the roles)the tutorials that i found are very useful to manage roles but its roles fixed before(administrators,supervisors)(http://www.asp.net/security/tutorials/creating-and-managing-roles-vb) if I add a new role (agent) i want to grant to this new role a new access to pages(different access than admin and supervisor) and disable new controlswhy not using checkbox to every new role checking a field related to databaseis it possible?if yes ,how can i begin?Thanks

Dynamically Setting the property value FilterValue1 of the Content Query WebPart? Inline? codeblock?

I want to dynamically set the FilterValue1 property of a Content by Query to the querystring ID. I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck Without having to code my own webpart, any way to change the value with a small C# code block? How about with javascript? Thank you!    

How to set create-only permissions to publishing pages library?

I have publishing site where users can add their own pages to some libraries. I have problem with permissions when user creates new page. Here's how I set permissions: all users are added to members group (by default they can view pages) members group has view permissions also for master pages library For site where users can add pages I set the following permissions on pages library users can add view pages users can add pages When user adds new page then he/she gets automatically edit permissions for this page. So users can edit only their own pages. I found out that add permission is not enough - when user creates page then he/she gets access denied error. The minun that doesn't cause problems is approver permission to pages library (of course, now users can do everything on pages library they ever want to do). Is there any way to avoid making users as approvers?  They only need view and add permissions for page library and view and edit permissions for pages they added. They cannot do anything more. Approving and denying of pages is administrators job. With best regards, Gunnar Peipman   Also visit my ASP.NET and SharePoint blog!
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