ViewState, QueryStrings And Their Effect On SEO?
Oct 7, 2010
I'm a novice ASP.Net/C# programmer, and had an experience only of a couple of projects during college and a couple of freelancing projects when I was recruited by a startup company to build their ASP.Net based website. I've just abut completed the website, and now since the company is not able to find a worthy enough SEO, I'm expected to do our site's SEO as well(which is a totally new experience for me). Did I mention that I'm the only Web Developer here?So, now as you'd expect a novice programmer having no concern for future SEO needs, I built up the site without giving due consideration to any of the SEO enhancement techniques.
The Problems:
ViewState - When is it required? Is it really required if I'm not creating any controls on the fly? I'm using DataControls though. And the website(the pages visible to the user not the CMS), is purely information based. Also, if I disable a control(ex: DataList)'s viewstate, will the viewstate of controls inside it also get disabled?(which is what I'd like actually)QueryStrings - Now comes the toughest part, I've used Query Strings to the extent that you can say that the website is QueryString driven, which unfortunately enough is not a good thing for SEO. To make matters worse, the QueryStrings for some pages are not uniform. For ex- In some cases the querystring may have variables A, B, and C, while in other cases it can have variables M, B, C and probably not all the three variables in some cases. Now, I know that I'd have to do url rewriting but these query strings have dynamic data fetched from the database tables of size more than 10,000 rows. So would I have to create functions for url rewriting and use regex to separate wheat from whaff?
View 1 Replies
Similar Messages:
Apr 28, 2010
Is there a utility to combine querystrings? I'm looking for something like:
Input: Combine("test=a&test2=b", "test3=c") Result: "test=a&test2=b&test3=c"
Input: Combine("test=a&test2=b", "") Result: "test=a&test2=b"
Input: Combine("", "test3=c") Result: "test3=c"
And maybe some weird ones:
Input: Combine("&test=a&test2=b", "?test3=c") Result: "test=a&test2=b&test3=c"
View 5 Replies
Feb 28, 2010
I am trying to implement URL Routing for a non MVC application. Here's my original [URL] to [URL] I have difficulty when the page has query strings in the URL. This is the route handler I have so far:
public class CustomRouteHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return BuildManager.CreateInstanceFromVirtualPath("ProcessStuff.aspx", typeof(Page)) as Page;
}
}
View 1 Replies
Sep 8, 2010
I have been looking at ways of encrypting querystrings and I have found a few good examples.. but, I just want some clarification on what is most often referred to as the EncryptionKey and the characters that are in that key....Is there basically an unlimited number of alphanumeric combinations that could be used in the following code as the encryption key, is there anything that someone should be CAREFUL about including in that key?
using System.Security.Cryptography;
private static string EncryptionKey = "!#$a54?3";
/// other examples: "r0b1nr0y"
///in a try-catch:
key = System.Text.Encoding.UTF8.GetBytes(EncryptionKey.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
inputByteArray = Convert.FromBase64String(Input);
View 3 Replies
May 5, 2010
i have a querystring like this : Comparison.aspx?id=4545&Product=foo&displaylevelname=128
it's being build by 3 hidden fields in a html tablerow based on checkbox selection.
but user can select multiple checkboxes (20) and afterwards
i need a querystring like this : Comparison.aspx?id=4545&Product=foo&displaylevelname=128;145;455;
So how do i go from :
Comparison.aspx?id=4545&Product=foo&displaylevelname=128
Comparison.aspx?id=4545&Product=foo&displaylevelname=145
Comparison.aspx?id=4545&Product=foo&displaylevelname=455
To Comparison.aspx?id=4545&Product=foo&displaylevelname=128;145;455;
View 4 Replies
Jul 20, 2010
I have a page with some value like this:
[URL]
what I want to do is when the user enters values on the page I want to be able to change "valueA" and "valueB" in the URL without redirecting, refreshing or posingBack. Does anyone know how to do this?
View 7 Replies
Feb 19, 2011
I have a gridview which can be filtered from one or more values in a querystring. That all works great: e.g. "?subject=Maths&authorName=Bond_James&type=Magazine"
The values passed to the query string come from 3 drop down lists: Subject, Author, Type. What I'd like is when the user presses "Filter" it will take the selected values from the drop down lists and pass them to the querystring - it could be 1 value, 2, or all 3 (like above).
The drop down lists have an item called "All Subjects" / "All Author" / "All Type" each with a value of -1. The idea being that if the user leaves these items selected then the Filter button just ignores them.
Here is my code so far:
[Code]....
Also, one more thing. How do I get the drop down lists to have the filters selected when the page re loads?
EDIT: I changed the default values of the drop down lists to "" - this leaves the URL looking messy though ?author=&subject=&type= This works, is it the best way?
View 2 Replies
Oct 20, 2010
I'm having problems with accessing querystring params in my page method. Everywhere I read it says you can access querystrings just fine, but when I try it just returns null, what's the problem?
same problem I found - [URL]
View 14 Replies
Nov 15, 2010
I am wanting to develop a URL Rewriting solution that handles postbacks and querystrings. I have found a couple of examples, but don't fully udnerstand the code and don't want to implement code I don't understand. Obviously at the heart of this issue is intercepting the raw url before the rewrite occurs, however, I am not sure exactly how to go about this.
View 4 Replies
Mar 24, 2010
We send out registration urls to clients via email. Some of the email clients are turning the url intourl <url>I think it may be happening when users forward the email onto themselves at which point the email client re-formats the original email (maybe)[URL]Which rightly producesSystem.Web.HttpRequestValidationException: A potentially dangerous Request.QueryString value was detectedWhere in the code should I intercept these instances and santize the url so that the user is re-directed onto the original form of the url?
View 1 Replies
May 7, 2010
I want to extract some keywords out of a query string for a search application in asp.net.I decoded the url string first, so it's plain textI have this to start with, but I want to add a keyword group
([?&])q=[^&]+[&]?
I get this ?q=harbour landing dental&I'd like to trim off the stuff for pure words, but not sure if that's possibleI also have a long list of possible query string value fields that I want to check against
?q=
@q=
?qs=
&qs=
View 2 Replies
Sep 20, 2010
Response.Redirect("./blah.aspx?key=my value with spaces");
It sends the browser to:
mysite/blah.aspx?key=my%20value%20with%20spaces
Now i understand why it's doing this - for the sake of ancient browsers that would choke on the spaces. But really, what i want is to have a nice-looking url with spaces instead of %'s everywhere, because it works just the same.
Is there some way to stop response.redirect urlencoding my spaces?
View 2 Replies
Apr 4, 2012
I'm trying to use hyperlink fields in my gridview to pass certain values into another page using querystrings. On the next page I've put 'labels' that should be populated with data from the gridview, however nothing happens. This is my gridview code:
"<asp:GridView ID="GridViewGuitars" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSourceGuitars" DataKeyNames="ProductID" BorderColor="White">
<Columns>
<asp:BoundField DataField="ProductID" HeaderText="ProductID"
SortExpression="ProductID" InsertVisible="False" ReadOnly="True"
Visible="False" />
[code]....
And this is the code behind file on the landing page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim ProdID As String = Request.QueryString("ProductID")
Dim ProdName As String = Request.QueryString("Prod_Name")
Dim ProdPrice As String = Request.QueryString("Prod_Price")
Dim ProdStock As String = Request.QueryString("Prod_Instock")
Dim ProdDescrip As String = Request.QueryString("Prod_Descrip")
[code]....
View 1 Replies
Oct 9, 2010
Now here is the weird thing. First i am running it locally on the built in vs2008 web server.I load my control in fine, do a postback from a linkbutton, locally on my machine it all works fine, no issue.However when it goes onto my host, it falls over with the message:
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.Now i also load controls dynamically and use postbacks and things in the admin area of the site...and that works fine, however my front end just keeps failing? See the code behing below:
[Code]....
View 1 Replies
Jan 11, 2011
I have problem getting values from viewstate in GetTopThemes.
<asp:ObjectDataSource
ID="sourceGetTopThemes"
runat="server"
TypeName="DBConnection"
SelectMethod="GetTopThemes"
EnableViewState="true"></asp:ObjectDataSource>
[Code]....
}
[Code]....
when the page is not Posted back, I saved all values in the viewstate.
View 2 Replies
Feb 11, 2011
I am developing a simple rating system for my employer's profile based web-app. Here is my problem:
The actual page is domain.com/review.aspx?user=username, but I use the url-rewrite module in IIS to use domain.com/username/review The page contains a repeater control that displays reviews for that username, as well as a form for people to create new reviewsWhen the form is submitted, asp.net re-appends the (hidden) querystring to the url on postback.The post-back url is now domian.com/username/review?user=username&review, causing the page to break if refreshed.
Is there any way to keep asp.net from re-appending the querystrings that are actually already present, but re-written with IIS
Live link <- submit a review, and then refresh the page (edit) by clicking in the address bar! Beautiful yellow error message.
EDIT
C# code:
protected void submitReview(object sender, EventArgs e)
{
try
{
int starRating = txtStarRating.Text == "" ? 0 : Int32.Parse(txtStarRating.Text);
testimonials.addNew(Int32.Parse(txtHiddenUid.Text), reviewContent.Text, reviewerName.Text, true, starRating);
[Code]....
View 1 Replies
Apr 30, 2010
I have been getting this error a lot lately with some of my users, and I had a couple of concerns with view state and I have read so many articles but I am still lost..
1. I use masterpage on all the pages and I need viewstate for some of the pages but..
There is a page where a user will fill out the information and then submit this data to a cgi server, and it is where I get most of the Client Disconnected errors, what would happen if I disable viewstate when they click on that button?
Now when a user browses from one page to another, does the view state from the previous page get deleted? If not how would I delete it?
Does the master page have its own viewstate? Would I be able to make sure none of items on my master page are using the viewstate?
View 7 Replies
Sep 24, 2010
I have a shopping cart page (Cart.aspx) that has a button that will (sometimes) post to a third party payment gateway, if payment is necessary. The payment gateway will process the payment and then do a silent post to my website (Order.aspx) so I can update the order status.
Order.aspx always throws an invalid viewstate error, even though viewstate is disabled on the page.
What's happening is that Cart.aspx (which has viewstate enabled) posts to the payment gateway, and the gateway will post it back as part of the silent post. Even though Order.aspx has viewstate disabled and validation disabled, it still tries to validate the __viewstate field it's being given.
I know setting EnableViewState=false will disable the rendering of the __viewstate field, but if another page provides the field, shouldn't it still skip validation? I tried calling ViewState.Clear() on the Page_Init event of Order.aspx, but ViewState is apparently empty. how to get around this? I don't want to disable ViewState on Cart.aspx (in some cases it may be necessary), but I can't figure out how to clear it on Order.aspx.
View 1 Replies
Apr 13, 2010
I am using linkbutton in my gridview to avoid the use of querystrings. The gridview is filled from a dataset.
I almost have it working but the text the linkbutton is displaying does not vary as a function of what row it is in. I need a way to associate the text of the linkbutton with the row it is in.
[Code]....
View 3 Replies
Aug 9, 2010
i have 2 dropdown list, menu and a gridview in my aspx page.
in the gridview a have add a linkbutton with select CommandeName.
i want to use the postbackurl in the linkbutton to open an other page with querystrings parameters.
this querystrings should contain: the selected item in Menu, the dropdownlist1 selected value, dropdownlist2 selectev value and the gridview selected value.
how do i add all the controls value to my postbackurl ?
[code]....
View 7 Replies
May 21, 2010
I am new to javascript and jquery. I have written some javascript code for some client validation.
document.getElementById(spnError).style.display = 'block';
This is how I am showing a span if there is some validation issues in the form. I want to use Jquery to show this span. I would like to slide it down slowly.
View 2 Replies
Dec 11, 2010
In one of the application i am developing on ASP.Net. In this application we have been using lots of AppSettings. In the initial development we used ConfigurationManager.AppSettings[""]. but as development progressed we created a utility class in which we would define a static property for each AppSettings. Then issues started to come. Now when application is deployed on testing server and we change any settings on AppSettings it does not have any effect unless we restart the IIS. here is the following code snippet i am using to create static property of AppSettings.
public static class AppSettingsUtil
{
public static string Log4Net
{
get
{
return ConfigurationManager.AppSettings["Log4Net"];
}
}
}
View 2 Replies
Jan 17, 2011
Look at the reply and contact buttons @ [URL]how would I get that effect to my buttons (Dont need the icons, just the blue color, borders and a mouse over effect)
View 2 Replies
Feb 22, 2011
here is what i am looking for...
how do i highlight the gridview control row after i am done updating with the row?
[Code]....
View 3 Replies
Feb 7, 2011
EDIT:
here is what its generating at runtime after i debug the code
<script type='text/javascript'>
$('#ctl00_ContentPlaceHolder1_tabControl_gv_ctl03').show().fadeIn(8000).fadeOut(90000)
</script>
ere is what i am looking for...
how do i highlight the gridview control row after i am done updating with the row?
<asp:GridView runat="server" CssClass="DataWebControlStyle">
<AlternatingRowStyle CssClass="AlternatingRowStyle" />
<RowStyle CssClass="RowStyle" /> <
HeaderStyle CssClass="HeaderStyle" />
<SelectedRowStyle CssClass="SelectedRowStyle" />
</asp:GridView>
protected void gv_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//update....
}
View 2 Replies