Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:Button ID="btnUploadFiles" runat="server" OnClick="buttonSubmit_Click" Text="Update" />
- protected void buttonSubmit_Click(object sender, EventArgs e)
- { try{// update the database
- // change label text to tell the user update succeeded}
- catch(Exception ex){...}
- }
- protected void buttonSubmit_Click(object sender, EventArgs e)
- {
- try
- {
- // update the database
- // change label text to tell the user update succeeded
- label.Text = "Message";
- string js = "function hideLabel(){document.getElementById('" + label.ClientID + "').style.display = 'none'};setTimeout(hideLabel, 5000);"
- ClientScript.RegisterClientScriptBlock(this.GetType(), "test", js ,true);
- }
- catch(Exception ex){...}
- }
- <script type="text/javascript">
- function hideLabel()
- {
- // replace yourLabelID with <%=YourLabelID.ClientID%> if it's a .NET Label control
- document.getElementById('yourLabelID').style.display = 'none';
- }
- setTimeout('hideLabel()', 5000);
- </script>
- function hideLabel(label)
- {
- $(label).hide();
- }
- $(document).ready( function() {
- var label = $('#labelID');
- setTimer(function() { hideLabel(label); ),5000);
- });
Add Comment
Please, Sign In to add comment