Ask a Question related to ASP.NET Security, Design and Development.
-
Anton Ng via .NET 247 #1
Trouble with .NET control
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:
<html>
<OBJECT id="123" height=500 width=800 classid="http:netcontrol.dll#netcontrol.myusercont rol"> </OBJECT>
</html>
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
uri)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.GetWebRequest(Uri
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 ([url]http://www.dotnet247.com/[/url])
<Id>L5ZJ9oL1UE6k7KbcQi4f7Q==</Id>
Anton Ng via .NET 247 Guest
-
Having trouble adding a web user control programatically.
Hi All; I am attempting to figure out how to add a user created control (test.ascx) to an ASP.NET page based on a user choice. I have created a... -
Possible to create a composite control that has a child control that is a validator that validates the composite control itself?
I am attempting to create a composite control which has a label, followed by an optional error message, followed by two text boxes. I have... -
ActiveX control trouble
Office Templates cannot download the ActiveX control that is needed in order to preview templates. Either your Internet Explorer security level is... -
VisualAge 6 installation trouble on aix 5.2, gcc trouble too :)
I've installed gcc 3.x from UCLA site. and I got this error - In file included from test.c:23: /usr/include/pthread.h:554: error: parse error... -
Using Table control in a custom composite control. Control does not render properly in design time.
All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control...



Reply With Quote

