| | |
Displaying data in a Modal popup window in JavaScript
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2009
Posts: 28
Reputation:
Solved Threads: 0
Good Morning Friends
I'm using a modal popup using Javascript that this opening normally through the following syntax:
Then I want this window registry data are shown.I'm saving the ID in a Session, instead of passing it a parameter, although it should not be the reason for this.
In this modal popup, I put a break early on, however the system is running is not going through that page it commands present, commands are normal and another machine qualquer.My goal and get the ID and display the necessary data from it.
Would be the behavior in a modal popup window.
Thanks and a hug
I'm using a modal popup using Javascript that this opening normally through the following syntax:
ASP.NET Syntax (Toggle Plain Text)
jscript + = "<script language='javascript'>" jscript + = "window.showModalDialog ( 'DOCUMENTOS2.aspx','',' resizable = yes, menubar = no, scrollbars = no, width = 1850, height = 1650 ') "jscript + =" </ script> "ClientScript.RegisterClientScriptBlock (Me.GetType ()," client ", jscript)
Then I want this window registry data are shown.I'm saving the ID in a Session, instead of passing it a parameter, although it should not be the reason for this.
In this modal popup, I put a break early on, however the system is running is not going through that page it commands present, commands are normal and another machine qualquer.My goal and get the ID and display the necessary data from it.
Would be the behavior in a modal popup window.
Thanks and a hug
Last edited by peter_budo; Sep 27th, 2009 at 8:37 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
If you have save the ID in session, you can directly use it
but, just my suggestion, try to avoid using sessions. For this case, try to use query string
like this :
in modal form :
Thank
ASP.NET Syntax (Toggle Plain Text)
Dim SQL As String = "SELECT * FROM Trx WHERE ID = '" & Session("ID") & "'
but, just my suggestion, try to avoid using sessions. For this case, try to use query string
like this :
ASP.NET Syntax (Toggle Plain Text)
Dim jscript As String Dim ID As String = TextBox1.Text.Trim jscript = "<script language='javascript'>" jscript += "window.showModalDialog ('DOCUMENTOS2.aspx?ID=" & ID & "','',' resizable = yes, menubar = no, scrollbars = no, width = 1850, height = 1650 ') " jscript += " </ script> " ClientScript.RegisterClientScriptBlock(Me.GetType(), " client ", jscript)
in modal form :
ASP.NET Syntax (Toggle Plain Text)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ID As String="" ID = Request.QueryString("ID") If Not IsPostBack Then End If End Sub
Thank
NEVER NEVER NEVER GIVE UP
•
•
Join Date: Mar 2009
Posts: 28
Reputation:
Solved Threads: 0
Hello Friends
I still muddled with some things (that is with a lot of them). I have a Gridview, where the first column ia a TemplateField with a LinkButton to delete the record, the selected row.
I did the same routine using the primary key with DataKeyNames, however in this case the GridView, was populated manually and now I'm using curl.
I did the following:
Then I need to get the ID to be able to delete the desired record.
Thanks and a hug
I still muddled with some things (that is with a lot of them). I have a Gridview, where the first column ia a TemplateField with a LinkButton to delete the record, the selected row.
I did the same routine using the primary key with DataKeyNames, however in this case the GridView, was populated manually and now I'm using curl.
I did the following:
ASP.NET Syntax (Toggle Plain Text)
Protected Sub GrdDocumentos_RowDataBound (ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GrdDocumentos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim l As LinkButton = DirectCast (e.Row.FindControl ( "LinkButton1"), LinkButton) l.Attributes.Add ( "onclick", ( "javascript: return" & "confirm ( 'Really delete the Document") & DataBinder.Eval (e.Row.DataItem, "REL_DOCUMENTO") & "?')") End If End Sub
ASP.NET Syntax (Toggle Plain Text)
Private Sub GrdDocumentos_RowCommand (ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GrdDocumentos.RowCommand 'Can I exclude here in RowCommand If e.CommandName = "Delete" Then RelID GrdDocumentos.SelectedRow.Cells = (4). Text (does not work that way) 'GrdDocumentos.SelectedIndex = SelectedGridRow.RowIndex 'Delete the record 'Implement this on your own:) DeleteRecordByID (relID) End If End Sub
ASP.NET Syntax (Toggle Plain Text)
Private Sub DeleteRecordByID (ByVal RegID As Integer) Dim Sql As String Dim cmd As SqlCommand Dim connection As SqlConnection connection = New SqlConnection (ConfigurationManager.ConnectionStrings ( "Timesheet"). ConnectionString) Sql = "DELETE FROM REL_PROJETOS" Sql + = "WHERE REL_ID =" & RegID cmd = New SqlCommand (Sql, connection) Try conexao.Open () cmd.Connection = connection cmd.CommandType = CommandType.Text cmd.CommandText = Sql cmd.ExecuteNonQuery () Catch ex As Exception lblMensagem.Text = "Error Occurred While Deleting:" & vbCrLf & ex.Message & vbCrLf '& ex.InnerException.ToString Finally conexao.Close () GrdDocumentos.DataBind () End Try End Sub Protected Sub GrdDocumentos_SelectedIndexChanging (ByVal sender As Object, ByVal e As System.EventArgs) Handles GrdDocumentos.SelectedIndexChanged RelID = GrdDocumentos.SelectedRow.Cells (12). Text End Sub
Then I need to get the ID to be able to delete the desired record.
Thanks and a hug
•
•
Join Date: Mar 2009
Posts: 28
Reputation:
Solved Threads: 0
Thanks a lot my Friend your suggestion works perfectly but I have a problem not reviewed yet.
When the modal window and see the background screen with the data disappear and the screen is all gray (Gray and background color of the modal window).
With the window does not shift that does not happen and of course the modal window open, I need to view data in the background window, even though I can not access them due to the fact that the modal window is opened.
Thanks Again
When the modal window and see the background screen with the data disappear and the screen is all gray (Gray and background color of the modal window).
With the window does not shift that does not happen and of course the modal window open, I need to view data in the background window, even though I can not access them due to the fact that the modal window is opened.
Thanks Again
![]() |
Similar Threads
- Popup Window from parent window (JavaScript / DHTML / AJAX)
- popup window blues! (ASP.NET)
- popup window not working in javascript (JavaScript / DHTML / AJAX)
- Firing Ajax Modal Popup with javascript (JavaScript / DHTML / AJAX)
- About Popup Window (PHP)
- how to pass the value in popup window (PHP)
- Please help me with my javascript popup window! (ASP.NET)
- Javascript Popup Window (JavaScript / DHTML / AJAX)
- Popup window (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Details view in asp.net
- Next Thread: Change panel Size At Runtime
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol ajax alltypeofvideos anathor appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox commonfunctions complex dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv dialog dropdownlist dynamically edit editing expose feedback fileuploader fill flash form formatdecimal formview google gridview gudi iis image javascript list listbox login microsoft migration mouse mssql news numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows save schoolproject search security select session sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers





