Re: Messagebox linked to link button
From: tshad (tscheiderich_at_ftsolutions.com)
Date: 01/31/05
- Next message: Steve C. Orr [MVP, MCSD]: "Re: default home pages"
- Previous message: Carlos: "Re: default home pages"
- In reply to: Ryan Trudelle-Schwarz: "Re: Messagebox linked to link button"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 31 Jan 2005 14:13:01 -0800
"Ryan Trudelle-Schwarz" <news@mamanze.com> wrote in message
news:94916632427769256444208@news.microsoft.com...
>> I was looking at Scott Mitchells article:
>> http://aspnet.4guysfromrolla.com/articles/090402-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"/> ?
>>
>> 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
- Next message: Steve C. Orr [MVP, MCSD]: "Re: default home pages"
- Previous message: Carlos: "Re: default home pages"
- In reply to: Ryan Trudelle-Schwarz: "Re: Messagebox linked to link button"
- Messages sorted by: [ date ] [ thread ]