0

Is there any conventions should I follow while using QueryStrings in ASP.NET? For eg: which is better one? 1 or 2 ? 1. url?stock_trnasfer_ID=10 2. url?sid=10

2
  • I would go for option 3, a SEO alternative. But this is off-topic, should be moved to webmasters. Commented Oct 23, 2010 at 5:15
  • 1
    Whatever you do, just make sure you sanitize the input before you use! Commented Oct 23, 2010 at 6:00

3 Answers 3

1

I would go with option 2.

Reason:

  1. Querystrings have limited size (though its quite large nowadays) so better to not waste it with long names
Sign up to request clarification or add additional context in comments.

2 Comments

I think there is no such types of criteria.It is fully depends on programmer.If u are passing like this "stock_trnasfer_ID" it is easy for others to understand u r passing an ID to next page.So I prefer to use name which may not similar to the coloumn name
Servers should be cautious about depending on URI lengths above '255 bytes', because some older client or proxy implementations may not properly support these lengths. refer to classicasp.aspfaq.com/forms/what-is-the-limit-on-querystring/…
1

Always second one. Because url must be short for users.

Comments

0

Its depends on programmer but if there are many values then you should go for second option

2. url?sid=10

because URl has length limitation and you have to add some other in future then it will be difficult to handle.

but if only one or two then you can go for the 1 option

1. url?stock_trnasfer_ID=10

comprehensive for developer(you) but not informative to users because in this case its more helpful for hackers that you are passing an ID, so should not give idea to users that what you are passing in Querystrings.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.