I use a clean test page and load user control using jQuery .load() function. The current error I am getting is this:
GET http://localhost:27950/OCDB/test.ascx 403 (Forbidden)
Here is my page code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %> <%@ Register Src="~/test.ascx" TagPrefix="uc1" TagName="test" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>This is a test.</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#ucPlaceholder').load('test.ascx'); }); </script> </head> <body> <form id="form1" runat="server"> <div id="ucPlaceholder"> </div> </form> </body> </html>
And my user control code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="test.ascx.cs" Inherits="test" %> <input placeholder="test input"/>
As you can see, this is super easy. I assume the page does not compile Register . Can someone show me where I'm wrong?
source share