|
Fred, thanks for the explanation I guess I didn't pay attention to the SEO aspect of it. I did some research and found this article www.wwwcoder.com/main/parentid/457/site/6173/68/default.aspx. It seems like the popular opinion on this issue is that if you are concerned with your page's ranking by a search engine, then you may want to remove the view state completely and rely on the good ole session state.
Here's another article using DNN, it tells you how to do that.
www.wwwcoder.com/main/parentid/224/site/3507/68/default.aspx
Sam
|
|
|
|
|
Sam:
Thanks for replying.
Actaully i want to keep the state of the page.If i turn it off for a page, i would nt be able to do so.
Its for SEO perposes (Or my boss just does not like it).
I want to keep the _viewstate hidden field but i just dont want it to appear at the top of the htmlForm (in View Source) but some where at the bottom.
It has to something the way page renders it controls.I may need to change the default rendering of the controls. I have a slight idea but just dont know the entry point.
Thanks
Aamir
|
|
|
|
|
Aamir, check out my response above to Fred's post.
sam
|
|
|
|
|
Thanks Sam:
I also found some articals explaining the viewstate delima.
Most of them suggest to place the viewstate in session or cache instead of page.It not only helps in improving the performance but also in page ranking( since all the junk is out of the page).
Tommorow i m going to implement this idea.
I will keep u posted once i am done.
Thanks
Aamir
|
|
|
|
|
Hello guys.
Here is the code to move _VIEWSTATE hidden field from top of the form to
bottom.drop this code in the basepage and then inherit all the pages from the basepage in ur app.
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
base.Render(htmlWriter);
string html = stringWriter.ToString();
int StartPoint = html.IndexOf("= 0)
{
int EndPoint = html.IndexOf("/>", StartPoint) + 2;
string viewstateInput = html.Substring(StartPoint, EndPoint - StartPoint);
html = html.Remove(StartPoint, EndPoint - StartPoint);
int FormEndStart = html.IndexOf("") - 1;
if (FormEndStart >= 0)
{
html = html.Insert(FormEndStart, viewstateInput
}
}
writer.Write(html);
}
Thanks sam:
Thank you everyone.
Aamir
|
|
|
|
|
Hi all! I'm an expereinced asp.net developer, I want to learn AJAX but after searching on the net I found everything is messy please suggest some resource which should be from the ground up and simple enough. very confused about AJAX,Atlas etc. Downloaded an article from codeproject but could not use it , it gives error please help
Thanks
Don't Quit
|
|
|
|
|
|
Actually I disagree.... yes, this si good but IMHO before moving on to frameworks such as Atlas it is a good idea to learn the nuts and bolts of how and why it all works and learn some basic AJAX coding from sratch, or from "the ground up" as Nitin1981 put it...
I agree with him, there are precious few "clear" articles on this. one thing you can do:
As all the J in AJAX is client side, you can view and download other people's AJAX enabled bits and bobs and see how they've done it! Even if the J is in linked files there are sinple IE extensions you can use to get it.
Otherwise, I found these set of articles, though wordsy, quite good:
http://www-128.ibm.com/developerworks/web/library/wa-ajaxintro1.html[^]
good luck!
cheers
Fred
|
|
|
|
|
|
Currently, I am using the DataList to display the data. My DataList code looks something like this:
<datalist>
<itemTemplate>
<tr>
<td>Name:</td>
<td><% DataBinder.....%></td>
</tr>
<tr>
<td>Company:</td>
<td><% DataBinder.....%></td>
</tr>
</itemTemplate>
</datalist>
My question is: How can I have an easy way of sorting this data. I would like the users to be able to sort the data by Name or by Company. I understand I can add AllowSorting to DataList or DataGrid, but then I would have to display the column names and display the data in 2 columns, which I dont want to do.
So is there any other way to allow the users to sort this data, without having to write much code? I am using ASP.NET 2.
Thanks
|
|
|
|
|
I have a page "A" in which ther is a table in which i include another page "B" in . I want to use a function of "B" in "A" . Please help me.
|
|
|
|
|
Make the functions of B page public and create the object of B in A's code file and use those functions
|
|
|
|
|
Or a more object oriented and reusable way would be to include the common method in a seperate class, in you App_Code folder if using 2.0, that could be used by both pages.
only two letters away from being an asset
|
|
|
|
|
Hi friends
I have tree view.
i want to expand and collapse it without page reload
Thanks in advence
Pathan
|
|
|
|
|
use tree properties and methods
tree.ExpandAll(); // to expand full tree
tree.CollapseAll(); // to collapse full tree
tree.Nodes[i].ExpandAll(); // to expand all sub nodes of i node
tree.Nodes[i].CollapseAll(); // to collapse all sub nodes of i node
tree.Nodes[i].Expand(); // to expand i node
tree.Nodes[1].Collapse(); // to collapse i node
|
|
|
|
|
Use Javascript on the client side to expand and collapse, or use something like the Atlas UpdatPanel.
only two letters away from being an asset
|
|
|
|
|
I can use Server.MapPath to find and read from files on my server; however I can only do this from within the code-behind for a web-page and not a separate class which gets compiled into the application dll.
if I have function within this class/dll that wants to read from an xml file located in the same /bin folder, how do I do it? Is it just a matter of the right import statement in the class, or do I need to use another method altogether?
OK, I could use server.mappath before calling the function and pass the full path as a parameter, but apart from that...
thanks
Fred
|
|
|
|
|
use
using System.IO; // for C#
Imports System.IO // for VB.NET
and then try using Server.MapPath
|
|
|
|
|
Thanks - but that doesn't work (which doesn't actually surprise me as "server" is not a member of system.io, as far as I can see...)
In case it's not clear: I want to read a file from within a class module (as opposed to a code-behind module of a webapge)
cheers
F
|
|
|
|
|
its working fine at my side i m using it in a code class file (i.e. a data access class) not code behind file and it is working
|
|
|
|
|
Well, I don't know. Thanks for ytour answer, but in my environment (VS2003) it simply doesn't recognise server.mappath within a class module....
remind me not to visit your akaas.net site again!! I lost count of the unwanted popups offering to install this that and the other... nothing turns me off a site faster than that! Didn't get past the first page but closed them all down as fast as I could....
cheers
Fred
|
|
|
|
|
How to get the India time zone with asp
Kumar.a
email : akumar8_k@yahoo.com
info@livecriket2007.com
|
|
|
|
|
|
asp.net 2.0,ATLAS and XAML must i unit in one application.
how can merge this in one appliaction?
i am making presentation of component parts ASP.NET,ATLAS and XAML.
Have anyone any idea,what a application let i develop ?
i would be grateful,for any exampel or idea?
danks,
M
|
|
|
|
|
i am having the grid which displays some table content,
how to take printout of the whole datagrid content with the same format.
Help me.
abul
|
|
|
|