simple web parts in asp.net show as blank page
- by Javaman59
I am trying to develop web parts in VS 2008/WinXP
I created a Web Site project, and added a couple of web parts within the default form in default.aspx
<form id="form1" runat="server">
<div>
<asp:WebPartManager ID="WebPartManager1" runat="server">
</asp:WebPartManager>
<asp:WebPartZone ID="WebPartZone1" runat="server">
</asp:WebPartZone>
</div>
</form>
When I first ran it (in the debugger), a popup told to me enable Windows authentication in IIS (so something is working!). I enabled the Windows authentication, and now when I run it I get a blank screen. Same result if I open it in IE via the url (rather than debugger).
Following is the the source view.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title><style type="text/css">
.WebPartZone1_0 { border-color:Black;border-width:1px;border-style:Solid; }
</style></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__WPPS" id="__WPPS" value="s" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEzNTQyOTkwNDZkZEAVY0VcQaHLv3uaF3svWgCOfsmb" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="/WebPartsSite/WebResource.axd?d=4lwrtwXryJ3Ri-GXAxZR4g2&t=634003643420884071" type="text/javascript"></script>
<div>
<table cellspacing="0" cellpadding="0" border="0" id="WebPartZone1">
<tr>
<td style="height:100%;"><table cellspacing="0" cellpadding="2" border="0" style="width:100%;height:100%;">
<tr>
<td style="height:100%;"></td>
</tr>
</table></td>
</tr>
</table> </div>
<script type="text/javascript">
//<![CDATA[
var __wpmExportWarning='This Web Part Page has been personalized. As a result, one or more Web Part properties may contain confidential information. Make sure the properties contain information that is safe for others to read. After exporting this Web Part, view properties in the Web Part description file (.WebPart) by using a text editor such as Microsoft Notepad.';var __wpmCloseProviderWarning='You are about to close this Web Part. It is currently providing data to other Web Parts, and these connections will be deleted if this Web Part is closed. To close this Web Part, click OK. To keep this Web Part, click Cancel.';var __wpmDeleteWarning='You are about to permanently delete this Web Part. Are you sure you want to do this? To delete this Web Part, click OK. To keep this Web Part, click Cancel.';//]]>
</script>
<script type="text/javascript">
__wpm = new WebPartManager();
__wpm.overlayContainerElement = null;
__wpm.personalizationScopeShared = true;
var zoneElement;
var zoneObject;
zoneElement = document.getElementById('WebPartZone1');
if (zoneElement != null) {
zoneObject = __wpm.AddZone(zoneElement, 'WebPartZone1', true, false, 'black');
}
</script>
</form>
</body>
</html>