DocuVieware not working inside ASP Update Panel
Posted: Wed May 16, 2018 11:56 pm
Hello,
I have simple treeview which displays the documents and when clicked on the node will display the document in DocuVieware. This code works if the treeview and docuvieware are not in the update panel(I have commented the code for update panel and the code works as expected), but if they are inside the update panel the docuvieware is not displaying the document not it is loading the docuvieware control.
Please help me if you know the solution for this issue.
Below is my code:
ASPX Page:
<form id="form1" runat="server">
<asp:ScriptManager runat="server"></asp:ScriptManager>
<%-- <asp:UpdatePanel runat="server" ID="up">
<ContentTemplate>--%>
<asp:TreeView runat="server" ID="TreeView1" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged">
</asp:TreeView>
<cc1:DocuVieware ID="DocuVieware1" runat="server" Height="600px" Width="100%" />
<%--</ContentTemplate>
</asp:UpdatePanel>--%>
</form>
Code behind:
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
var docbyte = from l in db.DocumentRepositories
where l.DocumentRepositoryId == Convert.ToInt32(this.TreeView1.SelectedNode.Value)
select l;
if (docbyte.Any())
{
FileStream stream = new FileStream(docbyte.First().FileLocationPath, FileMode.Open, FileAccess.Read);
DocuVieware1.LoadFromStream(stream, true, this.TreeView1.SelectedNode.Text);
}
}
I have simple treeview which displays the documents and when clicked on the node will display the document in DocuVieware. This code works if the treeview and docuvieware are not in the update panel(I have commented the code for update panel and the code works as expected), but if they are inside the update panel the docuvieware is not displaying the document not it is loading the docuvieware control.
Please help me if you know the solution for this issue.
Below is my code:
ASPX Page:
<form id="form1" runat="server">
<asp:ScriptManager runat="server"></asp:ScriptManager>
<%-- <asp:UpdatePanel runat="server" ID="up">
<ContentTemplate>--%>
<asp:TreeView runat="server" ID="TreeView1" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged">
</asp:TreeView>
<cc1:DocuVieware ID="DocuVieware1" runat="server" Height="600px" Width="100%" />
<%--</ContentTemplate>
</asp:UpdatePanel>--%>
</form>
Code behind:
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
var docbyte = from l in db.DocumentRepositories
where l.DocumentRepositoryId == Convert.ToInt32(this.TreeView1.SelectedNode.Value)
select l;
if (docbyte.Any())
{
FileStream stream = new FileStream(docbyte.First().FileLocationPath, FileMode.Open, FileAccess.Read);
DocuVieware1.LoadFromStream(stream, true, this.TreeView1.SelectedNode.Text);
}
}