c# - Get name attribute from the innerHTML -
i saving inner html in form table , in html field , getting inner html in code behind following, , want accomplish name attribute(inner html has input types elements , each input type has name attribute, want name attribute ) here in code behind innerhtml . possible so
e.g < <input name="lastname" type="text" id="lastname">
c# method
protected void getformhtml() { if (con.state == connectionstate.closed) { con.open(); } cmd = new sqlcommand("select * forms formid='" + request.querystring["id"].tostring() + "'", con); dr = cmd.executereader(); if (dr.hasrows) { dr.read(); lblformname.text = dr["name"].tostring(); divhtml.innerhtml = dr["html"].tostring().trim(); } dr.close(); cmd.dispose(); con.close(); }
it sound attempting parse html strings stored in database. need library that, e.g. https://htmlagilitypack.codeplex.com/
at to the lowest degree convert.toint32(request.querystring["id"].tostring()) or improve yet, utilize ado.net parameters.
c# innerhtml
No comments:
Post a Comment