Checkbox and state

B

Beppe

Hi all! I have a .aspx page with 3 hyperlink and 1 checkbox. The NavigateUrl
hyperlinks' property retreive dinamically its value (they reload the same
page with different params and querystrings); the method in the codebehind
is:

protected string GetLinkUrl(object annoCdSObj)
{
return "manifesto.aspx?CodCdS=" + CdSScelto.CodCdS.ToString() + "&Anno=" +
((AnnoCdS)annoCdSObj).Anno.ToString() + "&SCY=" + (this.crossYear.Checked ?
"true" : "false");
}

The "SCY" value is the state of the checkbox.
The checkbox (AutoPostBack == true) retrieve its Checked property
dinamically:

protected bool IsChecked()
{
if (!IsPostBack)
{
if (Request.QueryString["SCY"].ToLower() == "true")
return true;
else return false;
}
return this.crossYear.Checked;
}

The page has to do as follows:
I load the page with SCY == false --> Checked = false --> OK
If I check the checkbox, the form post backs e now Checked == true --> OK
Now, If I click on a hyperlink, the page is reloaded with a querystring with
SCY == true and the checkbox is checked --> OK
The problem is that if I click another time a hyperlink, the SCY param is
false!! How is it possible the param is false, if the checkbox is checked??
Thanks a lot, Giuseppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top