Simple National The Controltovalidate Property of ''Regularexpressionvalidator1'' cannot be Blank

Asked

Viewed 67 times

0

I am developing a query in Simple National, but when giving an Httppost on the site http://www8.receita.fazenda.gov.br/simplesnacional/aplicacoes/atbhe/consultaoptantes.app/consultaropcao.aspx gives me the error

The ControlToValidate property of ''RegularExpressionValidator1'' cannot be blank. 

Follow the Code of Consultation:

Post.WriteString('__EVENTTARGET='); {Se comento esta linha, me retorna em branco}
Post.WriteString('__EVENTARGUMENT=');
Post.WriteString('__VIEWSTATE=' + FViewState);
Post.WriteString('__EVENTVALIDATION=' + FEventValidation);
Post.WriteString('ctl00$ContentPlaceHolderConteudo$' + FSessao + '=' + OnlyNumber(ACNPJ));
Post.WriteString('ctl00$ContentPlaceHolderConteudo$HiddenField1=' + FSessao);
Post.WriteString('ctl00$ContentPlaceHolderConteudo$hddServidorCaptcha=pro');
Post.WriteString('ctl00$ContentPlaceHolderConteudo$txtTexto_captcha_serpro_gov_br=' + ACaptcha);
Post.WriteString('ctl00$ContentPlaceHolderConteudo$btnConfirmar=Consultar');
Post.WriteString('ctl00_ContentPlaceHolderConteudo_RegularExpressionValidator1=null');
Post.Position := 0;

HttpSend.Clear;
HttpSend.Document.Position := 0;
HttpSend.Document.CopyFrom(Post, Post.Size);
HTTPSend.MimeType := 'application/x-www-form-urlencoded';
HTTPPost('http://www8.receita.fazenda.gov.br/simplesnacional/aplicacoes/atbhe/consultaoptantes.app/consultaropcao.aspx');

Does anyone know why of the mistake? How can I correct?

  • 1

    Have you tried passing any regular expression here in this command instead of NULL?? Post.WriteString('ctl00_ContentPlaceHolderConteudo_RegularExpressionValidator1=null');

  • I was looking at the code in the query page debugging and saw that something doesn’t seem to be clicking. Try these 3 alternatives to test if any work. Post.Writestring('ctl00_ContentPlaceHolderConteudo_RegularExpressionValidator1'); Post.Writestring('ctl00_ContentPlaceHolderConteudo_RegularExpressionValidator1.validationexpression=" d"'); Post.Writestring('ctl00_ContentPlaceHolderConteudo_RegularExpressionValidator1=" d+"'); *This as suggested by Matheus.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.