.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

changing the content of website runtime

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
say i have a table in my website that contain <tr>  and <td> and "hello good morning" is wriiten over there. how can change the content of my website to "hello good night" on a click of button or using any other way of doing  this like yahoo and other popular website did.

View Complete Post

More Related Resource Links

Changing crid cell content at runtime


In a cell in a grid, I have a TreeView. When the parsing of the data behind the treeview yields an error, I would like to replace the treeview with a textblock with information on the error details.

I'm thinking about using a datatemplateselector, but I can't figure out how, or if this is the best approach. Any suggestions?

Alternatively I will place a ContentControl in the grid cell and populate it with the correct content from the code behind file, I just think there could be a more elegant solution in pure XAML.

Programmatically Changing the Profile Provider at Runtime


Dear All

I'm using one application but have multiple providers in my web.config for memberships, roles and profiles to allow my application to be used by different groups of users who need to connect to different databases.

This means I'm having to change the membership, role and profile providers on-the-fly in my code-behind files. So far I've taken care of the membership and roles a bit like this:

Dim RolePV As RoleProvider = Roles.Providers(GetSettingFromFile("Provider"))

However, I'm having trouble finding out how to do the same sort of thing for Profiles. I've looked at ProfileProvider and ProfileManager but I can't work it out how to access my the profile property that I've created in my web.config file called "ScreenSize". Normally you would just write Profile.ScreenSize to read or write to the property.

Please can you help me to understand how I access the profile property called ScreenSize by dynamically setting the profile provider first?

I'd be very grateful for any help or advice.

Many thanks



Changing case of all URLs in the website source code from Sentence to Lower

I only want to change case (Mixed to small) of URL in HREF attribute, nowhere else. This is just for convention purpose. eg changing   Its <a href="http://www.abc.com/S pecial-E dition.aspx">Special Ediation</a>.  View <a href="http://www.abc.com/O ther-N ews.aspx">Other News</a>.   to   Its <a href="http://www.abc.com/s pecial-e dition.aspx">Special Ediation</a>.  View <a href="http://www.abc.com/o ther-n ews.aspx">Other News</a>.

Changing title o sitemapnode at runtime from code behind c#

Hi guys ! I have a site map on my project and I have section which get values from sql database and it changes according to querystring Id value. In my sitemap the title of the page is everytime same. but I want tpo change it at runtime. I am using multiple sitemaps and My sitemap is not the default one. its name is rootSitemap. I tried some code which I got from msdn but it seems doesn't work for me; protected void Page_Load(object sender, EventArgs e) { SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(this.ExpandForumPaths); } private SiteMapNode ExpandForumPaths(Object sender, SiteMapResolveEventArgs e) { // The current node represents a Post page in a bulletin board forum. // Clone the current node and all of its relevant parents. This // returns a site map node that a developer can then // walk, modifying each node.Url property in turn. // Since the cloned nodes are separate from the underlying // site navigation structure, the fixups that are made do not // effect the overall site navigation structure. SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true); SiteMapNode tempNode = currentNode; tempNode.Url = tempNode.Url + "?TransferType=" + Request.QueryString[0].ToString(); tempNode.Title = "My Transfer Desc - " + Request

Changing the content type of a document

Hi everybody, Can we change the content type of a document ? For example, I have a custom content type 'A' that inherits from the default document content type. If I upload a document (on behalf of the windows explorer) and the default document content type is assigned, can I change it to the content type 'A' after ? Thanks in advance.Psyllos

ContentControl's ToolTip - issues changing Content

Hi all,   I'm having a few issues changing the Content of a ContentControl.   I have a collection of MyClass. One of these at a time has a property IsSpecial set to true. I loop through the collection, find which one it is, and set my ContentControl's Content to the "special" MyClass. Later, a different MyClass becomes special (and the older one's IsSpecial is set to false). I then loop through, and reset the Content to the new MyClass. The problem I have is nothing seems to be updating/changing - the DataTemplate is showing the data from the previous MyClass. Changing the Content from one object to another should work, right?   EDIT: Further testing shows that the Content IS changing, but the ContentControl's Tooltip is NOT. The tooltip is part of my DataTemplate.

Custom CMS ( Content Managment System ) for Asp.net website


Hi all,

I have to design and develop the Own CMS (Content Management System) for Asp.net Website.

but i dont know from where i have to get start ??? like Database Design etc.

Any Idea regarding the CMS development is appericated.




Changing the address in app.config at runtime ..AN ISSUE..HELP neede..

hi wcf champs.,

hmm...I have a problem..and seriously need a solution to get things done well..!!

Have developed a wcf Upload application,the wcf service is hosted on IIS..now,the endpoint address at the server is exposed at client(in app.config).If further the server ip changes to some other..then the address at the client must be changed..!right..ya I did something to handle this but ,its another problem..!!.

Let me say what i have done and why does that give a problem..


*.*.The server ip is stored in a xml file.When the application runs,it picks up the server ip and changes it in Client.exe.config...

*.And if there is EndpointotFound exception at the client,it asks the admin to check the ip of the server.

*.The admin checks it and if the server ip is changed,the admin changes the ip in the xml file (where server ip is stored).

now let me know.."IS THIS A RIGHT APPROACH TO SOLVE MY PROBLEM" ..But then there is a problem!!let me share that with u..


*.The ip that is picked from  xml and placed in Client.exe.config.

Changing fonts at runtime


Is it possible to change a font at runtime? I am using reporting service to generate letters. Some letters use a different font (can based on a field value), but I don;t really want to use a separate report for each one.

Strange behaviour taxonomy filter in content query webpart on anonymous website


We are experiencing strange behaviour on a publishing facing website implemented in SharePoint 2010.

The story
We use a (default) Content Query Webpart to show related information in relation with the current page. The filter is using a field value (UserFieldValue) of the current page and filters other pages which have the same tags. The fields, on the current page and the related pages, are taxonomy field. Everything works fine!

We published the pages, looked at the website as an anonymous user and everything was still going smoothly. We went home, slepts an hour of 6, waked up. Proudly checked our beatifull new website :). Ahhhhh, what is this.. all content query webpart with the filters on the taxonomy field returned exactly nil.

We logged in to our website, checked if the pages where published, and well, they are... Just published them again. And everything looked fine again.... but not for long. Exactly the next day (... app pool recycle ...) the same problem ...

Logged in again to our website, logged out...  problem solved.... till the next apppool recycle.

My conclusion
Until the firrst authenticated visit to the page the taxonomy filter on the content query webpart silenty fails.

As a "temporary" workarround we have created a sc

Changing a control attribute at runtime.


Hi Guys,

I'm basically trying to get a div containing a loading gif to show on my page at runtime. I call it from a button click event as well as in the code flow. It was working before I used the AJAX Update Panels. I've since taken them out as they were causing issues with RegisterClientScriptBlock. By the way, does commenting out the AJAX Markup like this...

<%--           <asp:UpdatePanel ID="up_search" runat="server">

...remove them from influence?
My div markup looks like this..
<div id="loading" style="visibility: hidden;" runat="server">
    <img id="loading_gif" alt="Loading..." class="loading" src="Images/panel_loading.gif" />

My code is initiated from the button click event.

    protected void btnSearch_Click(object sender, EventArgs e)

        //show the loading image

how to chnage page content type at runtime in MVC?



 I am working in asp.net MVC & on the view has to show both json & xml content depending on some condition.

I have to change the content type of the page  at runtime ie,

if the condition for json is fulfilled then set page contenttype = "text/json"


if the condition for xml is fulfilled then set page contenttype = "text/xml".


I have tried setting default content type on view as


@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" ContentType="text/json"%>

& in controller c

sharepoint changing content type layout has no effect on old pages




I have a content type layout. After I changed it, it had no effects on existing pages. 

When I add new page with this content type it has latest version.


How can I fix this? I want my current pages to use new content type layout.



DataGridCell Alignment Style Changing Width of Content?


It appears to when I use the following style to alter the cell alignment of a column, it is changing the width of the cell's contents to no longer expand to fill. This is problematic as it means I have to click in the narrow region shown in the second picture to edit the contents. What's the proper way to fix this?

Style code:


<Style x:Key="RightAlignStyle" TargetType="{x:Type DataGridCell}">
  <Setter Property="HorizontalAlignment" Value="Right" />


Width without Style:


Width with Style:

Save Workflow Runtime as Application State or Session State for a website with multiple users?


I used Windows Workflow Foundation 3.5 as a page flow navigation for a ASP.NET website's Previous and Next page navigation.

The site acts like a shopping cart and each user has his own session and user data.  The app only has one WF.  I am not sure if I should generate one Workflow Runtime for every user or for simply generate one workflow Runtime for the entire application in my case?   

In the global.asax:

void Application_Start(object sender, EventArgs e)

void Application_End(object sender, EventArgs e)
    void Session_Start(object sender, EventArgs e)
        // Code that runs when a new session is started
        System.Workflow.Runtime.WorkflowRuntime workflowRuntime = new System.Workflow.Runtime.WorkflowRuntime(WorkflowManager.WorkflowRuntimeKey);


Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

SharePoint Tutorial - Content Types

SharePoint content types provide users with a way to manage and organize content in a more meaningful way. It's a reusable of settings you want to apply to a particular type of document in a library or item in a list.
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