Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional Validation
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00895521
Message ID:
00897862
Views:
14
Hi Bill,

It sounds like you solved your problem but I just wanted to state that when I have problems figuring out the correct javascript syntax for hooking up a client-side function to an event, I use the code-behind approach. Then I "View Source" in the browser to see how the code was written to the page.

>Hi David,
>
>Yeah, hadn't thought of adding it in programmatically. I'll give that a try and see how it works.
>
>Many thanks,
>Bill
>
>>Try
>>
>>btnSubmit.Attributes.Add("onclick", "btnOnClick();")
>>
>>or in C# I think its
>>
>>btnSubmit["onclick"] = "btnOnClick();";
>>
>>This is for asp.net controls. HTML controls work as you would expect.
>>
>>>Hi Hector,
>>>
>>>Know how to find out how to do this? :-) When I try to implement the button's client side "OnClick" event, E.g.
>>>
<asp:button id="btnSubmit" OnClick="javascript:btnOnClick()" runat="server" Font-Size="X-Small" Font-Names="Arial" Text="Submit"></asp:button>
>>>ASP.NET squeals like a stuck pig.
>>>
>>>Bill
>>>
>>>>I *think* you could have each button call a different (client side) JavaScript function. Inside each function you'll do whatever validations you need and then call document.myform.submit to actually post the form the web server.
>>>>
>>>>I say "I think" because I have never done this, I've only seen/heard examples that mention this. Hope this helps.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform