Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Trouble with .NET control

Thread Tools

Trouble with .NET control

Anton Ng via .NET 247
Posts: n/a
Hi All,

I am having problem in developing a .NET user control to be used on a web page. This .NET control will internally call a web service.
The strange thing is when I test my .NET control using a test windows application/form, everything works fine. But if I embed this .NET control on a web page as follows:

<OBJECT id="123" height=500 width=800 classid="http:netcontrol.dll#netcontrol.myusercont rol"> </OBJECT>

I get the following error which I display using a MessageBox (coz i couldnt find a better way to debug *-*)

System.Security.SecurityException: Request for the permission of type
System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelp er(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(Per missionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32
checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(Cod eAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Net.HttpRequestCreator.Create(Uri Uri)
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Net.WebRequest.Create(Uri requestUri)
at System.Web.Services.Protocols.WebClientProtocol.Ge tWebRequest(Uri uri)
at System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebRequest(Uri
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.GetWebRequest(Uri
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

Has anyone encountered this problem before? If yes, how to solve/work around it.

Thank you very much in advance for any help

From: Anton Ng

Posted by a user from .NET 247 (

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
i have no trouble to send , ihave trouble reciving mail --any ideas John Penney Computer Support 4 08-29-2006 08:45 PM
newbie having trouble with control structures: loop till recieve string QUIT M. Duijkers Perl 2 12-12-2004 11:02 AM
Trouble keeping ActiveX control settings =?Utf-8?B?UmlhTHVjaWFAaG90bWFpbC5jb20=?= Microsoft Certification 2 07-01-2004 09:09 PM
Trouble getting jpg to display in image control Brian Hanson ASP .Net 1 12-02-2003 02:21 AM
trouble with caching or caching the trouble Hypo ASP .Net 6 08-01-2003 07:11 AM