Can I call two functions from an onclick event?

                                    <asp:Button ID="btnStudentInfoUpdate" runat="server"
                                       onclick = "btnStudentInfoUpdate_Click" Text="Update" 
                                        ToolTip="Only allows updates to the Music Teacher and the Comments fields" 
                                        Width="94px" />

Open in new window


I'm trying to do somehting like this:
onclick = "btnStudentInfoUpdate_Click;_highlightTextbox()" Text="Update"

The btnStudentInfoUpdate_Click is a function in my code behind and the _highlightTextBox() is a javascript function.

When I run this I get this error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1026: ) expected

Source Error:

 

Line 576:                                <td align="right" style="background-color: #BED2EA;" class="style81">
Line 577:                                    <br />
Line 578:                                    <asp:Button ID="btnStudentInfoUpdate" runat="server"
Line 579:                                       onclick = "btnStudentInfoUpdate_Click;_HighlightTextBox()" Text="Update"
Line 580:                                        ToolTip="Only allows updates to the Music Teacher and the Comments fields"
 
JosephNBurtonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jjardineCommented:
I don't think this is going to work.  If you are trying to call the client side code after the server call, in the server call, add a Registerclientscript  call to run the script when the page re-loads.
0
HonorGodSoftware EngineerCommented:
Can you call the _HighlightTextBox() routine, and then the submit?
0
Abirami RajendranCommented:
Call the javascript function _HighlightTextBox() using OnClientClick attribute of the button.
 
<asp:Button ID="btnStudentInfoUpdate" runat="server"
onclick = "btnStudentInfoUpdate_Click" onclientclick = "_HighlightTextBox" Text="Update" 
ToolTip="Only allows updates to the Music Teacher and the Comments fields" 
Width="94px" />

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JosephNBurtonAuthor Commented:
@HonorGod

That didn't work.

@sansoftura:
I tried that at first and it works, but when it goes through the Page_Load function again it unhighlights the textbox.
0
JosephNBurtonAuthor Commented:
I have reacted too soon. I need to object to my own cancellation. I need to reward the points to sansoftura
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.