Its handy if you want to pass data to other pages, especially when you want it retained in the browser's history. If you POST search terms to google for example then you wouldn't have a list of all searches you performed in your browser history.
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
this thread must be moved to ASP.NET forum.
serkan sendur
Postaholic
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
I flagged it for you. The button should be located under the reply:
sknake Online
Posting Virtuoso
Re: QueryString #9 1 Minute Ago | Add to sknake's Reputation | Flag Bad Post
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
Do you not want to get the entire page?
namespace daniweb.web
{
public partial class Cb : System.Web.UI.Page
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (Request.QueryString["parm"] != null)
{
Response.Write("You entered the value: " + Request.QueryString["parm"]);
Response.Flush();
Response.Close();
}
}
URL: http://localhost:14332/Cb.aspx?parm=hello
Result:
You entered the value: hello
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
Explain what you are trying to do first.
>>. At this point I get the entire code of my page! Not good, anyone got an idea about what's wrong? Here is my code:
From what you said I was guessing that when you entered a query string you didn't want to render the page, but rather wanted to only render something custom. Please clarify what you are trying to do
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
MVC uses URL rewriting to mask the query string. Daniweb uses URL rewriting too. By default vBulleting's urls look like
http://www.daniweb.com/forums/viewThread.php?id= 214743&page=2
Notice how Dani made them look. This helps search engines index your pages better: http://www.daniweb.com/forums/thread 214743-2.html
Anyway you don't need to send the URL with your button. The button causes a post back and you can get the current URL with Request.Url
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
I have no idea what you're doing -- so I don't know what you're doing wrong.
Explain what you are trying to do first.
>>. At this point I get the entire code of my page! Not good, anyone got an idea about what's wrong? Here is my code:
From what you said I was guessing that when you entered a query string you didn't want to render the page, but rather wanted to only render something custom. Please clarify what you are trying to do
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735