Hi<BR><BR>I am basically an ASP programmer i am new to ASP.Net<BR>Usually in the onclick event of a button if i want it to go to a second page i write a javascript function in the OnClick event of a button and call it.<BR><BR>But in ASP.Net i wrote the javascript function in the .aspx page and in the .vb page <BR><BR>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR> <BR> btnInsert.Attributes.Add("onclick", "javascriptfunction()")<BR>End Sub<BR><BR>The problem is when i click the button my second page welcomes me with an error saying "The viewstate is invalid for this page and might be corrupted. "<BR>what shall i do??