S; M; L and XL
I want to prevent that the destination page is only shown if a variable is passed together. Some people can try to not pass the variable:
I have the following :
if (!Page.IsPostBack) {
if (Request.QueryString["Plano"] == "S") {
OK the page is shown
}if (Request.QueryString["Plano"] == "M") {
OK the page is shown
}if (Request.QueryString["Plano"] == "L") {
OK the page is shown
}if (Request.QueryString["Plano"] == "XL") {
OK the page is shown
}if (Request.QueryString["Plano"] == "") {
Response.Redirect ("default.aspx");
}
The problem is that I can see the page if I put ... page.aspx without the "Plano" variable.
How can I prevent this ?
if (!Page.IsPostBack) {
bool OK=false;
if (Request.QueryString["Plano"] == "S") {
//OK the page is shown
OK=true;
}if (Request.QueryString["Plano"] == "M") {
//OK the page is shown
OK=true;
}if (Request.QueryString["Plano"] == "L") {
//OK the page is shown
OK=true;
}if (Request.QueryString["Plano"] == "XL") {
//OK the page is shown
OK=true;
}if (OK!=true) {
Response.Redirect ("default.aspx");
}
Thank you.
Why complicate simple things ;-)
Best regards.
Might want to use an OR in there. Just a thought :-)
If plano = "S" or pano = "XL" ... then
else
end if
0 comments:
Post a Comment