infowareindia
asked on
How to add object to script control in VB .NET 2008 Express
Hi
I am using Microsof Visual Basic .Net 2008 and Dot Net framework 3.5.
I'm using the following code.
Dim ScriptCntrl as New MSScriptControl.ScriptCont rolClass
Dim ObjTexbox as new TextBox
ObjTexbox.Name = "txtFirstName"
ScriptCntrl.AddObject(objT extBox.Nam e,objTextb ox,true)
when I m executing the above code I'm getting following error
"Specified Cast is Not Valid"
What is the solution?
I am using Microsof Visual Basic .Net 2008 and Dot Net framework 3.5.
I'm using the following code.
Dim ScriptCntrl as New MSScriptControl.ScriptCont
Dim ObjTexbox as new TextBox
ObjTexbox.Name = "txtFirstName"
ScriptCntrl.AddObject(objT
when I m executing the above code I'm getting following error
"Specified Cast is Not Valid"
What is the solution?
Are you sure that the ScriptContol.AddObject method accepts 3 arguments? I am looking at the Microsoft page on the Script Control metjods, and AddObject appears to accept 2 (TWO) arguments, the Name (as a string), and the ControlObject, to be identified by that name.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin