Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Post back from tree view node not working View modes: 
User avatar
Member
Member
kevin.clark-gaprc - 3/28/2011 11:04:50 AM
   
Post back from tree view node not working
I created a user control that builds a tree view that has links. The links calls the same page with the user control on it, but with query string values. When I click on the link, the page does a post back, but never seems to enter the page_load logic of the control. The page that it's posting back to has two user control, one for the menu and one with the tree view control. The postback goes through the page_load for the menu user control, but it never seem to reach the page_load for the user control containing the tree view. Below is a copy of the code that builds the link in the tree view. This user control works perfectly outside of Kentico so I'm a bit puzzled why it doesn't work now. Also, the initial load of the control works fine, as it builds the tree for me to click the link.

myNode.Text = "<span>" + desc + "</span> </a>    <a href='/dealer-extranet/salesdocmaint.aspx?caller=docmaint&action=delete&desc=&Cat&catId=" + nodeId + "&hasChild=" + hasChild + "' > Delete </a> |  <a href='/dealer-extranet/salesdocmaint.aspx?caller=docmaint&action=edit&desc=" + HttpUtility.UrlEncode(desc) + "&hasChild=&catId=" + nodeId + "' > Edit </a> | <a href='/dealer-extranet/salesdocmaint.aspx?caller=docmaint&action=add&catId=" + nodeId + "&desc=" + HttpUtility.UrlEncode(desc) + "&hasChild=' > Add Document </a>";

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 3/28/2011 2:13:20 PM
   
RE:Post back from tree view node not working
Hi,

if the user control is working outside the Kentico project, you could try to insert it into the User Control webpart. This web part should ensure correct life cycle of the control, since there are some differences in Kentico.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
kevin.clark-gaprc - 3/28/2011 2:18:37 PM
   
RE:Post back from tree view node not working
It is currently inside of the User Control webpart. We have several user controls and all of them are working fine inside of the the User control webpart except this one with the treeview control.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 3/29/2011 8:33:24 AM
   
RE:Post back from tree view node not working
Hi,

could you please provide us the whole code of your user control?

I tried to reproduce the issue - created custom user control, inserted it to User control webpart and click on the Delete link button, but I reached Page_Load method.

Here is the code of my user control:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.CMSHelper;

public partial class CMSAdminControls_testUserControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
LiteralControl lc = new LiteralControl();
lc.Text = "<a href=\"~" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=delete&desc=&Cat&catId=" + CMSContext.CurrentDocument.NodeID + "&hasChild=true\"> Delete </a>";
lc.Visible = true;

this.Controls.Add(lc);
}
}


Best regards,
Ivana Tomanickova

User avatar
Member
Member
kevin.clark-gaprc - 3/29/2011 11:18:27 AM
   
RE:Post back from tree view node not working
Below is a copy of the .cs file for the control and I will past a copy of the .ascx next



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.IO;
using CMS.PortalControls;
using CMS.GlobalHelper;
using CMS.CMSHelper;

public partial class CMSWebParts_RohlWebParts_SalesDocMaint : CMSAbstractWebPart
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Session["action"] = "";
}

//if (QueryHelper.Contains("action"))
//{

string action = QueryHelper.GetString("action", "");
string catId = QueryHelper.GetString("catId", "");
string desc = QueryHelper.GetString("desc", "");
string hasChild = QueryHelper.GetString("hasChild", "");
Session["action"] = action;
PerformAction(action, catId, desc, hasChild);
// ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showstuff", "alert('Inside of salesdocmaint ... " + Request.Url.AbsoluteUri + "');", true);
//}
}

private void PerformAction(String action, String nodeId, String desc, String hasChild)
{
string script = "";
switch (action)
{
case "add":
script = "document.getElementById('rightDiv').className = 'rightDivStyleVisible';";
txtEditCatName.Text = desc;
txtEditCatName.Enabled = false;
HiddenCatId.Value = nodeId;

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showstuff", script, true);

break;
//Can only Edit category name
case "edit":
script = "document.getElementById('newCatRight').className = 'newCatStyleVisible';";
if (HiddenCatId.Value.ToString() != nodeId)
{
txtNewCatName.Text = desc;
}
txtNewCatName.Enabled = true;
HiddenCatId.Value = nodeId;
Session["action"] = "edit";

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showstuff", script, true);
break;

case "replace":
script = "document.getElementById('rightDiv').className = 'rightDivStyleVisible';";
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showstuff", script, true);
txtEditCatName.Enabled = false;
HiddenCatId.Value = nodeId;
GetDocumentInfo(nodeId);
break;
//Delete document from Category
case "deleteDoc":
script = "document.getElementById('rightDiv').className = 'rightDivStyleVisible';";
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showstuff", script, true);
btnDeleteDocument.Visible = true;
btnCancelDelDoc.Visible = true;
btnSaveDocument.Visible = false;
txtEditCatName.Enabled = false;
HiddenCatId.Value = nodeId;
GetDocumentInfo(nodeId);
break;
//Delete Category but only if it doesn't have any child nodes
case "delete":
if (hasChild.Trim() != "")
{
LabelErrorList.Text = "Category still has documents and cannot be deleted.";
return;
}
else
{
DeleteCategory(nodeId);
LabelStatus.Text = "Category successfully deleted.";
CategoryRepeater.DataBind();
}

HiddenCatId.Value = "0";
break;

case "download":
txtEditCatName.Enabled = false;
HiddenCatId.Value = nodeId;
string filename = "";
string sqlStr = "Select docName From salesDocuments where childNodeId =" + nodeId;

try
{
string connectionString = ConfigurationManager.ConnectionStrings["dealerextranetConnStr"].ToString();
SqlConnection myConnection = new SqlConnection(connectionString);
SqlCommand mySelectCommand = new SqlCommand(sqlStr, myConnection);
myConnection.Open();
SqlDataReader myReader;
myReader = mySelectCommand.ExecuteReader();
while (myReader.Read())
{
filename = myReader["docName"].ToString();
}
myConnection.Close();
fileDownload(filename, Server.MapPath("~/RohlCMS/DocumentLibrary/" + filename));
}
catch (Exception ex)
{
string strError = ex.Message.ToString();
//"Thread was being aborted. " is an acceptable exception.
}

break;
}
}
protected void CategoryRepeater_ItemDatabound(object sender, RepeaterItemEventArgs e)
{
RepeaterItem item = e.Item;
if ((item.ItemType == ListItemType.Item) || (item.ItemType == ListItemType.AlternatingItem))
{
DataRowView drv = (DataRowView)e.Item.DataItem;
string desc = drv.Row["description"].ToString();
string nodeId = drv.Row["nodeId"].ToString();
string hasChild = drv.Row["hasChild"].ToString();

TreeView mytree = (TreeView)e.Item.FindControl("CategoryTree");
TreeNode myNode = new TreeNode();

myNode.Text = "<span>" + desc + "</span> </a>    <a href='" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=delete&desc=&Cat&catId=" + nodeId + "&hasChild=" + hasChild + "' > Delete </a> |  <a href='" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=edit&desc=" + HttpUtility.UrlEncode(desc) + "&hasChild=&catId=" + nodeId + "' > Edit </a> | <a href='" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=add&catId=" + nodeId + "&desc=" + HttpUtility.UrlEncode(desc) + "&hasChild=' > Add Document </a>";
mytree.Nodes.Add(myNode);

string sql = "Select * from salesDocuments where nodeId = " + nodeId;
Session["TreeView"] = mytree;
SqlDSDocumentList.SelectCommand = sql;
documentRepeater.DataBind();
}
}

protected void DocumentRepeater_ItemDatabound(object sender, RepeaterItemEventArgs e)
{
RepeaterItem item = e.Item;
if ((item.ItemType == ListItemType.Item) || (item.ItemType == ListItemType.AlternatingItem))
{
DataRowView drv = (DataRowView)e.Item.DataItem;
string docName = drv.Row["docName"].ToString();
string childNodeId = drv.Row["childNodeId"].ToString();
TreeView mytree = (TreeView)Session["TreeView"];

TreeNode childNode = new TreeNode();
TreeNode parentNode = mytree.Nodes[0];

childNode.Text = "<a href='" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=download&desc=&catId=" + childNodeId + "&hasChild=' >" + docName + " </a>    <a href='" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=deleteDoc&desc=&catId=" + childNodeId + "&hasChild=' > Delete </a> |  <a href='" + CMSContext.CurrentAliasPath + ".aspx?caller=docmaint&action=replace&desc=&catId=" + childNodeId + "&hasChild=' > Replace </a>";
parentNode.ChildNodes.Add(childNode);

}
}

private void fileDownload(string fileName, string fileUrl)
{
Page.Response.Clear();
bool success = GenUtils.ResponseFile(Page.Request, Page.Response, fileName, fileUrl, 1024000);
if (!success)
LabelErrorList.Text = "Downloading Error, contact administrator!";
Page.Response.End();

}


protected void btnAddCategory_Click(object sender, EventArgs e)
{
LabelStatus.Text = "";
string script = "document.getElementById('newCatRight').className = 'NewCatStyleVisible';";

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showstuff", script, true);
}

protected void btnSaveCategoryName_Click(object sender, EventArgs e)
{
string sqlStr = "";

if (Session["action"].ToString() == "edit")
{
sqlStr = "Update documentCategory Set description = '" + txtNewCatName.Text + "' Where nodeId = " + HiddenCatId.Value.ToString();
}
else
sqlStr = "Insert Into documentCategory (description) Values('" + txtNewCatName.Text + "')";

try
{
string connectionString = ConfigurationManager.ConnectionStrings["dealerextranetConnStr"].ToString();

SqlConnection myConnection = new SqlConnection(connectionString);

SqlCommand mySelectCommand = new SqlCommand(sqlStr, myConnection);
myConnection.Open();
SqlDataReader myReader;

myReader = mySelectCommand.ExecuteReader();

myConnection.Close();
string script = "document.getElementById('newCatRight').className = 'NewCatStyleHidden';";

ScriptManager.RegisterStartupScript(this.Page,this.GetType(), "hidestuff", script, true);
LabelStatus.Text = "Category added successfully";
txtNewCatName.Text = "";

CategoryRepeater.DataBind();

}
catch (Exception ex)
{
string strError = ex.Message.ToString();
}
}

protected void btnSaveDocument_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
try
{
if (FileUpload1.PostedFile.ContentLength > 50000000)
{
LabelErrorList.Text = "File being uploaded cannot be larger than 50 MBytes.";
return;
}
string fileName = FileUpload1.FileName.ToString();
int idx = fileName.LastIndexOf(".");
string ext = fileName.Substring(idx).ToLower().Trim();
FileUpload1.SaveAs(Server.MapPath("~/RohlCMS/DocumentLibrary/" + fileName));
SaveNewDocument(fileName, ext);
string script = "document.getElementById('rightDiv').className = 'rightDivStyleHidden';";
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "hidestuff", script, true);
}
catch (Exception ex)
{
string strError = ex.Message.ToString();
}

}
}

private void SaveNewDocument(String FileName, String ext)
{
string sqlStr = "";
try
{

if (Session["action"].ToString() == "add")
{
sqlStr = "Insert Into salesDocuments (nodeId, docName, fileType, createDate, lastUpdate) ";
sqlStr += " Values(" + HiddenCatId.Value.ToString() + ", '" + FileName + "', '" + ext + "', getdate(), getdate() )";
LabelStatus.Text = "Document added successfully";
}

if (Session["action"].ToString() == "replace")
{
sqlStr = "Update salesDocuments set docName = '" + FileName + "', fileType = '" + ext + "', lastUpdate = getdate() Where childNodeId = " + HiddenCatId.Value.ToString();
LabelStatus.Text = "Document replaced successfully";
}

string connectionString = ConfigurationManager.ConnectionStrings["dealerextranetConnStr"].ToString();

SqlConnection myConnection = new SqlConnection(connectionString);

SqlCommand mySelectCommand = new SqlCommand(sqlStr, myConnection);
myConnection.Open();
SqlDataReader myReader;

myReader = mySelectCommand.ExecuteReader();

myConnection.Close();

txtNewCatName.Text = "";
txtEditCatName.Text = "";
HiddenCatId.Value = "0";
CategoryRepeater.DataBind();
string script = "document.getElementById('newCatRight').className = 'NewCatStyleHidden';";

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "hideRightDivstuff", script, true);
}
catch (Exception ex)
{
string strError = ex.Message.ToString();
}
}

private void GetDocumentInfo(String childNodeId)
{
string sqlStr = "Select sd.fileType, sd.docName, sd.createDate, sd.lastUpdate, dc.description From salesDocuments sd, documentCategory dc ";
sqlStr += "Where dc.nodeId = sd.nodeId And sd.childNodeId = " + childNodeId;

try
{
string connectionString = ConfigurationManager.ConnectionStrings["dealerextranetConnStr"].ToString();

SqlConnection myConnection = new SqlConnection(connectionString);
SqlCommand mySelectCommand = new SqlCommand(sqlStr, myConnection);
myConnection.Open();
SqlDataReader myReader;

myReader = mySelectCommand.ExecuteReader();
string filetype = "";

while (myReader.Read())
{
filetype = myReader["fileType"].ToString();
DocNameLabel.Text = myReader["docName"].ToString();
CreatedateLabel.Text = myReader["createDate"].ToString();
LastUpdatedLabel.Text = myReader["lastUpdate"].ToString();
txtEditCatName.Text = myReader["description"].ToString();

}

switch (filetype.ToLower().Trim())
{
case ".xls":
DocTypeImage.ImageUrl = "../../RohlCMS/media/dealer_extranet/Excel-icon.png";
DocTypeImage.AlternateText = "Excel Document";
DocTypeImage.ToolTip = "Excel Document";
break;
case ".xlsx":
DocTypeImage.ImageUrl = "../../RohlCMS/media/dealer_extranet/Excel-icon.png";
DocTypeImage.AlternateText = "Excel Document";
DocTypeImage.ToolTip = "Excel Document";
break;
case ".pdf":
DocTypeImage.ImageUrl = "../../RohlCMS/media/dealer_extranet/Icon_pdf.gif";
DocTypeImage.AlternateText = "PDF Document";
DocTypeImage.ToolTip = "PDF Document";
break;
case ".doc":
DocTypeImage.ImageUrl = "../../RohlCMS/media/dealer_extranet/Word-16.gif";
DocTypeImage.AlternateText = "Word Document";
DocTypeImage.ToolTip = "Word Document";
break;
case ".docx":
DocTypeImage.ImageUrl = "../../RohlCMS/media/dealer_extranet/Word-16.gif";
DocTypeImage.AlternateText = "Word Document";
DocTypeImage.ToolTip = "Word Document";
break;
}

myConnection.Close();
}
catch (Exception ex)
{
string strError = ex.Message.ToString();
}
}

protected void btnDeleteDocument_Click(object sender, EventArgs e)
{
string sqlStr = "Delete salesDocuments Where childNodeId = " + HiddenCatId.Value.ToString(); ;

try
{
string connectionString = ConfigurationManager.ConnectionStrings["dealerextranetConnStr"].ToString();

SqlConnection myConnection = new SqlConnection(connectionString);

SqlCommand mySelectCommand = new SqlCommand(sqlStr, myConnection);
myConnection.Open();
SqlDataReader myReader;

myReader = mySelectCommand.ExecuteReader();

myConnection.Close();
File.Delete(MapPath("~/RohlCMS/DocumentLibrary/") + DocNameLabel.Text);
string script = "document.getElementById('newCatRight').className = 'NewCatStyleHidden';";

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "hidestuff", script, true);
LabelStatus.Text = "Document deleted successfully";
txtNewCatName.Text = "";
Session["action"] = "";
CategoryRepeater.DataBind();
}
catch (Exception ex)
{
string strError = ex.Message.ToString();
}
}

protected void btnCancelDelDoc_Click(object sender, EventArgs e)
{
txtNewCatName.Text = "";
txtEditCatName.Text = "";
HiddenCatId.Value = "0";
Session["action"] = "";
DocTypeImage.ImageUrl = "../../RohlCMS/media/dealer_extranet/filetype.gif";
string script = "document.getElementById('rightDiv').className = 'rightDivStyleHidden';";

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "hideRightDivstuff", script, true);
}


private void DeleteCategory(String NodeId)
{

string sqlStr = "Delete documentCategory Where nodeId = " + NodeId;

try
{
string connectionString = ConfigurationManager.ConnectionStrings["dealerextranetConnStr"].ToString();

SqlConnection myConnection = new SqlConnection(connectionString);

SqlCommand mySelectCommand = new SqlCommand(sqlStr, myConnection);
myConnection.Open();
SqlDataReader myReader;

myReader = mySelectCommand.ExecuteReader();

myConnection.Close();

}
catch (Exception ex)
{
string strError = ex.Message.ToString();
}
}
}



User avatar
Member
Member
kevin.clark-gaprc - 3/29/2011 11:21:15 AM
   
RE:Post back from tree view node not working
Code for the .ascx file.


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SalesDocMaint.ascx.cs" Inherits="CMSWebParts_RohlWebParts_SalesDocMaint" %>

<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 109px;
}
.style3
{
width: 154px;
text-align: right;
}
.rightDivStyleHidden
{
width:56%; float:right; vertical-align:top; border-style:solid; border-width:thin; visibility:hidden;
}

.rightDivStyleVisible
{
width:56%; float:right; vertical-align:top; border-style:solid; border-width:thin; visibility:visible; background-color:#e4e9d2;
}

.leftDivStyle
{
background-color:#e4e9d2;
width:40%; float:left;
}

.buttonStyle
{
color:#591b11;
font-family: Tahoma;
font-size: 12px;
font-weight:bold;
letter-spacing: 0.5px;
background-color:#B6814A;
border-top:solid 1px #591b11;
border-right:solid 1px #591b11;
border-bottom:solid 1px #591b11;
border-left:solid 1px #591b11;
}

.NewCatStyleHidden
{
width:60%;
float:right;
visibility:hidden;
}

.NewCatStyleVisible
{
width:60%;
float:right;
visibility:Visible;
}
</style>
<div style="background-color:White;">
<div>
<asp:ValidationSummary ID="UserDataValidationSummary" runat="server"
DisplayMode="List"
HeaderText="One or more errors (detailed below) have been detected in your submission. Please correct and resubmit the form. <br>"
ValidationGroup="SaveDoc" Font-Size="Small" />
<asp:Label ID="LabelErrorList" runat="server" ForeColor="Red" Font-Size="Smaller"></asp:Label>
<asp:Label ID="LabelStatus" runat="server" ForeColor="Green" Font-Size="Smaller"></asp:Label>
</div>
<div style=" padding-bottom:10px; padding-top:10px;">
<div id="newCatLeft" style=" width:30%; float:left;">
<asp:Button ID="btnAddCategory" runat="server" Text="Create New Category"
CssClass="buttonStyle" Width="180px" onclick="btnAddCategory_Click" />

</div>
<div id="newCatRight" style="width:60%;float:right; visibility:hidden;">
<table>
<tr>
<td><asp:TextBox ID="txtNewCatName" runat="server" Width="189px"
ValidationGroup="NewCatName"></asp:TextBox></td>

<td><asp:Button ID="btnSaveNewCatName" runat="server" Text="Save Category"
Class="buttonStyle" Width="140px" onclick="btnSaveCategoryName_Click"
ValidationGroup="NewCatName" /></td>

<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server" ErrorMessage="Category name required" Font-Size="Smaller"
ValidationGroup="NewCatName" ControlToValidate="txtNewCatName"></asp:RequiredFieldValidator></td>
</tr>
</table>
</div>
</div>
<br /> <br />
<div id="wrapper" style=" width:100%; background-color:#e4e9d2;">
<div id="leftDiv" style=" background-color:#e4e9d2; width:40%; float:left; font-size:11px" class="leftDivStyle">
<asp:Repeater ID="CategoryRepeater" runat="server" DataSourceID="SqlDSCategoryList" OnItemDataBound="CategoryRepeater_ItemDatabound">
<ItemTemplate>
<asp:TreeView ID="CategoryTree" runat="server" ShowLines="false" ExpandImageUrl="../../RohlCMS/media/dealer_extranet/001_01.gif" ExpandDepth="0" CollapseImageUrl="../../RohlCMS/media/dealer_extranet/001_02.gif" PopulateNodesFromClient="False">
</asp:TreeView>
<br />
</ItemTemplate>
</asp:Repeater>
<asp:Repeater runat="server" ID="documentRepeater" DataSourceID="SqlDSDocumentList" OnItemDataBound="DocumentRepeater_ItemDatabound" >
</asp:Repeater>
</div>
<div id="rightDiv" style="width:56%; float:right; vertical-align:top; border-style:solid; border-width:thin; visibility:hidden;" class="rightDivStyleHidden">

<table style="width: 100%;">
<tr>
<td style="width: 109px;">
 </td>
<td style=" width: 154px; text-align: right;">
 </td>
<td>
 </td>
</tr>
<tr>
<td style="width: 109px;">
Category Name:</td>
<td style=" width: 154px; text-align: right;">
<asp:TextBox ID="txtEditCatName" runat="server"></asp:TextBox>
</td>
<td>
 </td>
</tr>
<tr>
<td style="width: 109px;">
 </td>
<td style=" width: 154px; text-align: right;">
Document Info:</td>
<td>
 </td>
</tr>
<tr>
<td style="width: 109px;">
 </td>
<td style=" width: 154px; text-align: right;">
 </td>
<td>
<table style="width: 100%;">
<tr>
<td style="text-align: right">
Doc Name:
</td>
<td>
<asp:Label ID="DocNameLabel" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td style="text-align: right">
Doc Type:
</td>
<td>
<asp:Label ID="DocTypeLabel" runat="server"></asp:Label>
 <asp:Image ID="DocTypeImage" runat="server" Height="16px" ImageUrl="~/images/filetype.gif" Width="16px" />
</td>
</tr>
<tr>
<td style="text-align: right">
Last Updated:
</td>
<td>
<asp:Label ID="LastUpdatedLabel" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td style="text-align: right">
Created  Date:
</td>
<td>
<asp:Label ID="CreatedateLabel" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td style="text-align: right">
Upload File:</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 109px;">
 </td>
<td style=" width: 154px; text-align: right;">
<asp:Button ID="btnSaveDocument" runat="server" Text="Save Document"
CssClass="buttonStyle" Width="130px" ValidationGroup="SaveDoc"
onclick="btnSaveDocument_Click" />

</td>
<td style=" text-align:center;">
<asp:Button ID="btnDeleteDocument" runat="server" Text="Delete Document"
CssClass="buttonStyle" Width="130px" CausesValidation="False"
onclick="btnDeleteDocument_Click" Visible="False"
onclientclick="return confirm('Are you sure you want to delete selected document?')" />

 
<asp:Button ID="btnCancelDelDoc" runat="server" Text="Cancel"
CssClass="buttonStyle" Width="90px" CausesValidation="False" Visible="False"
onclick="btnCancelDelDoc_Click" />

</td>
</tr>
</table>

</div>
</div>
</div>
<asp:SqlDataSource ID="SqlDSCategoryList" runat="server" ConnectionString="<%$ ConnectionStrings:dealerextranetConnStr %>"

SelectCommand="SELECT dc.[nodeId], dc.[description], (select top 1 sd.nodeId From salesDocuments sd Where sd.nodeId = dc.nodeId) as hasChild FROM [documentCategory] dc ORDER BY dc.[description]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDSDocumentList" runat="server"
ConnectionString="<%$ ConnectionStrings:dealerextranetConnStr %>" >
</asp:SqlDataSource>
<asp:HiddenField ID="HiddenCatId" runat="server" Value="0" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="FileUpload1" Display="None"
ErrorMessage="Must Upload document." ValidationGroup="SaveDoc"></asp:RequiredFieldValidator>



User avatar
Member
Member
kevin.clark-gaprc - 3/29/2011 2:30:19 PM
   
RE:Post back from tree view node not working
Okay, I've made some progress. It seems part of my problem was one of my team messed up the install of the 5.5R2 upgrade, which was causing some problems behind them scene. The page_load is being called, it seems that ScriptManager.RegisterStartupScript is not fire off. I tried using Page.ClientScript.RegisterStartupScript and that's not working either. Should I create another post to for this question/issue?

Thanks!!!

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 3/30/2011 9:27:07 AM
   
RE:Post back from tree view node not working
Hi,

Could you please try to change this.GetType() to typeof(string) in ScriptManager.RegisterStartupScript parameters? It should help, if not please let me know.

Best regards,
Ivana Tomanickova