c# - Argument type 'object' is not assignable to parameter type 'string' -


i have following tag in aspx page

<input type="checkbox" id="chkflags" name="chkflags" value="<%#databinder.eval(dataitemcontainer, "dataitem.tag_id") %>" <%#selecttags(databinder.eval(container, "dataitem.tag_id")) %>/> 

i getting following error:

argument type 'object' not assignable parameter type 'string'

the section of line highlighted is:

<%#selecttags(databinder.eval(container, "dataitem.tag_id")) 

my routine selecttags follows:

        public string selecttags(string tag_id)     {          string[] atags = mobjformat.stripobjecttostring(request.form["chkflags"]).split(convert.tochar(","));  //added square brackets request.form , syntax convert string char 10/21/15 max //         string sitem = "";         string sreturn = "";          mobjsecurity.messagestack_insert("procedure", "selecttags", "");          foreach (string sitem_loopvariable in atags)         {             sitem = sitem_loopvariable;             if (sitem.trim() == tag_id.tostring().trim())  //added parenthesis trim , tostring 10/21/15 max //             {                 sreturn = " checked='checked' ";             }         }          mobjsecurity.messagestack_insert("sreturn", sreturn, "selecttags");         return sreturn;      } 

i not sure needs accomplished fix error, perhaps missing (i have spent many hours looking on code)

can point me in direction take fix tia

as juharr points out missing tostring conversion on line. fixed follows:

<%#selecttags(databinder.eval(container, "dataitem.tag_id").tostring()) 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -