Trouble with .NET control

Discussion in 'ASP .Net Security' started by Anton Ng via .NET 247, Aug 4, 2004.

  1. 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.myusercontrol"> </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.CheckHelper(PermissionSet
    grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
    PermissionToken permToken)
    at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
    permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32
    checkFrames, Int32 unrestrictedOverride)
    at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
    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.GetWebRequest(Uri uri)
    at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri
    uri)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri
    uri)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.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 (http://www.dotnet247.com/)

    <Id>L5ZJ9oL1UE6k7KbcQi4f7Q==</Id>
    Anton Ng via .NET 247, Aug 4, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M. Duijkers
    Replies:
    2
    Views:
    465
    Joe Smith
    Dec 12, 2004
  2. Hypo
    Replies:
    6
    Views:
    394
  3. Brian Hanson
    Replies:
    1
    Views:
    353
    Ken Cox [Microsoft MVP]
    Dec 2, 2003
  4. Mark Broadbent

    Having trouble with a RadioButtonList control

    Mark Broadbent, Dec 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,922
    Saravana
    Dec 15, 2004
  5. Jeff
    Replies:
    4
    Views:
    332
Loading...

Share This Page