Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Javascript confirm from code behind

Status
Not open for further replies.

tshad

Programmer
Jul 15, 2004
386
US
I am trying to run a page that will get data from a database.

On return, based on what was returned, I want to be able to call "return confirm()" that will allow the user to select "Yes" to execute the page again and run the Object Data Source again or "No" to just use the page as is.

I can't attach it to a button as there is no button push.

I can use the RegisterStartupScript to execute it, but how do I respond or not respond to it after the user makes the selection?

Thanks,

Tom
 
There are several things that don't make sense, so I'm going to need some clarity.

You want the user to select "Yes" Is this a radio button? An Alert? A Button?
"Run the object data source" Do you want to re-bind/refresh the contents of whatever is holding your data?
Just because you don't want the user to click the button doesn't negate the need for a button.

No Text, so the user can't click anything:
<asp:LinkButton runat="server" CssClass="secretStealthlyClickLinkClass" ID="btnCancel"
OnClick="btnCancel_Clicked" />

Is the first action you want to prompt the user with really "Do you want to refresh?"

Lodlaiden

You've got questions and source code. We want both!
Oh? That? That's not an important password. - IT Security Admin (pw on whiteboard)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top