kdeutsch
asked on
Call a popup window after sql insert
As part of my Procedure I first insert data to a sql Db and then i want to popUp a small 100 by 100 window which just has a print window that opens , it prints goes away an they go onto the next task. THis worked good in 1.1 code but having trouble getting to work in 4.0 code. what am I doing wrong here.
sql = "Insert tblSRpEventData (intPersonnelId, intUnitSRPId, intQuestionId, bitAnswer, strData, strRemarks, dtDoc, dtLogged, strlogged) VALUES (" & PersId & ", " & UnitID & ", " & AQuesId & ", " _
& "" & Aanswer.SelectedValue & ", '" & Adata.Text & "', '" & ARemarks.Text & "', '" & ADtdate.Text & "', '" & Date.Today & "', '" & userlogon & "')"
insertUpdateDelete(sql)
Next
ClearAdminGrid()
My first method is to put a lable on the aspx page and call the label but nothing is happening.
lbljavascript.Text = "<script language=javascript>window.open('../Reports/SRPIssues.aspx?id=" & SSN & " '', 'width=1 height=1 top=1 left=1');</script>"
The second methis is to try to do with page controls but can't seem to get he systax correct.
Page.ClientScript.RegisterStartupScript("window.open('" + Request.ApplicationPath + "../Reports/SRpIsses.aspx?ID=" & SSN & " '" + 'Width=100,height=100');", True)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hmmm.. Maybe it is the + in window.open('" +... Change it for &
ClientScript.RegisterClien tScriptBlo ck(Me.[Get Type](), "open", "<script type='text/javascript'>win dow.open(' " & Request.ApplicationPath & "../Reports/SRpIsses.aspx? ID=" & SSN & "','Width=100,height=100') ;</script> ")
ClientScript.RegisterClien
ASKER
Hi,
Still get the same thing Invlid argument. The highlight starts at the
>window.open
and calls character 32
Still get the same thing Invlid argument. The highlight starts at the
>window.open
and calls character 32
Hi,
I am really confused because it is working fine on my side. Hmmm... it might not like the <script tags.. I removed them, maybe..
ClientScript.RegisterClien tScriptBlo ck(Me.[Get Type](), "open", "window.open('" & Request.ApplicationPath & "../Reports/SRpIsses.aspx? ID=" & SSN & "','Width=100,height=100') ;")
I am really confused because it is working fine on my side. Hmmm... it might not like the <script tags.. I removed them, maybe..
ClientScript.RegisterClien
Hi, You have to use this code after insert query is executed.
using System.Windows.Form;
MessageBox.Show("Record successfully added");
using System.Windows.Form;
MessageBox.Show("Record successfully added");
ASKER
BurnieP,
Do you have working in an update panel on your side. I have in an update panel, these things are a pain.
Do you have working in an update panel on your side. I have in an update panel, these things are a pain.
ASKER
samirbhogayta:
If I use form controls is messes up all my web page controls when I do this my code behind goes crazy with all kins os blue underlines.
If I use form controls is messes up all my web page controls when I do this my code behind goes crazy with all kins os blue underlines.
ASKER
hi,
Ok this works and calls the a javascript alert window after the insert .
ClientScript.RegisterStart upScript(M e.GetType( ), "ClientScript", "alert ('hello')", True)
Ok this works and calls the a javascript alert window after the insert .
ClientScript.RegisterStart
ASKER
hi,
Ok this is what I get for the link when it trys to open I get an javascript error on the bottom of the page in corner. if I put the link into my page it works fine, but what I see is missing and I guess I don't know if its a problem is the server name and http before this part.
'/ReadinessTracker/Reports /SRPIssues .aspx?
maybe that information fills in automatically.??
<script type='text/javascript' window.open('/ReadinessTra cker/Repor ts/SRPIssu es.aspx?ID =10','Widt h=100,heig ht=100');< /script><s cript type='text/javascript'>new Sys.WebForms.Menu({ element: 'mnuMaster', disappearAfter: 500, orientation: 'horizontal', tabIndex: 0, disabled: false });</script>
Ok this is what I get for the link when it trys to open I get an javascript error on the bottom of the page in corner. if I put the link into my page it works fine, but what I see is missing and I guess I don't know if its a problem is the server name and http before this part.
'/ReadinessTracker/Reports
maybe that information fills in automatically.??
<script type='text/javascript' window.open('/ReadinessTra
ASKER
Ok, the script works, to a point in that its not the script giving me the error, it has to do with my master page menu system and that I had misspelled link address.
ASKER
It gives me an error of invalid argument then says liine 53 character 32.
ClientScript.RegisterClien