codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Javascript Error in RegisterClientScriptBlock  Mahendar at 04:25 on Saturday, January 20, 2007
 

Hi,
i have a problem in the code mentioned below, the variable "strBeneficiaryName" has a single quote (For eg: Mc O' Neal) which is passed as a parameter in the query string.
My doubt is whether the function Page.RegisterClientScriptBlock("OnLoad",strJavascript); handles single quote.
This problem doesnt come if i use a Modal window.
How can this be handled using a Modless window.



{
//Construct the script and open the page by registering the script
string strBenficiaryId=Session["CurrentBeneficiaryId"].ToString().Trim();
string strBeneficiaryName=Session["CurrentBeneficiaryName"].ToString().Trim();
int intEntityTypeCode=5;
string strJavascript="";
strJavascript+= "<SCRIPT LANGUAGE='JavaScript'>";
string strQuery="/PABASUI/PABASPREMIERPPOUI/PABASPREMIERPPONOTESUI/PPONotNotesDetails_strCSR_CSR_ampEntityId_.html"+strBenficiaryId+"&EntityName="+strBeneficiaryName+"&EntityTypeCode="+intEntityTypeCode;
strJavascript+="window.open('" + strQuery+ "','_blank','status=0,menubar=0,left=0,top=20,width='+(window.screen.width-8)+',height='+(window.screen.availHeight-130)+' ,scrollbars=0,resizable=0,toolbar=0,maximize=0');";
strJavascript+="</SCRIPT>";
Page.RegisterClientScriptBlock("OnLoad",strJavascript);
}








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Help with Form--onClick won`t run function
•  NaN
•  accessing oleVariant type of activeX component written in delphi
•  Image array - webcam display
•  Multiple onload not working?
•  Hi,i m a new guy learing c++, here is the thing...please help me out...
•  Re: read lines from a file
•  Re: C++ Inheritance Polymorphism
•  Re: getting an object`s property which is decided by content of variable.


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009