Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change datagrid value from popup

Status
Not open for further replies.

enochsfootwear

Programmer
Aug 11, 2004
25
US
Hi,

I need to be able to change the value of a link button in a datagrid from a different page. I have a datagrid that’s bound to a database on page 1, one of the controls is a link button, when the user clicks the link another page opens that changes the value of the link button using javascript. That works fine I can see the change but when I try to update the database the old value is still in the link button. Do I need to refresh the datagrid somehow?

Thanks
 
Hm, I don't know the ansver on YOUR question, but it seems that you know the ansver on MY question that I 've send in yesterday:

I know how to open a modal window, clicking on a button after I wrote (in Page_Load)
Button1.Attributes.Add("OnClick", "ShowDialog();");
//JAVAscript

But I can't find out how I could open a modal-edit-window when a user clicks on Edit in a DataGrid. How kan I use the DataGrid's EditCommand to open a edit-window? (pop-up)
 
I'm pretty new to ASP.net,but here's my script the opens the popup, I have in inside the onclick of the link button

popupScript = "<script language='javascript'>" & _
"window.open('mywindow.aspx' , 'PopUp', " & _
"'width=600, height=500, menubar=yes, resizable=yes, left=270,top=180')" & _
"</script>"

Page.RegisterStartupScript("PopupScript", popupScript)
 
Thanks enoch777, I'm a begynner as well!
You wrote: "I have it inside the onclick of the link button".
Where? In the HTML-part or in the C#-part. And how does it looks like?
 
I use VB but I guess it's close to C#, it's in the onClick in the code behind page

Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
Dim popupScript As String = "<script language='javascript'>" & _
"window.open('WEbform2.aspx', 'CustomPopUp', " & _
"'width=200, height=200, menubar=yes, resizable=yes')" & _
"</script>"

Page.RegisterStartupScript("PopupScript", popupScript)
End Sub

Hope that helps
 
Wow !!
It works! Thanks for your ansver.
Hope you get an OK reply on your question as well.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top