473,395 Members | 2,796 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,395 software developers and data experts.

How To pass the client response from a jscript prompt to vb.net

GRB
I'm using VB.Net 2003 to build a web page. I need to prompt the client for a
name in order to save a list. I used the following code to

btnSaveList.Attributes.Add("onclick", "var listname = prompt('You are about
to save the following list. \n\n', '" & cboMailLists.SelectedItem.Text &
"');if (listname) {" + Me.sListName + " = listname;}")

When i select the button I get an error and the buttons onclick="var
listname = prompt('You are about to save the following list. \n\n', 'Cheryls
Chain List');if (listname) { = listname;}"

is missing my vb.net variable Me.sListName.

How can I pass the value from the jscript prompt to my vb.net variable?

Any help would be appreciated.

Thanks
GRB
Nov 21 '05 #1
5 2102
GRB.

If I see it right, are you mixing up two things, what you set in the
attribute is a clientside script that knows nothing (except data) from the
serverside.

You have to write this completly in javascript. Where your control has of
couse an clientscript equivalent what you can see in the HTML part.

(I often look at the sourcecode that is created in the browswer).

I hope this helps,

Cor
Nov 21 '05 #2
GRB
Cor,

Thanks for the response.
2 things. I have to use vb.net 2003 and the page uses vb.net 2003 web form
controls.
I can send a value from a web form control to the promt.
I needed to use an HTML control to recieve the returned value, but when I
try to pass the result to a vb.net string variable, I get the following error.

Object reference not set to an instance of an object.

I see the value in the input textbox but cannot pass it to the vb.net
variable!!

I got all this to work!!

I cannot passing the value of this textbox to a variable the with vb.net
code page.

Here is the code.

on the aspx page in the header

function GetListName(strName)
{
var defaultstr = strName;
Form1.txtName.value = prompt('You are about to save the following Message
List.', defaultstr);
}

and on the aspx.vb page

dim sListName as String = txtName.Value

GRB
Nov 21 '05 #3
GRB,
I can send a value from a web form control to the promt.
I needed to use an HTML control to recieve the returned value, but when I
try to pass the result to a vb.net string variable, I get the following
error.

I have done somewhere the same trick, however with a serverside textbox and
cannot find it anymore. However, that is the one I know I can easily set the
data in at both sides

Cor
Nov 21 '05 #4
GRB
Cor,

Is there a way to use the java prompt that is compatible with VS.Net 2003?

Or is there another way to prompt the user for input when saving data from
the page in VS.Net 2003?

Gary
Nov 21 '05 #5
GRB.

Or is there another way to prompt the user for input when saving data from
the page in VS.Net 2003?

Not with a prompt, however when you put two panels on your page.
Set on one your normal page
Set on the other one just a textbox a label and a button, than you have
almost the same of course.

And make them visible when you need them.

I hope this helps,

Cor
Nov 21 '05 #6

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

Similar topics

6
by: Gram | last post by:
Hello, Can anyone tell me if ASP can pass an Array intp a Function? If so, can anyone point me to an example? Thanks in advance. Gram.
7
by: Dr John Stockton | last post by:
The following DOS prompt command line, in a Win98 DOS box, cscript //nologo ~tmp.js executes file ~tmp.js as javascript/Jscript. The following batch file, similarly run, executes the same....
35
by: Eitan | last post by:
Hello, How can I write a line (with carriage return + line feed) to the client ? response.write("abcd"), continue the last line, and doesn't put cr+lf. response.writeLn is illegal syntax... ...
1
by: Jon Maz | last post by:
Hi, I am trying to pass an array from an asp page (JScript) to a dotnet web service using the SOAP Toolkit 3.0. This is still at the Hello World stage, as you can see: WEB SERVICE METHOD ...
3
by: Chris | last post by:
I have a modal (yes it must be modal) web page. I do this by having an empty frame that points to my main page (so that I can repost without new popups) I have to pass data to the child page from...
3
by: Larry David | last post by:
Hi, I'm just trying to wrap my mind around the ASP.NET model. Let me walk you through a trivial scenario: Let's say I have a form containing a text box where the user enters his name. It also...
1
by: Andyza | last post by:
With reference to the ASPFAQ 2161 article - http://classicasp.aspfaq.com/general/how-do-i-prompt-a-save-as-dialog-for-an-accepted-mime-type.html Does the 'Content-Disposition' code work if the...
0
by: coachdave | last post by:
Hi all, I have been learning asp and html and javascript by bits and pieces. Specifically I want to send a short string from my asp page to be stored on a cookie on the client's computer. I have...
29
by: Kenzogio | last post by:
Hi, I have a struct "allmsg" and him member : unsigned char card_number; //16 allmsg.card_number
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.