Imports System Imports System.Collections.Generic Imports System.Drawing.Imaging Imports System.IO Imports System.Linq Imports System.Web Imports System.Drawing Imports System.Threading Namespace Data Public NotInheritable Class DataProvider Private Sub New() End Sub <ThreadStatic()> Private Shared _photos As List(Of Photo) Public Shared Function GetData() As IList(Of Photo) If _photos IsNot Nothing Then Return _photos End If _photos = New List(Of Photo)() For Each file As String In Directory.GetFiles(HttpContext.Current.Server.MapPath("Res1\User1\Residence1\")) Dim photo = New Photo() photo.Name = Path.GetFileName(file) Dim image__1 As Image = Image.FromFile(file) Using memoryStream = New MemoryStream() image__1.Save(memoryStream, ImageFormat.Png) photo.Data = memoryStream.ToArray() End Using _photos.Add(photo) Next Return _photos End Function End Class Public Class Photo Private Shared ReadOnly _key As New Object() <ThreadStatic()> Private Shared _counter As Integer Public Sub New() Id = GetId() End Sub Public Property Name() As String Get Return m_Name End Get Set(ByVal value As String) m_Name = value End Set End Property Private m_Name As String Public Property Data() As Byte() Get Return m_Data End Get Set(ByVal value As Byte()) m_Data = value End Set End Property Private m_Data As Byte() Public Property Id() As Integer Get Return m_Id End Get Private Set(ByVal value As Integer) m_Id = value End Set End Property Private m_Id As Integer Protected Shared Function GetId() As Integer SyncLock _key _counter += 1 End SyncLock Return _counter End Function End ClassEnd Namespace<telerik:RadComboBox ID="RadComboBox1" runat="server" Height="300px" > <Items> <telerik:RadComboBoxItem Text="Room1" /> <telerik:RadComboBoxItem Text="Room2" /></Items> </telerik:RadComboBox>We are opening a pop-up window from the parent window with the following code. The child window which we are opening does not have any Telerik controls and it’s an external link. The window opens fine, without any issues.
In the new opened child page there is a Query which gets executed when the print button is clicked. When this Jquery is called it opens a print dialog box as expected, but when the window is printed, it’s not taking the print.css and also its printing the parent page.
.cs code
txtDDDD.NavigateUrl = "javascript:top.openMaximizePopup(‘URL’)
JavaScript Code in the parent page
function openMaximizePopup(url)
{
var oWnd = top.radopen(url, "modalPopup");
oWnd.SetSize(widthValue - 260, heightValue - 150);
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Maximize);
oWnd.set_modal(true);
if (title != "") oWnd.set_title(title);
oWnd.Center();
}
Javascript in Child Page
<script language = "javascript" type="text/javascript">
$(document).ready(function () {
$("input[id$= ImageButtonPrint]").click(function()
{
window.print();
});
});
Any help on this is appreciated.