How to call a javasript function, not refering to the function through someting.attributes.add property.

I just want to call a function from RowCommand event of my GridView  as follows:

protected void GView_RowCommand(object sender, GridViewCommandEventArgs e)


if (e.CommandName == "blabla")

{ //Right here}


And here is my js function:

function myfunction_kem(elemDDL, elemLBL)


if (elemDDL.value=='' || elemDDL.value=='SEC')

{ alert('error!'); }






 I used to call it like follows:

DDLIhlSonucGor.Attributes.Add("onchange", "myfunction_kem(myfunction_kemdocument.getElementById('" + MyDropDownList.ClientID + "'),document.getElementById('" + MyLabel.ClientID + "'));");

I just need to send the paameters using their client id. Oyherwise it doesn't work. So i have to call the function this way…


Thanks in advance…

Read More


Leave a Reply

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

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s