Hi,
I've added to a webform in my app, a printing subrutine for my gridview.
the function itself is in javascript but I added it to the code behind, like that:
sub printint()
dim sw as new stringwriter()
dim hw as new htmltextwriter(sw)
gvprint.rendercontrol(hw)
dim gridhtml as string
gridhtml=sw.tostring().replace("""","'").replace(system.enviroment.newline,"")
dim sb as new stringbuilder
sb.append("<script type="
sb.append("window.onload=new function(){")
.....
sb.append("</script>")
clientscript.registerstartupscript(me.[gettype](),"gridprint",sb.tostring())
end sub
I also added to my page_load this :
page.maintainscrollpositiononpostback=true
now, I'm not sure how the first part is related to the next, but since I've added the maintainscroll, I get an error after every time I try to print the gridview.
that's the error:
"microsoft jscript runtime error: object doesnt support this property or method"
it breaks on weresource.axd inside the function "webform_restorescrollposition".
if I press ignore, everything goes right, but ofcourse I don't want the user to see this error every time he wants to print the gridview.
when I remove the line of "maintainscroll.." I don't get the error.
Can you suggest me what to do?
I searched the net but nothing helped until now..
TNX.