473,394 Members | 1,759 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,394 software developers and data experts.

Getting data from javascript

Is it possible to grab data from a javascript prompt window that is called from within a webform page with C# as the behind code? I know how to activate the prompt window by calling a routine from an html button in my webform. But I want to be able to send the reply back to the server. In other words, is it possible to create a popup or prompt window that can send data to the server

Nov 18 '05 #1
2 1156
You can use JavaScript to populate a hidden form field in the page with data
that will then be available on the server with the next PostBack.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Dave" <an*******@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
Is it possible to grab data from a javascript prompt window that is called from within a webform page with C# as the behind code? I know how to
activate the prompt window by calling a routine from an html button in my
webform. But I want to be able to send the reply back to the server. In
other words, is it possible to create a popup or prompt window that can send
data to the server?

Nov 18 '05 #2
Jon
Hi,
you might be able to do something like this

if(window.confirm('are you sure you want to do this?')){
document.images['img'].src='Page.aspx?answer=yes';}
else{
document.images['img'].src='Page.aspx?answer=no';}

<img src="shim.gif" width=1 height=1 name="img">

Basically you're sending back either yes or no in the querystring to
Page.aspx without needing a server roundtrip.

Jon

"Dave" <an*******@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
Is it possible to grab data from a javascript prompt window that is called from within a webform page with C# as the behind code? I know how to
activate the prompt window by calling a routine from an html button in my
webform. But I want to be able to send the reply back to the server. In
other words, is it possible to create a popup or prompt window that can send
data to the server?

Nov 18 '05 #3

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

Similar topics

2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
4
by: Don W. | last post by:
Is it possible to open a browser window from a javascript for the purpose of gathering user input on a form and then use data from the form in the javascript? How do you get the data from the form...
4
by: Jean-Marie Delapierre | last post by:
Hi, I have two files in a directory. one called toto.txt with the following content : 1 2 3 4 5
18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
5
by: Matt Williamson | last post by:
I have a table that gets generated every 5 minutes containing the drive space on my servers. The table is sortable via an external javascript file by clicking the column headers (using sortable.js...
2
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
4
by: chippy | last post by:
I am finding that when I use the cloneNode method to copy an HTML element that contains a <script> tag, the contents of the <script> tag, (ie. the javascript) are removed. If I do this: var...
4
by: R.Manikandan | last post by:
Hi In my code, one string variable is subjected to contain more amount of characters. If it cross certain limit, the string content in the varabile is automatically getting truncated and i am...
10
by: eggie5 | last post by:
Is it possible to get a file without using a form post? I want to get the data (bytes) of a file, text or binary, and just save it to a variable. Similar to the post body of a form that has a...
5
by: Archana | last post by:
Hi all, I am having application where i am downloading xml content using webrequest. my code is as below HttpWebRequest lWebRequest = (HttpWebRequest) WebRequest.Create(URL); HttpWebResponse...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.