|
-
Apr 18th, 2012, 11:17 AM
#1
Thread Starter
New Member
VB.net 2005 to 2008 Client Script Issue
Need some help on solving a issue with ClientScript.RegisterClientScriptBlock.
Hopefully somebody has seen this before.
I am getting a error that states that TypeLoadException was unhandled by user code.
Could not Load type 'Javascript' from assembly 'App_Code.ti5_zjxv, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Heres the code:
Page.ClientScript.RegisterClientScriptBlock(Type.GetType("Javascript", True, True), "ShowPopupMenu", sJS)
oPage.ClientScript.RegisterClientScriptBlock(Type.GetType("Javascript", True, True), "NavigateTo", sJS)
This javascript is for navigate and show popupmeun.
-
May 2nd, 2012, 06:29 AM
#2
Re: VB.net 2005 to 2008 Client Script Issue
Hi and welcome to VBF!
This is because there is no JavaScript type which is why you are getting the TypeLoadException.
GetType with a string parameter would be used as follows
Code:
Type.GetType("System.Int32"); //Where System.Int32 is a valid type
Commonly people use
Code:
Page.ClientScript.RegisterClientScriptBlock(Me.[GetType](), "ShowPopupMenu", sJS)
-
May 21st, 2012, 03:20 PM
#3
Thread Starter
New Member
Re: VB.net 2005 to 2008 Client Script Issue
I fix that first issue not I have this one. Any ideas?
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30469: Reference to a non-shared member requires an object reference.
Source Error:
Line 217:
Line 218: Public Shared Sub AddJavascript(ByVal oPage As Page)
Line 219: Javascript.AddShowPopupMenu(oPage)
Line 220: Javascript.AddNavigateTo(oPage)
Line 221: End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|