Solved

Modal Pop from Code

Posted on 2014-11-27
3
708 Views
Last Modified: 2014-12-01
I have a bootstrap modal popup which is called by data-target="#modalAddIVSubmission"

   <asp:LinkButton ID="LinkButton1" runat="server" data-toggle="modal" data-target="#modalAddIVSubmission" CausesValidation="False" CommandName="Select" Text="View"></asp:LinkButton>

Open in new window



I want to get this to pop from code but cannot get it to work.

Can anyone suggest how I get it to pop in asp.net VB code via a selected change event?

I have tried

    Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView1.SelectedIndexChanged
        modalAddIVSubmission.show()
    End Sub

Open in new window



but this does not work.   Help please!

Thanks
0
Comment
Question by:edjones1
3 Comments
 
LVL 9

Expert Comment

by:teebon
ID: 40470047
Hi edjones1,

Can you share the codes of your control "modalAddIVSubmission"?
0
 
LVL 19

Accepted Solution

by:
Manoj Patil earned 500 total points
ID: 40470791
Hi check these links.
 
http://www.aspsnippets.com/Articles/Open-Show-jQuery-UI-Dialog-Popup-Window-from-Server-Side-Code-Behind-in-ASPNet.aspx

http://www.aspdotnet-suresh.com/2014/05/show-jquery-modal-popup-from-code-behind-server-side.html

Add below code to display it

Protected Sub btnShowModal_Click(ByVal sender As Object, ByVal e As EventArgs)
ScriptManager.RegisterStartupScript(Me, [GetType](), "Show Modal Popup", "showmodalpopup();", True)
End Sub

Open in new window

0
 

Author Closing Comment

by:edjones1
ID: 40473235
WorksPerfectly, thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding bootstrap to only Content page and NOT master page 1 50
"Emulate" TAB key when press Enter Key 3 48
ASP.NET (VB) return a record 2 38
VS 2017 18 53
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 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