HighTechTalks DotNet Forums  

Re: Page Load Phasing

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss Re: Page Load Phasing in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
William Daniel
 
Posts: n/a

Default Re: Page Load Phasing - 05-02-2006 , 02:14 AM






Hi Gary,

Use the method of registering a client script while the server-side code
is executing. See a code snippet below being used at server-side:

System.Text.StringBuilder sb=new System.Text.StringBuilder();
sb.Append("<script language=javascript>");
string msg="OpenPreviewWindow();";
sb.Append(msg);
string strfuncmsg = "function OpenPreviewWindow()
{window.open('FPCampaign_NewsletterPreview.aspx?re ad="+strpathXML+"');return
false;}";
sb.Append(strfuncmsg);
sb.Append("</script>");
string strScript = sb.ToString();
Page.RegisterStartupScript("ss",strScript);

This is a code block from the Page_Load event of an ASP.NET page.

Thanks and Regards,
Daniel

Gary Coutts wrote:
Quote:
Hi,

I am generating a popup window for data entry using the javascript
window.open function:

window.open('ViewItem.aspx', Index, WindowSetUp) ;

I need to generate some controls dynamically in ViewItem.aspx, the type of
controls generated are dependant on Index.

I need to pass the Index value to ViewItem.aspx and I am using a hidden
control (hCatIndex) and small java function to store the info:


function PassData()
{
var CatIndex ;

CatIndex = document.getElementById("hCatIndex") ;
CatIndex.value = window.dialogArguments ;
}

PassData() is run when the page is loaded, the problem is that the script is
run after the Page_Load() of ViewItem and I need the info before this.

Can I get the script (PassData) to run before Page_Load ?

Is this a valid way to pass data between Client and Server or is there a
better way.


I am using Visual Studio .Net 2003.


Any ideas or comments would be most appreciated.


Best Regards

Gary Coutts




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.