İçeriğe atla
Ağustos 24, 2011 / sukruerdem

JavaScript ile frame’ler arası değer gönderme ve CodeBehind JavaScript

İki Frame tek bir sayfa’da duruyorsa ve bir frame’den diğer frame’e değer göndermek için; mainFrame adındaki bir frame’de bulunan txtArama control’ündeki değerin bir diğer frame’de bulunan txtArama2 controlünün değeri olarak yazdırılmasını istiyorsak;

Değer alan Frame’in head’i

<script type=”text/javascript”>
function Change() {
document.form2.txtArama2.value = parent.mainFrame.form1.txtArama.value;
}
</script>

Ayrıca mevcut bir JavaScript Fonksyonunu CodeBehind’dan çağırmak istiyorsak;

ClientScript.RegisterStartupScript(this.GetType(), “function”, “<script language=’javascript’>Change()</script>”);

Şeklinde bir çağırma yapabiliriz.

 

Yorum yapın

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Değiştir )

Twitter picture

You are commenting using your Twitter account. Log Out / Değiştir )

Facebook photo

You are commenting using your Facebook account. Log Out / Değiştir )

Connecting to %s

Follow

Get every new post delivered to your Inbox.