Hi,
I am trying following code to update the onClick event of an html button sitting in my asp.net page.

VB.NET code
Page.RegisterStartupScript("AutoFillScript", _
        "<script language=javascript> function test(){ document.getElementById('printPage').onclick = ""PrintHtml('http:// someURL.html')"";}")
        btnSubmit.Attributes.Add("onClick", "test()")

I want that when someone click submit button URL "http:// someURL.html" be assigned to html button with id printPage

Any idea will be helpful for me
thanks

Self-modifying code is bad business.

It is better to set a global variable to the page you want, and request the page in JavaScript according to the variable you set.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.