473,513 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

removing button1_onclick functions

Hi All,
Is there any way to execute a page object function without
going to the code behind.
Eg:
<asp:Button ID="Button1" runat="server" Text="Save Page"
OnClick="<%SQLDataSource1.Insert()%>" />
instead of
<asp:Button ID="Button1" runat="server" Text="Save Page"
OnClick="Button1_Click" />

protected void Button1_Click(object sender, EventArgs e)
{
SQLDataSource1.Insert();

}

Is there any eval metheod <%# % <%$ % etc.. to run the method in
the page.

thanks
slyi

Sep 22 '06 #1
2 2448
Don't think so.

An option might be to have the code in the markup file though, if you
want to avoid code-behind.

Mark

ad******@gmail.com wrote:
Hi All,
Is there any way to execute a page object function without
going to the code behind.
Eg:
<asp:Button ID="Button1" runat="server" Text="Save Page"
OnClick="<%SQLDataSource1.Insert()%>" />
instead of
<asp:Button ID="Button1" runat="server" Text="Save Page"
OnClick="Button1_Click" />

protected void Button1_Click(object sender, EventArgs e)
{
SQLDataSource1.Insert();

}

Is there any eval metheod <%# % <%$ % etc.. to run the method in
the page.

thanks
slyi
Sep 22 '06 #2
sure, use a script block;

<asp:Button ID="Button1"
runat="server"
Text="Save Page"
OnClick="Button1_Click" />
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
SQLDataSource1.Insert();
}
</script>

-- bruce (sqlwork.com)

<ad******@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Hi All,
Is there any way to execute a page object function without
going to the code behind.
Eg:
<asp:Button ID="Button1" runat="server" Text="Save Page"
OnClick="<%SQLDataSource1.Insert()%>" />
instead of
<asp:Button ID="Button1" runat="server" Text="Save Page"
OnClick="Button1_Click" />

protected void Button1_Click(object sender, EventArgs e)
{
SQLDataSource1.Insert();

}

Is there any eval metheod <%# % <%$ % etc.. to run the method in
the page.

thanks
slyi

Sep 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1937
by: John McGinty | last post by:
Hello Chaps, Just a little sounding on removing out of hours from some datetime date that I have. Basically we have a helpdesk that logs calls when they are entered and when they are resolved....
30
3439
by: Steven Bethard | last post by:
George Sakkis wrote: > "Steven Bethard" <steven.bethard@gmail.com> wrote: >> Dict comprehensions were recently rejected: >> http://www.python.org/peps/pep-0274.html >> The reason, of course,...
35
1254
by: Geronimo W. Christ Esq | last post by:
Are there any scripts or tools out there that could look recursively through a group of C/C++ source files, and allow unreferenced function calls or values to be easily identified ? LXR is handy...
3
2712
by: Amit | last post by:
Hi, I have a list of integers. At each iteration, I remove some element from it and then insert new elements in it. The order of elements is not important. So I guess I could use a vector also for...
11
2270
by: Steven D'Aprano | last post by:
Suppose I create a class with some methods: py> class C: .... def spam(self, x): .... print "spam " * x .... def ham(self, x): .... print "ham * %s" % x .......
23
1734
by: Peter Row | last post by:
Hi, I am currently working on a VB.NET project that has been going for quite a while. In the past it has been developed with a lot of compatibility VB6 functions and constants, e.g Left(),...
6
8617
by: bruce | last post by:
hi... i'm running into a problem where i'm seeing non-ascii chars in the parsing i'm doing. in looking through various docs, i can't find functions to remove/restrict strings to valid ascii...
2
2252
by: Daz | last post by:
Hi everyone. Is it possible to remove a script that has been added to a page? I have asked this question before, and was told that it was pretty much impossible to do, unless of course, I...
5
1799
by: gnassar | last post by:
Essentially my problem is that .NET 2005 is removing my event handlers. There's no real special things about my project, it just continually removes them all. It starts on the open of a...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.