Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
shulink
Starting Member
12 Posts |
Posted - 2008-02-04 : 10:10:47
|
Hi, I have a javascript function file that I want to include in the master page. If I include the following in the content page it works fine.<script language="javascript" type="text/javascript" src="../Javascript/function.js"></script> and in the code behind page there is something like the following WebControl button = (WebControl)Page.FindControl("Confirm"); button.Attributes.Add("onclick", "return confirmDelete (this.form);");however, if I tried to include the javascript in the master page, I get the following error:Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Line 20: Guid userId = (Guid)myObject.ProviderUserKey;Line 21: WebControl button = (WebControl)Page.FindControl("Confirm");Line 22: button.Attributes.Add("onclick", "return confirmDelete (this.form);");Line 23: PopulateControls(userId);Line 24: }I tried to do a search on this topic on google, but none of the solutions seem to work for me. Does anyone know how to address this issue. Thanks a lot. |
|
|
|
|