if statment - problem with end if

liunx

Guest
i wrote this ocde in an asp.net page :

<% if true=flagWatchRegistrationForm then%>
<form id="frmRegisrationForm" name="frmRegisrationForm" runat="server" onsubmit="return CheckBeforeSubmit();">
<input type="hidden" name="frmSubmit" id="frmSubmit" value="false" runat="server">
<%End if%>

where flagWatchRegistrationForm is decalred as protected boolean on the aspx.vb page!
when i try to run the page i recive :
Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

and this is the co,mpiler output :

<!-- m --><a class="postlink" href="http://localhost/hakotel_yeshiva/registration_form.aspx(96">http://localhost/hakotel_yeshiva/regist ... rm.aspx(96</a><!-- m -->) : error BC30081: 'If' must end with a matching 'End If'.

if true=flagWatchRegistrationForm then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!-- m --><a class="postlink" href="http://localhost/hakotel_yeshiva/registration_form.aspx(99">http://localhost/hakotel_yeshiva/regist ... rm.aspx(99</a><!-- m -->) : error BC30087: 'End If' must be preceded by a matching 'If'.

End if
~~~~~~

why is this happening?what to do?
thnaks in avance
pelegtry putting a space between <% end if %> that some times works for me, but its a wierd problem what version of .net you have installed?i wrote this ocde in an asp.net page :
<% if true=flagWatchRegistrationForm then%>


Is it a typo or you really put this line in your code? I'm not familiar with VB, but that statement doesn't seem right?

shouldn't be:

if flagWatchRegistrationForm=true then .... ?Order of condition doesn't matter.sorry, drfting out of subject... does

Dim val as bool
if (val = true)

same as

Dim val as bool
if (true = val)yes its the same
the main purpose of the switched writing that in some language
doing
if (x=true )
will first put the value true into x and then will check if its true or not
(in c++ for example)
beacuse of that its a habit to put fist the constant then the vairable :
if (constant=variable) then...if (x=true ) will first put the value true into x and then will check if its true or not

thanks for the explaination pelegk1, sorry for drifted the question away, i hope you got ur problem solved.no problem:)
 
Back
Top