Hi gays ! Do sombody know why I get error :
BC30081: Block 'If' is missing an 'End If'
I fill it is becouse I try to send to brows. Client-Script like I did in VID . If so how can I write ClientScript from server ? Or what is wrong ?
here is my piece of code :
====================================================
<%@ Page Language="VB" Debug=true %>
<%@ Import Namespace="System.Web.UI" %>
<script runat ="server">
dim firstDbl as double, SecondDbl as double
dim pScript as string ,tmpPage as string
Sub Calculate(sender As Object, e As System.EventArgs)
dim ii as double
firstDbl = val(tbfirst.Text)
SecondDbl = val(tbsecond.Text)
if not check1.checked then
if sender.Text="Add" then
ii= firstDbl + SecondDbl
elseif sender.Text="Subtract" then
ii= firstDbl - SecondDbl
elseif sender.Text="Multiply" then
ii= firstDbl * SecondDbl
elseif sender.Text="Divide" then
ii= firstDbl / SecondDbl
end if
lblMessage.Text= CStr(ii) + sender.id
else
lblMessage.Text= " Checked bb!!!!!"
response.write ("<script language='javascript'>window.open('hm_DB_to_XML_006.aspx');</script>"
end if
btadd.style("Border-Style"="notset"
btMultiply.style("Border-Style"="notset"
btDivide.style("Border-Style"="notset"
btSubtract.style("Border-Style"="notset"
sender.style("Border-Style"="inset"
End Sub
</script>
<html><body>
<form runat ="server">
first value <asp:textbox id="tbfirst" runat="server"/> <br>
second value <asp:textbox id="tbsecond" runat="server"/> <br>
<asp:CheckBox id="check1" Text="Check box " TextAlign="Right" AutoPostBack="false" checked=false runat="server" /><br>
<asp:button id="btAdd" onClick="Calculate" Text="Add" runat="server"/>
<asp:button id="btSubtract" onClick="Calculate" Text="Subtract" runat="server"/>
<asp:button id="btMultiply" onClick="Calculate" Text="Multiply" runat="server"/>
<asp:button id="btDivide" onClick="Calculate" Text="Divide" runat="server"/> <br>
output value <asp:label id="lblMessage" font-size="20pt" runat="server"/>
</form>
</body></html> ====================================================
appreciated any help !!!!
BC30081: Block 'If' is missing an 'End If'
I fill it is becouse I try to send to brows. Client-Script like I did in VID . If so how can I write ClientScript from server ? Or what is wrong ?
here is my piece of code :
====================================================
<%@ Page Language="VB" Debug=true %>
<%@ Import Namespace="System.Web.UI" %>
<script runat ="server">
dim firstDbl as double, SecondDbl as double
dim pScript as string ,tmpPage as string
Sub Calculate(sender As Object, e As System.EventArgs)
dim ii as double
firstDbl = val(tbfirst.Text)
SecondDbl = val(tbsecond.Text)
if not check1.checked then
if sender.Text="Add" then
ii= firstDbl + SecondDbl
elseif sender.Text="Subtract" then
ii= firstDbl - SecondDbl
elseif sender.Text="Multiply" then
ii= firstDbl * SecondDbl
elseif sender.Text="Divide" then
ii= firstDbl / SecondDbl
end if
lblMessage.Text= CStr(ii) + sender.id
else
lblMessage.Text= " Checked bb!!!!!"
response.write ("<script language='javascript'>window.open('hm_DB_to_XML_006.aspx');</script>"
end if
btadd.style("Border-Style"="notset"
btMultiply.style("Border-Style"="notset"
btDivide.style("Border-Style"="notset"
btSubtract.style("Border-Style"="notset"
sender.style("Border-Style"="inset"
End Sub
</script>
<html><body>
<form runat ="server">
first value <asp:textbox id="tbfirst" runat="server"/> <br>
second value <asp:textbox id="tbsecond" runat="server"/> <br>
<asp:CheckBox id="check1" Text="Check box " TextAlign="Right" AutoPostBack="false" checked=false runat="server" /><br>
<asp:button id="btAdd" onClick="Calculate" Text="Add" runat="server"/>
<asp:button id="btSubtract" onClick="Calculate" Text="Subtract" runat="server"/>
<asp:button id="btMultiply" onClick="Calculate" Text="Multiply" runat="server"/>
<asp:button id="btDivide" onClick="Calculate" Text="Divide" runat="server"/> <br>
output value <asp:label id="lblMessage" font-size="20pt" runat="server"/>
</form>
</body></html> ====================================================
appreciated any help !!!!