Question : aspx c# request not accepting new parameter

I feel like I'm almost there, but I've gotten it to the point where my page contents load as desired, but my request parameter when put in differently is not coming in as expected as seen when I inserted some extra response.write lines.  

It seems to work fine when I get page at newsout.aspx?id=24 but when I go to newsout.aspx?id=29 I still get the contents I expect when I have id=24 instead.

I know I'm aspx/c# naive using inherited coding, but I'm wondering what am I doing wrong here.  Attached is my current code.  Also, I can't seem to get an if statement to work as it gives me an invalid token error still.

I also have static statements since I was also getting the error message without static: CS0120: An object reference is required for the nonstatic field, method, or property 'ASP.newsout_aspx.sID'
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
<%@ Page Language="C#"  Debug="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %> 
<%@ Import Namespace="BHHLegal" %>
<%@ Import Namespace="System.Data.Odbc" %>
<%@ Import Namespace="System.Web.UI" %>
 
<%@ Assembly Src="../library.cs" %> 

Answer : aspx c# request not accepting new parameter

You're declaring the string sID only once and therefore only catching the QueryString once. You need to declare it globally (like you are) then set it at each page load:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
<%@ Page Language="C#"  Debug="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %> 
<%@ Import Namespace="BHHLegal" %>
<%@ Import Namespace="System.Data.Odbc" %>
<%@ Import Namespace="System.Web.UI" %>
 
<%@ Assembly Src="../library.cs" %> 

Random Solutions  
 
programming4us programming4us