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

Client-side script embedded in code behind

I have code which checks whether a datagrid is empty and if it is it shows a
panel on my page. If its not empty then Im using the server.transfer to go to
another page so as im able to use the items in an array list. My problem is
that I also have had to incorporate some Javascript to see whether the user
is ok with moving forward. Everything is fine and works apart from when the
user clicks cancel on the pop-up Internet Explorer window it stills lets them
move on. I need to be able to introduce something which keeps the user on the
same page if they click cancel.

Has anyone any idea how I can achieve this or if this is possible in my
circumstances.

private void checkdgSearchResults()
{
if(this.DataGrid1.Items.Count == 0)
{
this.pnlSearchAddresses.Visible = true;
}

else
{

ArrayList addresses;
addresses = (ArrayList) ViewState["Addresses"];
Context.Items["TransferAddresses"] = addresses;
string surname = this.Textbox7.Text;
Context.Items["test"] = surname;
Response.Write("<script language='JavaScript'>(window.confirm('The
search fee will now be deducted for the criteria entered. Do you wish to
continue?'));</script>");
Server.Transfer("ArrayListItemsDisplayed.aspx");

}
}
Jul 21 '05 #1
4 1417
Stephen,

Here a sample in VBNet language
You need of course to reference to your function in the page normally

\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///
A full description
http://msdn.microsoft.com/library/de...javascript.asp

I hope this helps a little bit?

Cor

Cor

"Stephen" <St*****@discussions.microsoft.com> schreef in bericht
news:B5**********************************@microsof t.com...
I have code which checks whether a datagrid is empty and if it is it shows
a
panel on my page. If its not empty then Im using the server.transfer to go
to
another page so as im able to use the items in an array list. My problem
is
that I also have had to incorporate some Javascript to see whether the
user
is ok with moving forward. Everything is fine and works apart from when
the
user clicks cancel on the pop-up Internet Explorer window it stills lets
them
move on. I need to be able to introduce something which keeps the user on
the
same page if they click cancel.

Has anyone any idea how I can achieve this or if this is possible in my
circumstances.

private void checkdgSearchResults()
{
if(this.DataGrid1.Items.Count == 0)
{
this.pnlSearchAddresses.Visible = true;
}

else
{

ArrayList addresses;
addresses = (ArrayList) ViewState["Addresses"];
Context.Items["TransferAddresses"] = addresses;
string surname = this.Textbox7.Text;
Context.Items["test"] = surname;
Response.Write("<script language='JavaScript'>(window.confirm('The
search fee will now be deducted for the criteria entered. Do you wish to
continue?'));</script>");
Server.Transfer("ArrayListItemsDisplayed.aspx");

}
}

Jul 21 '05 #2
no sorry this isn;t what im looking for as my problem is that im using the
server.transfer to take accross an arraylist as my first post outlines. You
see I want the server.transfer to kick in if the user clicks yes, however if
the user clicks no I need to be able to keep the user on the same page. Can
you help.

"Cor Ligthert" wrote:
Stephen,

Here a sample in VBNet language
You need of course to reference to your function in the page normally

\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///
A full description
http://msdn.microsoft.com/library/de...javascript.asp

I hope this helps a little bit?

Cor

Cor

"Stephen" <St*****@discussions.microsoft.com> schreef in bericht
news:B5**********************************@microsof t.com...
I have code which checks whether a datagrid is empty and if it is it shows
a
panel on my page. If its not empty then Im using the server.transfer to go
to
another page so as im able to use the items in an array list. My problem
is
that I also have had to incorporate some Javascript to see whether the
user
is ok with moving forward. Everything is fine and works apart from when
the
user clicks cancel on the pop-up Internet Explorer window it stills lets
them
move on. I need to be able to introduce something which keeps the user on
the
same page if they click cancel.

Has anyone any idea how I can achieve this or if this is possible in my
circumstances.

private void checkdgSearchResults()
{
if(this.DataGrid1.Items.Count == 0)
{
this.pnlSearchAddresses.Visible = true;
}

else
{

ArrayList addresses;
addresses = (ArrayList) ViewState["Addresses"];
Context.Items["TransferAddresses"] = addresses;
string surname = this.Textbox7.Text;
Context.Items["test"] = surname;
Response.Write("<script language='JavaScript'>(window.confirm('The
search fee will now be deducted for the criteria entered. Do you wish to
continue?'));</script>");
Server.Transfer("ArrayListItemsDisplayed.aspx");

}
}


Jul 21 '05 #3
Stephen,

You are mixing up now ServerSide and ClientSide, when you use a panel that
you make visible and hide in the same wat as a PopupWindow, the user does
not notice that you are doing things and are busy on the serverside.

In my opinion is that much easier to handle.

Cor

"Stephen" <St*****@discussions.microsoft.com>
no sorry this isn;t what im looking for as my problem is that im using the
server.transfer to take accross an arraylist as my first post outlines.
You
see I want the server.transfer to kick in if the user clicks yes, however
if
the user clicks no I need to be able to keep the user on the same page.
Can
you help.

"Cor Ligthert" wrote:
Stephen,

Here a sample in VBNet language
You need of course to reference to your function in the page normally

\\\
Dim str As String
str = "<script language=javascript>
{window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///
A full description
http://msdn.microsoft.com/library/de...javascript.asp

I hope this helps a little bit?

Cor

Cor

"Stephen" <St*****@discussions.microsoft.com> schreef in bericht
news:B5**********************************@microsof t.com...
>I have code which checks whether a datagrid is empty and if it is it
>shows
>a
> panel on my page. If its not empty then Im using the server.transfer to
> go
> to
> another page so as im able to use the items in an array list. My
> problem
> is
> that I also have had to incorporate some Javascript to see whether the
> user
> is ok with moving forward. Everything is fine and works apart from when
> the
> user clicks cancel on the pop-up Internet Explorer window it stills
> lets
> them
> move on. I need to be able to introduce something which keeps the user
> on
> the
> same page if they click cancel.
>
> Has anyone any idea how I can achieve this or if this is possible in my
> circumstances.
>
> private void checkdgSearchResults()
> {
> if(this.DataGrid1.Items.Count == 0)
> {
> this.pnlSearchAddresses.Visible = true;
> }
>
> else
> {
>
> ArrayList addresses;
> addresses = (ArrayList) ViewState["Addresses"];
> Context.Items["TransferAddresses"] = addresses;
> string surname = this.Textbox7.Text;
> Context.Items["test"] = surname;
> Response.Write("<script language='JavaScript'>(window.confirm('The
> search fee will now be deducted for the criteria entered. Do you wish
> to
> continue?'));</script>");
> Server.Transfer("ArrayListItemsDisplayed.aspx");
>
> }
> }


Jul 21 '05 #4
ok forgetting all of that ive been looking around and on different forums and
i'm coming to the conclusion that what I want to do isn't possible at present.

Basically i need the onclick of a button to bring up a Internet Explorer
MessageBox which asks the user if they want to continue. If the user clicks
yes I need the Server.Transfer to be used to direct the user to a different
page. If the user click cancel I need the user to simply return to the page
which they are already on.

I didn't think it would be difficult and its not when your simply directing
the user from page to page but when you need to user the server.transfer then
im snookered!! Any remaining thoughts about how I can achieve that,
forgetting the panels and validation etc

"Cor Ligthert" wrote:
Stephen,

You are mixing up now ServerSide and ClientSide, when you use a panel that
you make visible and hide in the same wat as a PopupWindow, the user does
not notice that you are doing things and are busy on the serverside.

In my opinion is that much easier to handle.

Cor

"Stephen" <St*****@discussions.microsoft.com>
no sorry this isn;t what im looking for as my problem is that im using the
server.transfer to take accross an arraylist as my first post outlines.
You
see I want the server.transfer to kick in if the user clicks yes, however
if
the user clicks no I need to be able to keep the user on the same page.
Can
you help.

"Cor Ligthert" wrote:
Stephen,

Here a sample in VBNet language
You need of course to reference to your function in the page normally

\\\
Dim str As String
str = "<script language=javascript>
{window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///
A full description
http://msdn.microsoft.com/library/de...javascript.asp

I hope this helps a little bit?

Cor

Cor

"Stephen" <St*****@discussions.microsoft.com> schreef in bericht
news:B5**********************************@microsof t.com...
>I have code which checks whether a datagrid is empty and if it is it
>shows
>a
> panel on my page. If its not empty then Im using the server.transfer to
> go
> to
> another page so as im able to use the items in an array list. My
> problem
> is
> that I also have had to incorporate some Javascript to see whether the
> user
> is ok with moving forward. Everything is fine and works apart from when
> the
> user clicks cancel on the pop-up Internet Explorer window it stills
> lets
> them
> move on. I need to be able to introduce something which keeps the user
> on
> the
> same page if they click cancel.
>
> Has anyone any idea how I can achieve this or if this is possible in my
> circumstances.
>
> private void checkdgSearchResults()
> {
> if(this.DataGrid1.Items.Count == 0)
> {
> this.pnlSearchAddresses.Visible = true;
> }
>
> else
> {
>
> ArrayList addresses;
> addresses = (ArrayList) ViewState["Addresses"];
> Context.Items["TransferAddresses"] = addresses;
> string surname = this.Textbox7.Text;
> Context.Items["test"] = surname;
> Response.Write("<script language='JavaScript'>(window.confirm('The
> search fee will now be deducted for the criteria entered. Do you wish
> to
> continue?'));</script>");
> Server.Transfer("ArrayListItemsDisplayed.aspx");
>
> }
> }


Jul 21 '05 #5

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

Similar topics

1
by: ian maclure | last post by:
I'm writing a client-server app. Client controls Server which in turn configures and controls a bunch of hardware. I want to be able to start the server from my client. Now in C/C++ one could...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
2
by: Raquel | last post by:
How do I know whether the 'runtime client' and the 'application development client' are installed on my machine? When I issue the command "db2licm -l", it gives the following output: Product...
5
by: Paul H | last post by:
How do you folks get a reliable and complete brief of what is required before development starts? I am forever going back to a client once a project has started saying "Hang on, now that I've...
0
by: netgeni59 | last post by:
Hello fellow C# friends, I am trying to write a C# TCP client that was formerly written in Java. The server must still remain in Java. I cannot get text data from the C# client to be received...
1
by: luciano | last post by:
Hi everyone, I want to create a application and a webservice, application connect to web service to activate, web sevice will create a certificate to authenticate this client, for each...
2
by: J Huntley Palmer | last post by:
I am having a horrific time integrating uw-imap's c-client for imap support in php. The problem is a whole bunch of "Text relocation remains referenced against symbol" errors during linking....
2
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
2
by: nsaffary | last post by:
hi I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
4
MMcCarthy
by: MMcCarthy | last post by:
http://bytes.com/images/howtos/projectscope_blocks.jpgAs a freelance IT consultant for over 10 years, I’ve come to appreciate well defined project scopes. A project scope is a common understanding...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.