?
Solved

click Hyperlink show message box

Posted on 2006-06-13
8
Medium Priority
?
387 Views
Last Modified: 2006-11-18
Hello,

i would like to use Hyperlink when onclick go to Sub and show Message Box : Success (when execute all command in Sub)

please suggest me

thank you so much
0
Comment
Question by:sirimit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 16

Expert Comment

by:Edwin_C
ID: 16899062
If you need to execute a subroutine (assume server side), then you need a button control rather than a hyperlink.

You can use a linkbutton (which renders as hyperlink) and in its click event

mySubroutine()  'execute your subroutine
Response.Write("alert('Things are done!')")   'show your message box

Hope that helps
Edwin
0
 
LVL 16

Expert Comment

by:Edwin_C
ID: 16899474
Oops, it should be

Response.Write("<script>alert('Things are done!')</script>")   'show your message box

Sorry about forgetting the script tag!

0
 

Author Comment

by:sirimit
ID: 16899971
hello,

please show example for Hyperlink command

i would like to send some Var to Sub
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:Edwin_C
ID: 16900042
Is your "hyperlink" inside a datagrid or similar databound controls?  You say you want passing some parameters into the subroutine.  Where do the values of the parameters come from?  Some textboxes, a constant or else?
0
 

Author Comment

by:sirimit
ID: 16900116
Hello,

i used datagrid Parameter is : Container.DataItem("field") about 2-3 values
i would like send it toSubroutine and show in all row

Example (i need create link when click send Parameter(col1,col2) to Subroutine)
_________________________
col1 | col2 | col3 | col4 | link
_________________________
col1 | col2 | col3 | col4 | link
_________________________
col1 | col2 | col3 | col4 | link
_________________________
col1 | col2 | col3 | col4 | link
_________________________
0
 
LVL 16

Expert Comment

by:Edwin_C
ID: 16900298
Firstly add a ButtonColumn in your datagrid like this.

<asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False">
<Columns>
  <asp:BoundColumn DataField="col1"></asp:BoundColumn>
  <asp:BoundColumn DataField="col2"></asp:BoundColumn>
  <asp:BoundColumn DataField="col3"></asp:BoundColumn>
  <asp:BoundColumn DataField="col4"></asp:BoundColumn>
   <asp:ButtonColumn Text="Link" CommandName="doSub"></asp:ButtonColumn>
</Columns>
</asp:datagrid>

Then add a handler for the ItemCommand event

Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
        If e.CommandName = "doSub" Then
            doSubroutine(e.Item.Cells(0).Text, e.Item.Cells(1).Text)
        End If
End Sub
0
 
LVL 16

Accepted Solution

by:
Edwin_C earned 2000 total points
ID: 16900324
Oh I forgot you need a message popup.

Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
        If e.CommandName = "doSub" Then
            doSubroutine(e.Item.Cells(0).Text, e.Item.Cells(1).Text)
            Response.Write("<script>alert('Success')</script>")
        End If
End Sub
0
 

Author Comment

by:sirimit
ID: 16900411
thank you so much Edwin C :-)
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question