[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

click Hyperlink show message box

Posted on 2006-06-13
8
Medium Priority
?
389 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

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.

Question has a verified solution.

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

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 …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

656 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