473,386 Members | 1,799 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,386 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 1420
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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
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...

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.