Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Created Unassigned: Issue while reading value from textbox in Nobot [27674]

$
0
0
Hi I have found an issue when using NoBot Extender.

Description: When I use OnGenerateChallengeAndResponse in nobot extender and use below code:

```
protected void CustomChallengeResponse(object sender, NoBotEventArgs e)
{
Random r = new Random();
int iFirst = r.Next(100);

int iSecond = r.Next(100);
e.ChallengeScript = String.Format("eval('{0}+{1}')", iFirst, iSecond);
e.RequiredResponse = Convert.ToString(iFirst + iSecond);
}
```
Then it works fine. But when I tries to read value from textbox it always gives "InvalidBadResponse" on first button click and works fine when i repress the button . Here is my code:

```
protected void CustomChallengeResponse(object sender, NoBotEventArgs e)
{
string expectedanswer = ViewState["answer"].ToString();
string answer = txtAnswer.Text;

e.ChallengeScript = String.Format("eval('{0}')", expectedanswer);
e.RequiredResponse = answer;
}
```

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>