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

Call two script block's

Hi,

Can I call two script blocks for different languages in my ASP.NET code?

I have a button than when clicked it must open a popup window to return some
values for two other controls that I have in my page. This is no problem.
The problem is that depending of return value I must fill a DropDownList
with different values.

For that I was trying to do this:

****************************BEGIN CODE************************************
Function Test() As Boolean
lblMsg.Text = "Test"
Return True
End Function

Private Sub ibtnVldHrr_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ibtnVldHrr.Click
//This is the block that calls a popup that the returns values
that I need

sbScript.Append(Environment.NewLine)
sbScript.Append("<script language='javascript'>")
sbScript.Append(Environment.NewLine)
sbScript.Append("pickSearch('" & strUrl &
"','lblIdHrr','edHorario','lblDsHorario');")
sbScript.Append(Environment.NewLine)
sbScript.Append("</script>")
RegisterStartupScript("OpenTp", sbScript.ToString())

//This is the block where I want to call a function to fill my
DropDownList
//note that script is runat=server

sbScriptVB.Append("<script Language='VB' runat='Server'>")
sbScriptVB.Append(Environment.NewLine)
sbScriptVB.Append("Dim x As Boolean = Teste()")
sbScriptVB.Append(Environment.NewLine)
sbScriptVB.Append("</script>")
RegisterStartupScript("OpenVB", sbScriptVB.ToString())
End Sub

****************************END CODE************************************

Can anyone help me? Or any sugestions to do something like this?
Thank's a lot
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 19 '05 #1
6 1373
Hi ruca:

I wouldn't open two popup windows simaltaneously like this - I think
it would just confused and/or annoy the user.

Perhaps what you could build is a wizard like navigation that guides
the users through Step 1 .. N, building controls and asking questions
on each page of the wizard.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 28 Apr 2005 17:03:27 +0100, "ruca" <ru***@iol.pt> wrote:
Hi,

Can I call two script blocks for different languages in my ASP.NET code?

I have a button than when clicked it must open a popup window to return some
values for two other controls that I have in my page. This is no problem.
The problem is that depending of return value I must fill a DropDownList
with different values.

For that I was trying to do this:

****************************BEGIN CODE************************************
Function Test() As Boolean
lblMsg.Text = "Test"
Return True
End Function

Private Sub ibtnVldHrr_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ibtnVldHrr.Click
//This is the block that calls a popup that the returns values
that I need

sbScript.Append(Environment.NewLine)
sbScript.Append("<script language='javascript'>")
sbScript.Append(Environment.NewLine)
sbScript.Append("pickSearch('" & strUrl &
"','lblIdHrr','edHorario','lblDsHorario');")
sbScript.Append(Environment.NewLine)
sbScript.Append("</script>")
RegisterStartupScript("OpenTp", sbScript.ToString())

//This is the block where I want to call a function to fill my
DropDownList
//note that script is runat=server

sbScriptVB.Append("<script Language='VB' runat='Server'>")
sbScriptVB.Append(Environment.NewLine)
sbScriptVB.Append("Dim x As Boolean = Teste()")
sbScriptVB.Append(Environment.NewLine)
sbScriptVB.Append("</script>")
RegisterStartupScript("OpenVB", sbScriptVB.ToString())
End Sub

****************************END CODE************************************

Can anyone help me? Or any sugestions to do something like this?
Thank's a lot


Nov 19 '05 #2
Hi Scott,

You miss understood the question. I don't want to open two popup windows.
I want to open one popup window that will retrieve a value for my main Web
Form, then what I want is to run a VB function (of main window) when popup's
close. I want this because depending of returned value I must fill a
DropDownList with different values.

Thank's anyway.

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Scott Allen" <sc***@nospam.odetocode.com> escreveu na mensagem
news:qq********************************@4ax.com...
Hi ruca:

I wouldn't open two popup windows simaltaneously like this - I think
it would just confused and/or annoy the user.

Perhaps what you could build is a wizard like navigation that guides
the users through Step 1 .. N, building controls and asking questions
on each page of the wizard.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 28 Apr 2005 17:03:27 +0100, "ruca" <ru***@iol.pt> wrote:
Hi,

Can I call two script blocks for different languages in my ASP.NET code?

I have a button than when clicked it must open a popup window to return
some
values for two other controls that I have in my page. This is no problem.
The problem is that depending of return value I must fill a DropDownList
with different values.

For that I was trying to do this:

****************************BEGIN CODE************************************
Function Test() As Boolean
lblMsg.Text = "Test"
Return True
End Function

Private Sub ibtnVldHrr_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ibtnVldHrr.Click
//This is the block that calls a popup that the returns values
that I need

sbScript.Append(Environment.NewLine)
sbScript.Append("<script language='javascript'>")
sbScript.Append(Environment.NewLine)
sbScript.Append("pickSearch('" & strUrl &
"','lblIdHrr','edHorario','lblDsHorario');")
sbScript.Append(Environment.NewLine)
sbScript.Append("</script>")
RegisterStartupScript("OpenTp", sbScript.ToString())

//This is the block where I want to call a function to fill my
DropDownList
//note that script is runat=server

sbScriptVB.Append("<script Language='VB' runat='Server'>")
sbScriptVB.Append(Environment.NewLine)
sbScriptVB.Append("Dim x As Boolean = Teste()")
sbScriptVB.Append(Environment.NewLine)
sbScriptVB.Append("</script>")
RegisterStartupScript("OpenVB", sbScriptVB.ToString())
End Sub

****************************END CODE************************************

Can anyone help me? Or any sugestions to do something like this?
Thank's a lot

Nov 19 '05 #3
Ruca,

I saw this yesterday already, however Scott answered you already.

My question (and I assume not alone from me) to you is why should that be
JavaScript and VBScript and why not just two separated JavaScript functions?

Cor
Nov 19 '05 #4
I apologize, ruca.

Instead of a popup - could you use a Panel control on the web form?
The panel control could have the Visible property set False until you
need input from the user. At the time you need input the panel could
appear visible, and then post back to the webform when the user clicks
a button or fiddles with some other type of input control.

Since all the logic will be inside of a single form it will make for
an easier effort.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 29 Apr 2005 11:06:50 +0100, "ruca" <ru***@iol.pt> wrote:
Hi Scott,

You miss understood the question. I don't want to open two popup windows.
I want to open one popup window that will retrieve a value for my main Web
Form, then what I want is to run a VB function (of main window) when popup's
close. I want this because depending of returned value I must fill a
DropDownList with different values.

Thank's anyway.


Nov 19 '05 #5
Hi Cor,

because, like I said before, I must call a function that is present in vb
code that will fill a dropdownlist with data.
Can I call a VB function in javascript?

Like I said before too, I accept sugestions...
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

"Cor Ligthert" <no************@planet.nl> escreveu na mensagem
news:uU**************@TK2MSFTNGP09.phx.gbl...
Ruca,

I saw this yesterday already, however Scott answered you already.

My question (and I assume not alone from me) to you is why should that be
JavaScript and VBScript and why not just two separated JavaScript
functions?

Cor

Nov 19 '05 #6
Ruca,
Can I call a VB function in javascript?


I have never used client side VBScript and therefore as well not mixed up,
however why do you not try it?

Cor
Nov 19 '05 #7

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

Similar topics

4
by: Jack | last post by:
Hello, <%@ Language=VBScript %> <% Response.Write "<form name=form1>" Response.Write "<SELECT id=select1 name=select1>" Response.Write "<OPTION value=1>One</OPTION>" Response.Write "<OPTION...
9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
6
by: ruca | last post by:
Hi, Can I call two script blocks for different languages in my ASP.NET code? I have a button than when clicked it must open a popup window to return some values for two other controls that I...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
11
by: rgintexas | last post by:
i'm trying to get server side vbscript to execute in firefox: </script> <script type="text/VBScript" src="VBFile.vbs"> </script> is there any way i can use javascript to call the vbs file, or...
17
by: PJ | last post by:
Greetings... I have stumbled upon a small problem. I use Ajax to retrieve part of a page I need to update. I update a DIV element with the HTML contents I get from another page. It works...
3
by: computer_guy | last post by:
Hi Everyone, I run into a problem. I am trying to write an aspx that can dynamically generate an image based on some input parameters. Things are very simple if the size of the parameters is...
5
by: plumba | last post by:
Ok, another query.... I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button. The problem I have is when the clear form button is...
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
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.