tricky postback problem...

  • Thread starter Thread starter Shailya
  • Start date Start date
S

Shailya

We can try writing java script function which will change mouse pointr
to Hourglass of entire document.
Means we can write two functions

1)Change cursor to hourglass
2)change back to default.

Call this function before and after your third party call,

this avoides user to click on button
 
you should also add a timer to enable the button after a couple of seconds
to handle the case where the internet loses the postback this will allow the
user to try again.

-- bruce (sqlwork.com)
 
Thanks for the responses everyone! I would definitely like the user
to try and stay on the same page so I'm going to try to avoid the
progress page solution...

For the onchange event, my textbox and button is actually within a
user control and the user control is used in an aspx page. Therefore,
there is no Form for the textbox and button. Can someone tell me how
I can access the button from the user control page_load? for ex.)
"document.Form1.Button1.disabled =
true; "; would not work and "document.Button1.disabled =
true; "; does not work either.


Thanks!

Sharon
 
Assuming that the user control is rendering HTML and isn't some type of
applet or ActiveX component, you could view the page source to see what is
being rendered. Once you know the ID of the control you could use
document.getElementById(...). If no ID is rendered, you could probably get
away with document.getElementsByName(...)

For instance, if the control renders with id="processButton" you should be
able to use:
document.getElementById("processButton").disabled = true;


HTH
 
Thanks Dave.

I go into the properties of the textbox in the ascx page and the id is
called: "txtName"

so I go into the javascript code,

document.getElementById("txtName")

but the result is giving me a null value.

I've also tried using

var test = document.getElementsByName("txtName")
alert(test.value)

returns me a non-null value in test but the alert message is
'undefined' (even though there is some text inside the textbox)...

Am I missing something here?

Thanks!

Sharon
 
Well, judging from your original post, it sounds like you may be looking at
the wrong control to disable. Your original post said you wanted to disable
the button so you'll want to look for the ID of the button rather than the
text box.

Could you post more of the code for your page, particularly where you're
wiring up the event handler to your text box and how you're calling the
JavaScript? This will help for giving you guidance for how to proceed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top