Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Escape characters in RegisterClientScriptBlock

Reply
Thread Tools

Escape characters in RegisterClientScriptBlock

 
 
deepa.ravikiran@gmail.com
Guest
Posts: n/a
 
      01-25-2007
Escape characters in RegisterClientScriptBlock

I am using the RegisterClientScriptBlock to emit client script. What I
am trying to do here is:

User can open a popup window to build an MS Access connection string.
>From the popup window, user can browse to a file.

When he clicks OK from the popup window, the connection string is built
using the file he selected and a text box in the parent window has to
be filled with this connection string.


The script that is being emitted is as below.
"<script lang=javascript>
window.opener.document.forms(0).ctl00_ContentPlace Holder2_txtConnection.value
= 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\1Temp\\GG.mdb';self.close() </script>"

The problem I am having is : The parent text box doesnt get the file
path in the connection string properly. The text I see in the text box
is this:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:TempGG.mdb

Any ideas/suggestions really appreciated.

Thanks,
Deepa

 
Reply With Quote
 
 
 
 
deepa.ravikiran@gmail.com
Guest
Posts: n/a
 
      01-25-2007
I figured out!! I have to escape the backslashes twice in the string

So this works -
Source=C:\\\\1Temp\\\\GG.mdb

On Jan 24, 5:17 pm, deepa.raviki...@gmail.com wrote:
> Escape characters in RegisterClientScriptBlock
>
> I am using the RegisterClientScriptBlock to emit client script. What I
> am trying to do here is:
>
> User can open a popup window to build an MS Access connection string.>From the popup window, user can browse to a file.When he clicks OK from the popup window, the connection string is built
> using the file he selected and a text box in the parent window has to
> be filled with this connection string.
>
> The script that is being emitted is as below.
> "<script lang=javascript>
> window.opener.document.forms(0).ctl00_ContentPlace Holder2_txtConnection.value
> = 'Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\\1Temp\\GG.mdb';self.close() </script>"
>
> The problem I am having is : The parent text box doesnt get the file
> path in the connection string properly. The text I see in the text box
> is this:
>
> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C: TempGG.mdb
>
> Any ideas/suggestions really appreciated.
>
> Thanks,
> Deepa


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read strings cantaining escape character from a file and useit as escape sequences? slomo Python 5 12-02-2007 11:39 AM
Re: html special character and escape characters knowledgepays@hotmail.com ASP .Net 0 01-27-2005 02:08 AM
trying out escape characters Griff Perl 6 08-20-2004 08:20 PM
What Happens To Escape Characters? Guadala Harry ASP .Net 3 08-19-2004 01:59 AM
Escape characters Maziar Aflatoun ASP .Net 3 12-05-2003 05:55 PM



Advertisments