2
Reply

write line from c# to javascript function

samanta

samanta

Dec 24 2014 7:31 AM
742

i am trying to write below line  highlighted   by red color to javascript function.

how to do this?

my c# function 

 private void BindInitalView()
        {
            try
            {
                SqlCommand objCommand = new SqlCommand();
                objCommand.CommandText = "SELECT [prd_ID] ,[img_ID],[img_X],[img_Y],[img_Thumb],img_Description,img_Title" +
                                         " FROM [test].[dbo].[tblProductImage]";                                      
                objCommand.CommandType = CommandType.Text;
                objCommand.Connection = _databaseConnection;
                SqlDataReader objRs = objCommand.ExecuteReader();
               
                while (objRs.Read())
                {
                    string imageTagId = objRs["img_ID"].ToString();
                    string title = objRs["img_Title"].ToString();
                    string description = objRs["img_Description"].ToString();
                    string pointX = objRs["img_X"].ToString();
                    string pointY = objRs["img_Y"].ToString();
                 
               
               // how can i add this line inside javascript functon
               
                    "imageTagsObj.addImageTag('" + imageTagId + "','" + title + "','" + description + "','" + pointX + "','" + pointY + "'); \n";
                 
                   
                }


                objCommand.Dispose();
            }
            catch( Exception ex){
            }

my javascript function

function setImageTags() {

       //imageTagsObj.addImageTag(imageTagId, title, "", description, pointX, pointY, 0, 0, false, false);


   }

Answers (2)