This is a migrated thread and some comments may be shown as answers.

[Solved] Accessing telerik Window in page load

1 Answer 153 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mahesh Babu
Top achievements
Rank 1
Mahesh Babu asked on 21 Jul 2009, 11:50 AM
Hi,

I have a asp.net page in which I am want to pass parameters to a rad window. I want to access that parameter in the rad window page_load method on the server side. I am not able to able to access this value as it is at the very initial stages to load. But, I can access the parameter at client level by writing onload method on body tag like this:

<script language="javascript" type="text/javascript">
function GetRadWindow()
{
  var oWindow = null;
  if (window.radWindow)
     oWindow = window.radWindow;
  else if (window.frameElement.radWindow)
     oWindow = window.frameElement.radWindow;
  return oWindow;
}

function receiveArg()
{
   var currentWindow = GetRadWindow();
   alert(currentWindow.argument);
 
}
</script>
   
</head>
<body onload="receiveArg();">
  <form id="form" runat="server">


But, I dont want to do this at the client level. I require this value in page load at server side as I need to do some business logic over it.

Is there any way to get this????


Thanks,
Mahesh

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 22 Jul 2009, 02:27 PM
Hi Mahesh,

You are transferring the argument to the content page on the client only (with JavaScript). That is why you cannot access it on the server - you need to "send it there" somehow. This could happen either by submitting the form / postback or by using Ajax call.
Sending arguments from the client to the server is not related to the RadWindow control but is a general programming task. There are various ways to do that (__doPostBack() / ajax call), but since you are using RadControls and I assume you want to avoid postbacks, I suggest to use the RadAjaxManager's client-side API and ajaxRequest().


As an alternative you could send arguments from the parent page to the content one via the query string like shown in the following demo:
http://demos.telerik.com/aspnet-ajax/window/examples/usingurlforserverarguments/defaultcs.aspx


Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Mahesh Babu
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or