var url = 'ManageFormsPopup.aspx';
//Show the category window to manage categories
var prefrence="height=400,width=500,status=yes,toolbar=no,menubar=no";
window.open(url, null, prefrence);
In the child page, trigger the onbeforeunload method.
window.onbeforeunload = RefreshParentPage;
// ...
function RefreshParentPage()
{
// Refresh the parent page.
window.opener.location.href = window.opener.location.href;
}
function Validate()
{
var categoryName = document.getElementById('<%=txtCategoryName.ClientID%>').value;
if(categoryName.toString() == "")
{
document.getElementById('<%=lblValidate.ClientID%>').innerHTML = "Please enter Category Name";
return false;
}
else {
document.getElementById('<%=lblValidate.ClientID%>').innerHTML = "";
}
return true;
}
if (System.IO.File.Exists(FilePathVal))
{
FileInfo fi = new FileInfo(FilePathVal);
long size = fi.Length;
Response.AddHeader("Content-Length", size.ToString());
Response.ContentType = "application/pdf";
Response.BinaryWrite(File.ReadAllBytes(FilePathVal));
Response.Flush();
Response.Clear();
}
<asp:TemplateColumn HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="lblDelete" CommandName="Delete" runat="server" Text="Delete"
OnClientClick="javascript:return confirm('Are you sure you want to delete ?');"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:DataGrid ID="grdResources" runat="server" AutoGenerateColumns="False"
Width="100%" DataKeyField="ResID" OnItemDataBound="grdResources_ItemDataBound">
In server side:
protected void grdResources_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
Private const URL = "some file name";
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
lnkSelect.Attributes.Add("onclick", "javascript:window.open('" + URL + "'); return true;");
}
}
string[] Roles = cUser.Roles;
List<string> RoleList = new List<string>(Roles);
if (RoleList.Contains(FormsAdmin))
{
// Found the string.
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (2)
Author
Commented:Commented: