/    Sign up×
Community /Pin to ProfileBookmark

JavaScript Popup

Hello,

I have Question about Javascript. I want to have a Popup box . I have a ASp.net web form where user enters the data in the text boxes and clicks on submit button. I want show a pop up message for the user after the code is saved in the Database . The message should be either “Data Saved” or”Not saved”.
When I tried popup box onclick() “Submit” button, but it just popsup immeditely after submit click. I want this message to popup only after the Data is Saved.

Are there any good choices I can use in this cse rather than popup box ?

Can some one help please?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@felgallJan 17.2008 — Either use Ajax to do the save so that the server can then return the response to display in the popup OR add the popup to the page called after the script has run.
Copy linkTweet thisAlerts:
@cgishackJan 17.2008 — Are you using ASP.NET AJAX or just posting back the same page again?

If your posting back to the same page you have to use something like

-->>> .NET CODE

Page.RegisterClientScriptBlock(........)


as for the Javascript code, you will be showing an alert box.

this can be done like so:
<i>
</i>&lt;script&gt;
alert("Your data was saved!");
&lt;/script&gt;


If you have further issues search the forum at www.asp.net. There are a lot of answers there.

Drew
×

Success!

Help @coding spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...