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

Popup dialog page

Hello,

I have some codes under event ButtonSend_Click to check the user input
values. This check is complicated enough using different stored procedures.
Then according the result of the checks, I would like to display a popup
page in which the user can select "OK", "Cancel" etc.

Now I created a javascript function doDialog() in HTML page to open a popup
page. I would like to call this function from the code behind page. I
cannot use onclick event with ButtonSend because I have lots of checks to do
before calling doDialog() function and this function should be called only
under certain test results. Also, I have to carry as a parameter different
message texts depending on the test results to display on the popup page.

Thank you for your kind advice,

Kiyomi
Jan 3 '06 #1
2 1994
I'm not sure I understand you fully. It sounds like you have a Button
Control that causes a server-side Click event to happen. The event handler
performs some processing, and you want to add a JavaScript popup window to
the page afterwards. Am I following you so far?

The place where I lose you is where you talk about not using the Click event
handler to add the JavaScript to the page. The JavaScript to open the Popup
window would be added on the server side, and all of the information you
need to display in the popup window should be available at the end of your
event handler method. So, all you need to do is add the JavaScript to the
Page at the end of the event handler, using Page.RegisterStartupScript. What
is the problem?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Kiyomi" <k.*******@unesco.org> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
Hello,

I have some codes under event ButtonSend_Click to check the user input
values. This check is complicated enough using different stored
procedures.
Then according the result of the checks, I would like to display a popup
page in which the user can select "OK", "Cancel" etc.

Now I created a javascript function doDialog() in HTML page to open a
popup
page. I would like to call this function from the code behind page. I
cannot use onclick event with ButtonSend because I have lots of checks to
do
before calling doDialog() function and this function should be called only
under certain test results. Also, I have to carry as a parameter
different
message texts depending on the test results to display on the popup page.

Thank you for your kind advice,

Kiyomi

Jan 3 '06 #2
Thank you, Kevin, for your reply. I tried to look at the documation and
exmples for Page.RegisterStartupScript, but I don't think I really
understand how I can adapt it to my case.

I have the following code behinde page (all the checks are simplified) which
is perfectly working fine. What I would like to do is to replace the error
messages (lblError) with a popup page (popup.htm).

Would it be possible ?

Thank you,

Kiyomi

********************* vb *************************

Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.Click

CheckRules()

End Sub

Private Function CheckRules()

If txtInput.Text = "" Then

lblError.Text = "You must enter your age"

Return False

Exit Function

End If

If IsNumeric(txtInput.Text) Then

'do nothing

Else

lblError.Text = "The format is not correct"

Return False

Exit Function

End If

If Convert.ToInt16(txtInput.Text) < 20 Or
Convert.ToInt16(txtInput.Text) > 60 Then

lblError.Text = "Your age must between 20 and 60"

Return False

Exit Function

End If

lblConfirm.Text = "The information has been registered"

Return True

End Function

*************************** HTML **********************

<script>

function doDialog()

{

if (Form1.lblError.value != "" )

{ var x=showModalDialog('popup.htm', Form1.lblError.value,
'status:no;resizable:yes'); }

}

</script>

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I'm not sure I understand you fully. It sounds like you have a Button
Control that causes a server-side Click event to happen. The event handler
performs some processing, and you want to add a JavaScript popup window to
the page afterwards. Am I following you so far?

The place where I lose you is where you talk about not using the Click event handler to add the JavaScript to the page. The JavaScript to open the Popup window would be added on the server side, and all of the information you
need to display in the popup window should be available at the end of your
event handler method. So, all you need to do is add the JavaScript to the
Page at the end of the event handler, using Page.RegisterStartupScript. What is the problem?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Kiyomi" <k.*******@unesco.org> wrote in message
news:OF**************@TK2MSFTNGP10.phx.gbl...
Hello,

I have some codes under event ButtonSend_Click to check the user input
values. This check is complicated enough using different stored
procedures.
Then according the result of the checks, I would like to display a popup
page in which the user can select "OK", "Cancel" etc.

Now I created a javascript function doDialog() in HTML page to open a
popup
page. I would like to call this function from the code behind page. I
cannot use onclick event with ButtonSend because I have lots of checks to do
before calling doDialog() function and this function should be called only under certain test results. Also, I have to carry as a parameter
different
message texts depending on the test results to display on the popup page.
Thank you for your kind advice,

Kiyomi


Jan 5 '06 #3

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

Similar topics

2
by: Marco Antonio Montalvo Durán | last post by:
hi for example, I have a page 'register.aspx' and open a second page 'popup.aspx', what I want to do is to pass the control and values obtained in 'popup.aspx' to 'register.aspx', somebody...
4
by: SteveS | last post by:
Hello. This is a strange problem which does not make sense to me. I open a popup page with the following javascript code: function OpenDenyWindow(changeId) {...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
2
by: steggun | last post by:
How To: Popup Confirmation Dialog & Redirect in LinkButton_OnClick Hello All, I have a ASP.NET 2.0 (C#) web form with a LinkButton control. In the server-side code for the LinkButton_OnClick...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
5
by: knowdotnet | last post by:
Hi all, Which is the best way to return a value back to the web page from a pop up page? I have a asp.net web application which opens a popup page on a link button click. The Link button is...
1
by: Orit | last post by:
I have a question regarding usage of AJAX Control Toolkit's Popup Control Extender . I am using the Popup Control Extender to display a popup dialog ( panel ) from my asp.net page on click of a...
4
by: fran_j_diaz | last post by:
Hi, I have a page with an Ajax modal popup. I would like to know when my Modal popup is opened, my page still able to modify. Is it possible ? (I use Visual Studio 2005, c# )
3
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.