Hi,
I shall have to pass bulk data between page to radwindow and vice versa. A sample application code is below. In this by using PreviousPageType' data transferred (Click on Ordinary Button). But in radwindow it shows the error 'Object reference not set to an instance of an object.'(Click on Popup button). How to achieve this method in radwiondow?.
Default.aspx
Default.aspx.cs
DefaultPopup.aspx
DefaultPopup.aspx.cs
Thanks & Regards
Anzar. M
I shall have to pass bulk data between page to radwindow and vice versa. A sample application code is below. In this by using PreviousPageType' data transferred (Click on Ordinary Button). But in radwindow it shows the error 'Object reference not set to an instance of an object.'(Click on Popup button). How to achieve this method in radwiondow?.
Default.aspx
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"></asp:Content><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <telerik:RadScriptBlock ID="RadScriptBlock" runat="server"> <script type="text/javascript"> function btnShowPopup_Clicked(sender, args) { var winSearch = radopen("DefaultPopup.aspx"); if (winSearch) { winSearch.hide(); winSearch.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close | Telerik.Web.UI.WindowBehaviors.Move) winSearch.add_close(searchWindow_OnClientClose); winSearch.set_height(400); winSearch.set_width(780); winSearch.set_visibleStatusbar(false); winSearch.set_destroyOnClose(true); winSearch.set_modal(true); winSearch.set_title("Popup"); winSearch.center(); winSearch.show(); } } function RadWindow_Close(sender, args) { var manager = sender.get_windowManager(); if (manager) manager.removeWindow(sender); } function searchWindow_OnClientClose(oWnd, args) { var arg = args.get_argument(); if (arg) { var ajaxManager = $find("<%= radAjaxManager.ClientID %>"); if (ajaxManager) ajaxManager.ajaxRequest(arg); } } </script> </telerik:RadScriptBlock> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="radAjaxManager" runat="server" UpdatePanelsRenderMode="Inline" OnAjaxRequest="radAjaxManager_AjaxRequest"> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="Center" InitialDelayTime="300"> </telerik:RadAjaxLoadingPanel> <telerik:RadWindowManager ID="radWinManager" runat="server" DestroyOnClose="True"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server" Style="display: none;" OnClientClose="RadWindow_Close"> <Shortcuts> <telerik:WindowShortcut CommandName="CommandName" Shortcut="" /> </Shortcuts> </telerik:RadWindow> </Windows> <Shortcuts> <telerik:WindowShortcut CommandName="CommandName" Shortcut="" /> </Shortcuts> </telerik:RadWindowManager> <asp:TextBox ID="txtFirst" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Ordinary" OnClick="Button1_Click" /> <telerik:RadButton ID="btnShowPopup" runat="server" Text="Popup" AutoPostBack="false" OnClientClicked="btnShowPopup_Clicked"> </telerik:RadButton></asp:Content>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApplication1{ public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { this.Name = this.txtFirst.Text; Server.Transfer("~/DefaultPopup.aspx"); } // public string Name { get; set; } protected void radAjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) { } public string Name { get { return Convert.ToString(ViewState["SName"]); } set { ViewState["SName"] = value; } } }}DefaultPopup.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DefaultPopup.aspx.cs" Inherits="WebApplication1.DefaultPopup" %><%@ PreviousPageType VirtualPath="~/Default.aspx" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> </script> </telerik:RadCodeBlock></head><body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadWindowManager ID="radWinManager" runat="server" DestroyOnClose="True" KeepInScreenBounds="true"> </telerik:RadWindowManager> </div> </form></body></html>DefaultPopup.aspx.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApplication1{ public partial class DefaultPopup : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Write("Data from PreviousPage:" + PreviousPage.Name); } }}Thanks & Regards
Anzar. M