Asp.NET

  • Konbuyu başlatan Konbuyu başlatan deLyy
  • Başlangıç tarihi Başlangıç tarihi
Kodla Büyü

deLyy

Üye
Mesajlar
12
Ekran görüntüsü veriyor fakat işlem yapmıyor..nerede hata yapıyorum anlamadım yardımcı olursanız sevinirim .. Teşekkür ederm .!


<%@ page language="VB" %>

<script runat="server">

dim x as long
Const pi as long=3
dim daire as long



sub daire_alani(sender as object,e as eventargs)


while text1.text>0

daire=pi*x*x

response.write("DAİRENİN ALANI: " & daire)

end while


end sub

</script>

<html><body>

<form runat="server">

<ASP:textbox id="text1" runat="server"/>

<ASP:button id="btn" onclick="daire_alani" text="Dairenin Alanı" runat="server"/>

</form>
</body></html>
 
Re: Asp.NET ( Yardım )

X=?
x e bir değer verdinmi ?
Formadanmı alıyor noluyor? anlamaydım ama denede ilgileneyim dedim
 
Re: Asp.NET ( Yardım )

tamam gördüm tex ile alıyorsun
while nin üstüne trace(text1.text )
ayrıca dip dönüstürmesi yapman gekli olabilir
vb sanırım ctype ile text ten gelen stringi long yap yada int
 
Re: Asp.NET ( Yardım )

dim x as long

Const pi as long=3
dim daire as long
sub daire_alani(sender as object,e as eventargs)

while text1.text>0
daire=pi*x*x


response.write("DAİRENİN ALANI: " & daire)
end while
end sub

x değişkenine herhangi bir değer atanmamış. döngülü kısmı aşağıdaki gibi düzenleyerek deneyin

while text1.text>0
x = text1.text
daire=pi*x*x
response.write("DAİRENİN ALANI: " & daire)
end while
 
Re: Asp.NET ( Yardım )

hepsini denedm olmuo ben mi bi hata yapıom hala çözemedm :S

Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.


hatasını verio:S:S
 
Re: Asp.NET ( Yardım )

hocam öncelikle while döngüsü sonlanmadıgı için sonsuz döngüye girer o bakımdan if ile yapmalısın birde textboxdaki değeri x değişkenine atamalısın şöleki

sub daire_alani(sender as object,e as eventargs)


If CInt(Text1.Text) > 0 Then
x = CLng(Text1.Text)

daire = pi * x * x

Response.Write("DAİRENİN ALANI: " & daire)

End If
 
Re: Asp.NET ( Yardım )

Tşk ederm hepinize :)

fatherboard if ile oluyor fakat while döngüsüyle yapmam gerekenio ama genede tşk ederm ilgilendiğiniz için..!
 
Re: Asp.NET ( Yardım )

o zaman hocam exit whie kullanacaz döngüyü sonlandırmak için

sub daire_alani(sender as object,e as eventargs)


While CInt(Text1.Text) > 0
x = CLng(Text1.Text)

daire = pi * x * x

Response.Write("DAİRENİN ALANI: " & daire)
Exit While

End While


End Sub
 
Re: Asp.NET ( Yardım )

alternatif

x = CLng(Text1.Text)
bu satırdan sonra
Text1.Text=0

desek
ozan while sonlanır zaten
 
Bir sınıftaki öğrencilerin notları klavyeden girilecektir.Sınıftaki geçen ve kalan öğrenci sayısını döngü ve kontrol deyimleri kullanarak hesaplayınız. yapamıorum yardımcı olursanız sevinirim teşekkür edrm.
 
BBNET
Geri
Üst