Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Moving Viewstate at Bottom of page stopped Control PanelMoving Viewstate at Bottom of page stopped Control Panel
Previous
 
Next
New Post
2/18/2010 5:49 AM
 

Hello,

We have a DNN website with community version. We are getting a very big View State in DNN page, and this is not good for SEO(Search Engine Optimization).

So to remove viewstate at the bottom of page I added render method in Default.aspx.vb in my DNN website as following :

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
      Dim stringWriter As New System.IO.StringWriter()
      Dim htmlWriter As New HtmlTextWriter(stringWriter)
      MyBase.Render(htmlWriter)
      Dim html As String = stringWriter.ToString()
      Dim StartPoint As Integer = html.IndexOf("<input type=""hidden"" name=""__VIEWSTATE""")
      If StartPoint >= 0 Then
        Dim EndPoint As Integer = html.IndexOf("/>", StartPoint) + 2
        Dim viewstateInput As String = html.Substring(StartPoint, EndPoint - StartPoint)
        html = html.Remove(StartPoint, EndPoint - StartPoint)
        Dim FormEndStart As Integer = html.IndexOf("</form>") - 1
        If FormEndStart >= 0 Then
          html = html.Insert(FormEndStart, viewstateInput)
        End If
      End If
      writer.Write(html)
      ''MyBase.Render(writer)
    End Sub

With this change I am getting the view state at the bottom of the page. But now in Admin/host mode  "Control Panel" of DNN is not working.

 And I am not getting options of adding page, adding modules to a page, etc..

Can anyone please help on this.

Thanks and Regards,

Ashish Shukla

 
New Post
2/18/2010 12:23 PM
 
i do not recommend you move the viewstate to the bottom of the page. We used to do this but found that it consumed a lot of resources (as the text moved was immutable it consumed value space). In addition, Microsoft confirmed that as it's a hidden variable it is ignored by any spiders/robots, so it's harmless to leave it at the top (that's why Microsoft moved it from the bottom to the top of the page with .net 3.5)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/19/2010 1:10 AM
 

Hi Cathal,

Thaks for your quick reply.

Can you please suggest that how we can configure spider robot content to handle viewstate issue?

We want crawler to crawl on a page for reading page content.

Thanks in advance,

Ashish Shukla

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Moving Viewstate at Bottom of page stopped Control PanelMoving Viewstate at Bottom of page stopped Control Panel


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out