Click here to Skip to main content
15,918,471 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to show alert on Button clcik event of btnAddRecord.
Currently i Have an HTML Button btnShowMessage that shows alert on button click, I need to perform clcik btnShowMessage while i click on btnAddRecord.

What I have tried:

I have no btnAddrecord.performclick() as it is and HTML Button, I tried runat="server" and No Luck.

Any help will be appreciated
Posted
Comments
F-ES Sitecore 16-Apr-18 11:13am    
A web page consists of client content and server content. What code do you want to run on the client and what on the server and in what order? You are using words like alert client side) and click events (server side) as if there was no difference between client and server code. I imagine a large part of your confusion is that you don't yet understand the asp.net page lifecycle.
SulfySul 16-Apr-18 11:50am    
So i cannot trigger a "Client Side" event with a "Server Side" Button?
Is there any way i can display a message (Like bootstrap alert) on top of the page?
other than msgbox("Record Added!") ?

Please Help
F-ES Sitecore 17-Apr-18 3:58am    
You can add javascript to the page that will trigger a client-side alert when the page is given to the browser, but that alert won't stop or interrupt the execution of the server-code, it isn't executed immediately but only when all of your server code has finished running and the browser is given the finished page.
SulfySul 17-Apr-18 5:58am    
Thank You Sir.
Can you help me with it?, How can i show alert when i click on button(Server Side)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900