473,394 Members | 1,971 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.

Calling server side code from teh client...

Trying to implement the following:

Users is logging in
They enter theire username and password and click a login button
The page should then display an activity indicator (animated gif) and then
call the server side routine that autheticates the user.
When the page comes back, the activity indicator disappears and any error
messages show up, or the user is taken to the application page if they were
authenticated.

Using an imagebuttom serv control I can accomplish all of it except making
the animated gif appear before postback.
If I use a regular image, I can call script in the client to make the
animated gif appear, but then how do I call the server side code to
authenticate the client? I tried using Form1.submit, but I don't know how
to catch that on the server side. Any thoughts are appreciated. Thanks.

Jerry
Nov 19 '05 #1
5 1730
Jerry Camel wrote:
Trying to implement the following:

Users is logging in
They enter theire username and password and click a login button
The page should then display an activity indicator (animated gif) and then
call the server side routine that autheticates the user.
When the page comes back, the activity indicator disappears and any error
messages show up, or the user is taken to the application page if they were
authenticated.

Using an imagebuttom serv control I can accomplish all of it except making
the animated gif appear before postback.
If I use a regular image, I can call script in the client to make the
animated gif appear, but then how do I call the server side code to
authenticate the client? I tried using Form1.submit, but I don't know how
to catch that on the server side. Any thoughts are appreciated. Thanks.

Jerry


I would investigate AJAX (Async javascript and Xml)
http://msdn.microsoft.com/library/de...SpicedAjax.asp
You would basically end up setting up a web service and doing everything
on the client.

You could also try looking using some kind of page hidden within an
IFRAME to make your post while you control the display on the main page.

--
Rob Schieber
Nov 19 '05 #2
Jerry,

I'm doing exactly that with the following code:

'---Preload the animated .gif
Page.RegisterStartupScript("PreLoad", "<script language=""javascript"">img1
= new Image();img1.src='Images/UI/loadgraphic.gif';</script>")
'---Attach the a javascript to the form's submit button that shows the gif
and still allows the button to submit.
SubmitButton.Attributes.Add("onclick", "document.all('" &
TotalLabel.ClientID & "').innerHTML = '<div align=""center"">Retrieving
Price<br><img src=""Images/UI/loadgraphic.gif""></div>';")

As long as the javascript doesn't have a "return false;" on the end the
button still submits.

Hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...
Trying to implement the following:

Users is logging in
They enter theire username and password and click a login button
The page should then display an activity indicator (animated gif) and then
call the server side routine that autheticates the user.
When the page comes back, the activity indicator disappears and any error
messages show up, or the user is taken to the application page if they
were
authenticated.

Using an imagebuttom serv control I can accomplish all of it except making
the animated gif appear before postback.
If I use a regular image, I can call script in the client to make the
animated gif appear, but then how do I call the server side code to
authenticate the client? I tried using Form1.submit, but I don't know how
to catch that on the server side. Any thoughts are appreciated. Thanks.

Jerry

Nov 19 '05 #3
What I ended up doing is having the image in place with a hidden style
attribute. Then responding to the onsubmit event of the form and adjusting
the style of the image to visible. The form then submits itself as it
normally would. It's incredibly simple.

Sub Form1_onsubmit
Form1.imgActivity.style.visibility="visible"
End Sub

Don't hate because I use vbscript... But this was all it needed. The
submit button itself doesn't change because submitting the form causes this
event to occure before the actual submit.
I still have one little isse in that the gif appears but doesn't seem to
animate. Which it does normally... Not sure if that's because the submit
is happening so quickly...

Thanks for your insight. Always appreciate when people respond...

Jerry

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:eE**************@TK2MSFTNGP12.phx.gbl...
Jerry,

I'm doing exactly that with the following code:

'---Preload the animated .gif
Page.RegisterStartupScript("PreLoad", "<script language=""javascript"">img1 = new Image();img1.src='Images/UI/loadgraphic.gif';</script>")
'---Attach the a javascript to the form's submit button that shows the gif
and still allows the button to submit.
SubmitButton.Attributes.Add("onclick", "document.all('" &
TotalLabel.ClientID & "').innerHTML = '<div align=""center"">Retrieving
Price<br><img src=""Images/UI/loadgraphic.gif""></div>';")

As long as the javascript doesn't have a "return false;" on the end the
button still submits.

Hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...
Trying to implement the following:

Users is logging in
They enter theire username and password and click a login button
The page should then display an activity indicator (animated gif) and then call the server side routine that autheticates the user.
When the page comes back, the activity indicator disappears and any error messages show up, or the user is taken to the application page if they
were
authenticated.

Using an imagebuttom serv control I can accomplish all of it except making the animated gif appear before postback.
If I use a regular image, I can call script in the client to make the
animated gif appear, but then how do I call the server side code to
authenticate the client? I tried using Form1.submit, but I don't know how to catch that on the server side. Any thoughts are appreciated. Thanks.
Jerry


Nov 19 '05 #4
animated gifs generally will not run during a postback. sites where you see
this work are generally polling (using a refresh), so the gif runs between
polls.

-- bruce (sqlwork.com)

"Jerry Camel" <rl*****@msn.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
What I ended up doing is having the image in place with a hidden style
attribute. Then responding to the onsubmit event of the form and
adjusting
the style of the image to visible. The form then submits itself as it
normally would. It's incredibly simple.

Sub Form1_onsubmit
Form1.imgActivity.style.visibility="visible"
End Sub

Don't hate because I use vbscript... But this was all it needed. The
submit button itself doesn't change because submitting the form causes
this
event to occure before the actual submit.
I still have one little isse in that the gif appears but doesn't seem to
animate. Which it does normally... Not sure if that's because the submit
is happening so quickly...

Thanks for your insight. Always appreciate when people respond...

Jerry

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:eE**************@TK2MSFTNGP12.phx.gbl...
Jerry,

I'm doing exactly that with the following code:

'---Preload the animated .gif
Page.RegisterStartupScript("PreLoad", "<script

language=""javascript"">img1
= new Image();img1.src='Images/UI/loadgraphic.gif';</script>")
'---Attach the a javascript to the form's submit button that shows the
gif
and still allows the button to submit.
SubmitButton.Attributes.Add("onclick", "document.all('" &
TotalLabel.ClientID & "').innerHTML = '<div align=""center"">Retrieving
Price<br><img src=""Images/UI/loadgraphic.gif""></div>';")

As long as the javascript doesn't have a "return false;" on the end the
button still submits.

Hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...
> Trying to implement the following:
>
> Users is logging in
> They enter theire username and password and click a login button
> The page should then display an activity indicator (animated gif) and then > call the server side routine that autheticates the user.
> When the page comes back, the activity indicator disappears and any error > messages show up, or the user is taken to the application page if they
> were
> authenticated.
>
> Using an imagebuttom serv control I can accomplish all of it except making > the animated gif appear before postback.
> If I use a regular image, I can call script in the client to make the
> animated gif appear, but then how do I call the server side code to
> authenticate the client? I tried using Form1.submit, but I don't know how > to catch that on the server side. Any thoughts are appreciated. Thanks. >
> Jerry
>
>



Nov 19 '05 #5
That sucks... But thanks for the clarification.

Jerry

"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
animated gifs generally will not run during a postback. sites where you see this work are generally polling (using a refresh), so the gif runs between
polls.

-- bruce (sqlwork.com)

"Jerry Camel" <rl*****@msn.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
What I ended up doing is having the image in place with a hidden style
attribute. Then responding to the onsubmit event of the form and
adjusting
the style of the image to visible. The form then submits itself as it
normally would. It's incredibly simple.

Sub Form1_onsubmit
Form1.imgActivity.style.visibility="visible"
End Sub

Don't hate because I use vbscript... But this was all it needed. The
submit button itself doesn't change because submitting the form causes
this
event to occure before the actual submit.
I still have one little isse in that the gif appears but doesn't seem to
animate. Which it does normally... Not sure if that's because the submit is happening so quickly...

Thanks for your insight. Always appreciate when people respond...

Jerry

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:eE**************@TK2MSFTNGP12.phx.gbl...
Jerry,

I'm doing exactly that with the following code:

'---Preload the animated .gif
Page.RegisterStartupScript("PreLoad", "<script

language=""javascript"">img1
= new Image();img1.src='Images/UI/loadgraphic.gif';</script>")
'---Attach the a javascript to the form's submit button that shows the
gif
and still allows the button to submit.
SubmitButton.Attributes.Add("onclick", "document.all('" &
TotalLabel.ClientID & "').innerHTML = '<div align=""center"">Retrieving
Price<br><img src=""Images/UI/loadgraphic.gif""></div>';")

As long as the javascript doesn't have a "return false;" on the end the
button still submits.

Hope this helps.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Jerry Camel" <rl*****@msn.com> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...
> Trying to implement the following:
>
> Users is logging in
> They enter theire username and password and click a login button
> The page should then display an activity indicator (animated gif) and

then
> call the server side routine that autheticates the user.
> When the page comes back, the activity indicator disappears and any

error
> messages show up, or the user is taken to the application page if they > were
> authenticated.
>
> Using an imagebuttom serv control I can accomplish all of it except

making
> the animated gif appear before postback.
> If I use a regular image, I can call script in the client to make the
> animated gif appear, but then how do I call the server side code to
> authenticate the client? I tried using Form1.submit, but I don't
know how
> to catch that on the server side. Any thoughts are appreciated.

Thanks.
>
> Jerry
>
>



Nov 19 '05 #6

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

Similar topics

2
by: Øyvind Isaksen | last post by:
Hi! I have made a function calles "send()". When I click a button, I want the function to be prosessed. This is the code that I have made, but it dont work: <%function send()
5
by: Chris Anderson | last post by:
Hi All. I have an ASP page that has over 150 records listed. I would like to have an "Index" (A,B,C,D...) at the very top of the page. Once a letter is clicked, I need to: 1) Call a SQL string...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
3
by: David P. Donahue | last post by:
This is a 2-part question: 1) I have a web form with multiple ImageButtons on it. I'd like them all to do the same thing. Basically, in english-code, the function would be as follows: Set...
5
by: Krishna | last post by:
Hi all, Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull. Regards.., Krishna
1
by: J. Marcelo Barbieri | last post by:
a.. How to write server script to call a client side function written in JavaScript? a.. When using Validation controls, it uses a file named WebUIValidation.js. This file is sent to the client...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
3
by: Dustin II. | last post by:
Hi, I have an ASP.NET solution, and the ASPX page I have a form , I want to copy some of the data from that form to the clipboard, I am using the below script the script works fine when I use a...
7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
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...
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: 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:
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
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
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...

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.