ASP.NET Page Methods - how to get url parameter value inside page method?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript">Get query string values in JavaScript</a>  </p>
</blockquote>



<p>I have a calendar web page. When user opens event, it opens the page with url like: "http://localhost/Event.aspx?eventid=4"
Then I use jQuery to call a page method to show some extra data. Data parameters, that I am sending through $.ajax function, also include "eventID" (to show data for correct event). 
If user would manually (let's say through firebug console) execute jQuery call to page method with faked "eventID", he would get false data.
I would like to prevent that,... in a way to not send eventid with jQuery data parameters, but somehow get eventid on server-side codebehind.
The thing is, that I can't use sessions (because user can open more than one event and each one would have it's own eventID) and I also can't use cookies, cause they can be hacked also.
So I was trying to get correct eventid directly inside page method, using</p>

<pre><code>HttpContext.Current.Request.QueryString
</code></pre>

<p>but with no luck.
On Page_Load I get my eventid with:</p>

<pre><code>EventID = Page.Request.QueryString("eventid")
</code></pre>

<p>but I can't find a way to get this eventid value into my page method.</p>

<p>So, I am asking for an advice of how to get a page method parameter value from url or public variable defined on Page_Load.</p>

<p>thanks.</p>

<p>EDIT: 
Currently I am using POST to send parameters like:</p>

<pre><code>var myEventId = $("#hiddenField").val();

$.ajax({
url: "Event.aspx/getEventData",
type: "POST",
data: "{'eventid':myEventId}"
...
});
</code></pre>

<p>But I would like to avoid sending eventid parameter with POST, to prevent hacking.</p>
