473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

window.showmodaldialog

I keep getting a script error (Expected end of statement) when I try to add
the following attribute to a <asp:Button server control. My vb.net looks as
follows ...

Dim sUrl As String = "../popup/newfolder.aspx"

Dim vArguments As String = "document.all('" & cmdNew.ClientID & "')"

Dim sfeatures As String = String.Empty

Dim s As String = "vbscript:vReturnValue = window.showModalDialog('" & sUrl
& "', " & vArguments & ", '" & sfeatures & "')"

cmdNew.Attributes.Add("OnClick", s)

Any suggestions?
Mar 15 '06 #1
1 1698

"Ben Schumacher" <bs*********@navegate.com> wrote in message
news:OG**************@tk2msftngp13.phx.gbl...
I keep getting a script error (Expected end of statement) when I try to add
the following attribute to a <asp:Button server control. My vb.net looks
as follows ...

Dim sUrl As String = "../popup/newfolder.aspx"

Dim vArguments As String = "document.all('" & cmdNew.ClientID & "')"

Dim sfeatures As String = String.Empty

Dim s As String = "vbscript:vReturnValue = window.showModalDialog('" &
sUrl & "', " & vArguments & ", '" & sfeatures & "')"

cmdNew.Attributes.Add("OnClick", s)

Any suggestions?


It looks as though you are using the single quote ' for all of your string
delimiters. The problem you are running into is that your vArguments is
set up using the ' as its delimiter so you are declaring it like this:

vArguments as string = "doucment.all('somevalue')"

Notice that <somevalue> is enclosed with ' delimiters.

If I put that into the s as String Line it would be like this:

Dim s as String =
"vbscript:vReturnValue=window.showModalDialog('sur l','document.all('somevalue')','sfeatures')

In debug you should see it cut off here:
vbscript:vReturnValue=window.showModalDialog('surl ','document.all(' --
When it hits this ' it thinks the string is done. To Fix this problem
enclose the vArguemtns with " double quotes. Like this:

Dim vArguments as String = "document.all(""" & cmdNew.ClientID & """)"

Good luck

jjardine
Mar 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gilles T. | last post by:
Hi! I have a popup window open with the showModalDialog function: window.showModalDialog('dialog.aspx',window,"status:no; resizable:yes; dialogWidth:900px; dialogHeight: 700px;"); and in...
2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
6
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
3
by: Paul K | last post by:
I'm not quite sure if the problem I'm having is a restriction of showModalDialog or if there is a way around it. The web app I am working requires the user to select a record from a list. I pop...
1
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm...
2
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files...
9
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" +...
1
by: elizayiu | last post by:
Hi, I need to write a webpage which does the following: - open up a window and pass parameters into it (i.e. need to call showModalDialog() or showModelessDialog()) - contains jscript to...
4
by: =?Utf-8?B?Sm9hbyBSZWdv?= | last post by:
Hello, Using asp.net 2.0, C# and IE7 I'm using window.showModalDialog to open a modal window on the client from Javascript. I have to include this line in the < HEAD html of the modal window:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.