I have this code in the designer:
Code:
<%@PageLanguage="C#"AutoEventWireup="true"CodeBehind="Default.aspx.cs"Inherits="WebApplication8._Default" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1">
<title>Untitled Page</title></head>
<bodyrunat="server">
<scripttype="text/javascript"src="../jquery-1.2.6-vsdoc.js"/>
<scripttype="text/javascript"src="../jquery-1.2.6.min.js"/>
<scripttype="text/javascript"src="../jquery-ui-1.6.custom.min.js"/>
<scripttype="text/javascript"src="../jquery.blockUI.js"/><divid="di">
<tableid="tblCurrent"runat="server">
</table>
<inputtype="button"id="B"value="abc"onclick="$.blockUI();document.getElementById('unbloc').style.visibility = 'visible';"/>
</div>
<divid="unbloc"style="visibility: hidden">
<inputtype="button"id="Button1"value="bbbb"onclick="$.unblockUI();"/>
</div>
</body>
</html>
And this in the code behind
Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication8
{
publicpartialclass_Default : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
HtmlTableRow tr = newHtmlTableRow();
HtmlTableCell td = newHtmlTableCell();
td.NoWrap = true;
td.Controls.Add(newLiteralControl("ABC"));
tr.Controls.Add(td);
tblCurrent.Controls.Add(tr);
td.Controls.Add(newLiteralControl("DEF"));
tr.Controls.Add(td);
tblCurrent.Controls.Add(tr);
td.Controls.Add(newLiteralControl("GHI"));
tr.Controls.Add(td);
tblCurrent.Controls.Add(tr);
td.Controls.Add(newLiteralControl("JKL"));
tr.Controls.Add(td);
tblCurrent.Controls.Add(tr);
}
}
}
I cannot fathom why the web page would turn up empty.
It is supposed to display ABCDEFGHIJKL and a button.
In the code I am trying to prove that if there is dynamically generated html code in a web page, then unblockUI will fail to unblock the page, even though blockUI will work correctly.
I am expecting the code to display ABCDEFGHIJKL and a button. Upon clicking the button the entire web page will block and would display a button. Upon clicking this button the page won't unblock even though $.unblockUI is invoked.
And I am not getting even the controls displayed in the web page.