473,395 Members | 1,987 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,395 software developers and data experts.

Messagebox linked to link button

I was looking at Scott Mitchells article:
http://aspnet.4guysfromrolla.com/art...90402-1.2.aspx the tells how to
call a messagebox from a button and can almost get it to work but ran into 2
problems. You have to press the button twice to get it to work and I can't
figure out how to get an answer (OK or Cancel) from it.

Here is the onClick function:

sub Resume_Click(sender as Object, e as eventArgs)
btnResume.Attributes("onclick") = "javascript:return " & _
"confirm('Are you sure you want to delete FAQ #?')"
end sub

The linkbutton is:

Would you like to submit a <asp:LinkButton id="btnResume"
Text="Resume" onClick="Resume_Click" runat="server"/>&nbsp;?

What am I missing?

Thanks,

Tom
Nov 19 '05 #1
4 1536
Take the code out of the Resume_Click event and put it in the Page_Load
event.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"tshad" <ts**********@ftsolutions.com> wrote in message
news:um**************@TK2MSFTNGP14.phx.gbl...
I was looking at Scott Mitchells article:
http://aspnet.4guysfromrolla.com/art...90402-1.2.aspx the tells how to
call a messagebox from a button and can almost get it to work but ran into
2 problems. You have to press the button twice to get it to work and I
can't figure out how to get an answer (OK or Cancel) from it.

Here is the onClick function:

sub Resume_Click(sender as Object, e as eventArgs)
btnResume.Attributes("onclick") = "javascript:return " & _
"confirm('Are you sure you want to delete FAQ #?')"
end sub

The linkbutton is:

Would you like to submit a <asp:LinkButton id="btnResume"
Text="Resume" onClick="Resume_Click" runat="server"/>&nbsp;?

What am I missing?

Thanks,

Tom

Nov 19 '05 #2
> I was looking at Scott Mitchells article:
http://aspnet.4guysfromrolla.com/art...90402-1.2.aspx the tells
how to call a messagebox from a button and can almost get it to work
but ran into 2 problems. You have to press the button twice to get it
to work and I can't figure out how to get an answer (OK or Cancel)
from it.

Here is the onClick function:

sub Resume_Click(sender as Object, e as eventArgs)
btnResume.Attributes("onclick") = "javascript:return " & _
"confirm('Are you sure you want to delete FAQ #?')"
end sub
The linkbutton is:

Would you like to submit a <asp:LinkButton id="btnResume"
Text="Resume" onClick="Resume_Click" runat="server"/>&nbsp;?

What am I missing?

Thanks,

Tom


What you want to do is set the onclick attribute in the load or pre render.
Then handle the click action in the Resume_Click method (ie, in this case,
looks like you want to delete a faq entry, do it there).

Nov 19 '05 #3
"Ryan Trudelle-Schwarz" <ne**@mamanze.com> wrote in message
news:94*********************@news.microsoft.com...
I was looking at Scott Mitchells article:
http://aspnet.4guysfromrolla.com/art...90402-1.2.aspx the tells
how to call a messagebox from a button and can almost get it to work
but ran into 2 problems. You have to press the button twice to get it
to work and I can't figure out how to get an answer (OK or Cancel)
from it.

Here is the onClick function:

sub Resume_Click(sender as Object, e as eventArgs)
btnResume.Attributes("onclick") = "javascript:return " & _
"confirm('Are you sure you want to delete FAQ #?')"
end sub
The linkbutton is:

Would you like to submit a <asp:LinkButton id="btnResume"
Text="Resume" onClick="Resume_Click" runat="server"/>&nbsp;?

What am I missing?

Thanks,

Tom


What you want to do is set the onclick attribute in the load or pre
render. Then handle the click action in the Resume_Click method (ie, in
this case, looks like you want to delete a faq entry, do it there).


It works now.

I understand what Scott was doing now. You have to set it before the
routine is called. In my case, I was setting it in the routine I was
calling.

Actually, I wasn't deleting an faq entry, just using the button Scott set
up, just to get it to work.

Thanks,

Tom
Nov 19 '05 #4
BTW, here's more information and examples:
http://SteveOrr.net/Articles/ClientSideSuite.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:O7****************@TK2MSFTNGP11.phx.gbl...
Take the code out of the Resume_Click event and put it in the Page_Load
event.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"tshad" <ts**********@ftsolutions.com> wrote in message
news:um**************@TK2MSFTNGP14.phx.gbl...
I was looking at Scott Mitchells article:
http://aspnet.4guysfromrolla.com/art...90402-1.2.aspx the tells how to
call a messagebox from a button and can almost get it to work but ran into
2 problems. You have to press the button twice to get it to work and I
can't figure out how to get an answer (OK or Cancel) from it.

Here is the onClick function:

sub Resume_Click(sender as Object, e as eventArgs)
btnResume.Attributes("onclick") = "javascript:return " & _
"confirm('Are you sure you want to delete FAQ #?')"
end sub

The linkbutton is:

Would you like to submit a <asp:LinkButton id="btnResume"
Text="Resume" onClick="Resume_Click" runat="server"/>&nbsp;?

What am I missing?

Thanks,

Tom


Nov 19 '05 #5

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

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
12
by: Neil | last post by:
I previously posted re. this, but thought I'd try again with a summary of facts. I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that is linked to the database via ODBC...
5
by: Dream Catcher | last post by:
1. I don't know once the node is located, how to return that node. Should I return pointer to that node or should I return the struct of that node. 2. Also how to do the fn call in main for that...
8
by: Alfonso Esteban Gonzalez Sencion | last post by:
I am trying to use Access as a front end for extracting information from an Oracle database. I started using linked tables but I am getting a very curious behaviour. When I consult the linked...
10
by: Russ | last post by:
I've been trying to figure out how to show a simple messagebox with an OK button in my web client program (C#). I have looked at every reference to JScript and MessageBox that seemed even remotely...
3
by: VMI | last post by:
I know this isn't the best group to post aspnet question, but the MS asp.net NG hasn't been very helpful lately. I've been trying to add a messagebox following the examples I've seen on the web,...
3
by: sj | last post by:
I have written an application (CW.mde) with a seperate data (Data.mda) file. My Data tables are linked to CW. I want my user to be able to re-link the data.mda when they change location/path of...
3
by: Luis Alvarado | last post by:
Hello everybody, I am new programming in asp.net, recently I have been hired in a company and they were creating a simple application, this application is developed in asp.net 2 visual Studio 2005...
25
by: bubbles | last post by:
Using Access 2003 front-end, with SQL Server 2005 backend. I need to make the front-end application automatically refresh the linked SQL Server tables. New tables will be added dynamically in...
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:
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.