473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Call a function through a Button

Can anyone tell me how to call a function through a button in Page Language="C#" not vb ..
Please help .. I really need this
thanks
Jun 12 '07 #1
6 1366
TRScheel
638 Expert 512MB
Can anyone tell me how to call a function through a button in Page Language="C#" not vb ..
Please help .. I really need this
thanks

Attach the Button.OnClick event to the function in question
Jun 12 '07 #2
thanks but can you give an example ?
my Function is : updatefun
<input id="Button1" runat="server" type="button" onclick=updatefun()value="UPDATE"/>

isn't working .. i don't know how should the value be in ONCLICK
please help
Jun 12 '07 #3
TRScheel
638 Expert 512MB
thanks but can you give an example ?
my Function is : updatefun
<input id="Button1" runat="server" type="button" onclick=updatefun()value="UPDATE"/>

isn't working .. i don't know how should the value be in ONCLICK
please help

You need an asp control (I believe? I could be wrong) to call an c# function. That is going to call a javascript function. In addition, you are missing ' around the function name.

An example asp control would be
<asp:Button ... />
Jun 12 '07 #4
chinu
36
You need an asp control (I believe? I could be wrong) to call an c# function. That is going to call a javascript function. In addition, you are missing ' around the function name.

An example asp control would be
<asp:Button ... />
try this
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="onUpdateFn" /></div>
Jun 12 '07 #5
thanx.. but it really doesn't work
all i get is errors :S .. with .Net debugger :

Parser Error Message: Content ('</div>
</form>') does not match any properties within a 'System.Web.UI.WebControls.Button', make sure it is well-formed.

Source Error:


Line 36:
Line 37:
Line 38: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="onUpdateFn"></div>
Line 39: </form>
Line 40:

?? and ideas ?s
Jun 13 '07 #6
TRScheel
638 Expert 512MB
thanx.. but it really doesn't work
all i get is errors :S .. with .Net debugger :

Parser Error Message: Content ('</div>
</form>') does not match any properties within a 'System.Web.UI.WebControls.Button', make sure it is well-formed.

Source Error:


Line 36:
Line 37:
Line 38: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="onUpdateFn"></div>
Line 39: </form>
Line 40:

?? and ideas ?s
You need to close the button. Change the > at the end to a />.
Jun 13 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: cheezebeetle | last post by:
ok, so I am having problems passing in an ASPX function into the Javascript in the codebehind page. I am simply using a confirm call which when they press "OK" they call this ASPX function, when...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
3
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a...
5
by: Anand Ganesh | last post by:
Hi All, I need some help. I am sort of not sure how to approach this problem. I have a MAINPROGRAM. This is the core application. I have asked two of my staff to developed two different...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
3
by: msnews.microsoft.com | last post by:
Hi i am using User32.dll in Visual stdio 2005. public static extern long SetActiveWindow(long hwnd); public static extern long keybd_event(byte bVk, byte bScan, long dwFlags,
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
10
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.