.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

Change the .NET framework configurations programmatically.

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
Hi, I want a code to change the configurations of the .NET framework programmatically( Not the pre-installed configuration tool), I need a sort of library to be able to change it. Thanks Regards Tamer Khalil

View Complete Post

More Related Resource Links

Drop Down Listbox SelectedIndexChanged Event not firing when I programmatically change selection

I have two drop down listboxes (DDL1 and DDL2).  When DDL1 has an index change, DDL2 then has a refresh of list items based off SQL Server SELECT from a table.  The database isn't the problem.  Everything works perfectly when the user selects a new item manually from DDL1.But in my code, I save the user data from the selection of DDL1 in a separate table.  And then upon rendering of the page (Page_PreRenderComplete), I do a SelectedIndex assignment of the value of what's saved in the db table.  That works just fine, it selects the DDL1 item, but DDL2 is unaffected, as if DDL1's SelectedIndexChanged event isn't called like it would be if manually changed.  How can I get around this?Thanks in advance. :)

Change webpart properties programmatically

I am attempting to modify the properties of another webpart when my webpart's button is clicked. The code compiles and runs, and stepping through it shows that the properties do change. However, they don't stay changed. This example attempts to toggle the visibility state, but other properties won't stay changed either. Any help is appreciated.     SPSecurity.RunWithElevatedPrivileges(delegate() { // get the site in this context using (SPSite SiteCollection = new SPSite(mySiteGuid)) { // get the web in this context SPWeb myWeb = SiteCollection.OpenWeb(myWebGuid); myWeb .AllowUnsafeUpdates = true; // Hide/display another webpart. Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager mgr = null; mgr = myWeb.GetLimitedWebPartManager( "default.aspx", System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); foreach (System.Web.UI.WebControls.WebParts.WebPart myWebPart in mgr.WebParts) { // If this is the webpart we want to modify... if (myWebPart.Title == "Other Webpart Name") { // Toggle the visibility state. myWebPart.Visible = ! myWebPart.Visible; myWeb.Update(); break; } } } });

Can we change the site administrator programmatically?


Hi all,

I need to change the site administrator through programmatically...So Please tell me how can we do this...

thanks in advance....

Change image paths programmatically



I am working on a localization project, some of the localized text are in graphics, some of the example graphics  paths:




My web forms use <asp:image> controls and <img> tags (runat = sever) to point to graphics in /en/images. I need to a function to loop through all image control and point them to different paths based on the locale set at runt time. Which event should I override and how do I write it?

All my web pages inherit from a base page, I don't know if that makes differences.




How programmatically change Additional Column Settings - Show field?


Hello. I use the SPFieldUser in my list. I can change Additional Column Settings - Show field: "Name with Presense" on the "Name (with Picture and details)" using the WSS Web interface. How do it programmatically, using Object Model WSS?

Programmatically change DisplayName/ Title for custom content type


I've created a custom content type with the following code.

if (currentWeb.ContentTypes["My Content Type"] == null)
  var myContentType =
    new SPContentType(currentWeb.AvailableContentTypes[new SPContentTypeId("0x01")],
              currentWeb.ContentTypes, "My Content Type");


After that I add this content type to a generic list. If I now click on "New element" on my list ribbon I can add a new item with displayname "My Content Type". How can I change this value as I want to name my content types like "xxx content type" but don't want to see "xxx content type" in the "New element" action.

I expected the name of the content type to be some kind of internal and I'm looking for something to be change the displayname or title to be able to display something different. If I didn't made myself clear, I'll try to be more explicit. Thanks in advance.

Visual Web Parts - programmatically change Web Part Title not working



I have four custom made Web Parts (based on the Visual Web Part template) that show a filtered set of data from various lists. These work just fine on my front page (which is a Publishing enabled page/site). Each Web Part has some functionality for setting a date filter on the set of data. Now, on every load I generate a string which tells what the current filter is (default filter, custom set date filter +++) and set this string to the Web Part's Title. This text then shows up in the Web Part's header. All this works just fine on the front page.
However, I also have a few sub sites that are based on either the Blank Site or a Team Site and on these sites setting the Web Part's Title property doesn't work. Well, it works, but doesn't get rendered. If I do a "Edit page" or go to one of the Web Part's properties, all the Web Parts' headers get updated to the correct text. But, the next time I load the page, it's back to some old value. 

I dont' get it! Does anyone know what might be causing this?


Change LinkButton InnerHtml programmatically


I would like to change the innerHTML of a LinkButton programmatically.


<asp:LinkButton ID="LinkButton1" runat="server">ChangeThisValue</asp:LinkButton>

How can i get ChangeThisValue changed programmatically?

how to change the database while using Ado.Net entity framework?



how to change the database while using ADO.Net Entity Framework?  

I have two identical databases. I want to change the db. Can i change it through web.Config?

Like LINQ to SQL ?




Need to change .net framework from 4.0 back to 3.5 Host does not yet support 4.0


I tried to access my site (www.nrarities.com) using Visual Web Developer 2010.  It asked if I wanted to upgrade to .NET 4.0.  I said yes, and now users can not get to site. receive message as below pointing to web.config file.  How do I respecify that I want toe site to use 3.5.  Please help as the site is now completely down.  Thanks.




Line 58:      debugging ASP.NET files.
Line 59:   -->
Line 60: 		<compilation defaultLanguage="vb" debug="true" targetFramework="4.0"/>
Line 62:      Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. 

How are targeted versions affected in new Framework Support Lifecycle Policy Change starting April 2


Hopefully this is the right forum, I searched and wasn't really sure where to put this.

In about a month the Support Lifecycle changes for the .NET Framework as referenced here http://support.microsoft.com/gp/lifeandotnet

We are trying to determine if we need to upgrade our applications or not and have gotten quite confused.

We have a number of web applications that target the 2.0 framework.  We also have Framework 3.5 SP1 installed on our web server.  3.5 SP1 uses the same CLR version 2.0 as Framework 2.0.  Because we have 3.5 SP1 installed, does that mean our applications that target 2.0 will still be covered under the new support lifecycle? 

Would the same apply to a web application that targets 3.5 that references a class library DLL that targets 2.0?

Thank You.

How to change .Net framework version without restarting W3SVC service in IIS?

In this short article I will explain how to change the .net framework version in the IIS for the specific application without restarting W3SC services.

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Creating a Generic Entity Framework 4.0 Repository

With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework.

The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to SQL. To set things right, Microsoft proactively moved forward with improving Entity Framework, in time for the 4.0 release of the .NET Framework. This is good news because my initial impressions, so far, have been nothing but positive.

ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities

I did not play much with Dynamic Data controls in VS2008 and just made a cool discovery in VS2010 Beta 2. This may not even be new, but as I'm sitting 30,000+ feet over the Atlantic ocean, I don't have access to VS2008 at the moment to check.

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.
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