Click here to Skip to main content
15,896,118 members

Comments by raesark (Top 7 by date)

raesark 16-Nov-12 3:01am View    
Hello Mathlab,
Thanks for your reply.
I type it wrong above....it is as exactly as shown in the code below
<script type="text/javascript" language="javascript" src="Client-Side_Validn.js"></script>
Even then it doesn't work. :(
I just can't figure out why it fails.

RaesaRK
raesark 15-Nov-12 10:43am View    
Thanks for the reply.
Yes I do have. Here is my code
---------------------------------------------------------------------------------------------------
<head runat="server">
<title>Design Page</title>
<script type="text/javascript" language="javascript" src="Client-ide_Validn.js"></script>
</head>
<body background="Image/logo.JPG" style="background-repeat: no-repeat";>
<form id="form1" runat="server" defaultbutton="ButtonCalculate" defaultfocus="txtId" submitdisabledcontrols="True" önsubmit="onPostBack()">
--------------------------------------------------------------------------------------------
if (IsPostBack)
{
if ((bool)HttpContext.Current.Items["IsRefresh"])
{
Response.Write("refreshed");
sPageIds = new List<string>();
string sVal = ((new Random()).Next()).ToString();
sPageIds.Add(sVal);
}
else
{
}
}
else
{
{
string sVal = ((new Random()).Next()).ToString();
if (sPageIds.Count == 0)
{
sPageIds.Add(sVal);
}
else
{
if (sPageIds.Contains(sVal) == false)
{
Response.Redirect("ErrorPage.aspx");
}
}
}
}
--------------------------------------------------------
'IsRefresh' is always false here. :(
It works fine in test workspace though.

Thanks
RaesaRK
raesark 15-Nov-12 10:18am View    
Thanks for your reply Mathlab.
I did exactly as it has been written in the article and it works fine on the test work space that I built.
I am just not able to figure it out what is wrong in my existing workspace. :(
raesark 15-Nov-12 9:24am View    
Hello Mathlab,

I read the article that you had posted at the bottom of the solution.
I tried implementing on a test work space and it works fine. But when I implement the same javascript in my code, it doesn't work. When I hit the button or any other control, it does not do any action. I tried debugging the script and it exits at this location:

--------------
if (continueSubmit) {
for (i = 0, l = this._onSubmitStatements.length; i < l; i++) {
if (!this._onSubmitStatements[i]()) {
continueSubmit = false;
break;
}
}
}

if (!continueSubmit) {
if (evt) {
evt.preventDefault();
}
return;
}
--------------

Could this be some settings issue? I had given all the settings that are needed in the web config file.
Can you throw some light as to where the problem is?

Thanks
RaesaRK
raesark 14-Nov-12 10:19am View    
Hello,

Thanks for your reply.
But when I refresh, I get a new Id and the code redirects it to the error page.
I am not able to detect the refresh action.

RaesaRK