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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending values to a popup window

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I have been banging my head against the wall on this.

I want to set up a page with a DataGrid, and when the user clicks on a link button to edit a line, ANOTHER window pops up like a VB form to edit the information. Then on completion, the popup form passes the values back to the main window and updates the grid.

I got the DataGrid working, it's the popup window that's killing me. I'm working on Web Matrix while my VS.NET 2003 is on order.

I read that you can't use the form tag to pass values to another window anymore in ASP.NET.

Please help.
 
Almost there. All I need is how to open a new window that's smaller. How do I run javascript code????

Then I could use a window open command.
 
Dim s As String = &quot;<SCRIPT language='javascript'>alert('Hello')</SCRIPT>&quot;

RegisterStartupScript(&quot;test&quot;, s)

This would put an alert box up on the client side via javascript. Just remember that anything .NET does on the client side is just a function someone made sending java or another client side language to the client. Any client side actions must be done either through pre made functions or you sending javascript down to the client.

Opening a new window happens to be a case were you need to send down code.


That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Here is the code I was looking for. This is to help others. After you do the grid biding, you can use this code to open a popup window when the grid is clicked.


<form runat=&quot;server&quot;>
<asp:DataGrid id=&quot;dgCust&quot; runat=&quot;server&quot; PageSize=&quot;10&quot; AllowSorting=&quot;False&quot; AutoGenerateColumns=&quot;false&quot; CellPadding=&quot;3&quot; CellSpacing=&quot;0&quot; ShowFooter=&quot;false&quot; ShowHeader=&quot;true&quot; PagerStyle-Mode=&quot;NextPrev&quot; AllowPaging=&quot;true&quot; OnPageIndexChanged=&quot;DataGrid_Page&quot;>
<HeaderStyle horizontalalign=&quot;center&quot; backcolor=&quot;#E8EBFD&quot; forecolor=&quot;#3D3DB6&quot; font-name=&quot;Verdana, Arial, Helvetica, sans-serif&quot; font-bold=&quot;true&quot; font-size=&quot;smaller&quot; />
<ItemStyle backcolor=&quot;#F2F2F2&quot; font-name=&quot;Verdana, Arial, Helvetica, sans-serif&quot; font-size=&quot;smaller&quot; />
<AlternatingItemStyle backcolor=&quot;#E5E5E5&quot; font-name=&quot;Verdana, Arial, Helvetica, sans-serif&quot; font-size=&quot;smaller&quot; />
<FooterStyle horizontalalign=&quot;center&quot; backcolor=&quot;#E8EBFD&quot; forecolor=&quot;#3D3DB6&quot; font-name=&quot;Verdana, Arial, Helvetica, sans-serif&quot; font-bold=&quot;true&quot; font-size=&quot;smaller&quot; />
<PagerStyle backcolor=&quot;white&quot; font-name=&quot;Verdana, Arial, Helvetica, sans-serif&quot; font-size=&quot;smaller&quot; />
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField=&quot;SeqNo&quot; DataNavigateUrlFormatString=&quot;javascript:varwin=window.open('AgwayDetail_save.aspx?SeqNo={0}',null,'width=730,height=400,top=100,left=100,scrollbars=0');varwin.focus()&quot; DataTextField=&quot;SeqNo&quot; DataTextFormatString=&quot;Edit&quot; Visible=&quot;True&quot; HeaderText=&quot;Function&quot; SortExpression=&quot;SeqNo&quot; />
<asp:BoundColumn DataField=&quot;CustNo&quot; HeaderText=&quot;Customer Nbr&quot; ReadOnly=&quot;true&quot; Visible=&quot;True&quot; />
<asp:BoundColumn DataField=&quot;CustName1&quot; HeaderText=&quot;Customer Name&quot; ReadOnly=&quot;true&quot; Visible=&quot;True&quot; />
<asp:BoundColumn DataField=&quot;CustAddr1&quot; HeaderText=&quot;Customer Address&quot; ReadOnly=&quot;true&quot; Visible=&quot;True&quot; />
<asp:BoundColumn DataField=&quot;SeqNo&quot; HeaderText=&quot;SeqNo&quot; ReadOnly=&quot;true&quot; Visible=&quot;True&quot; />
</Columns>
</asp:DataGrid>
</form>


Notice this line:
DataNavigateUrlFormatString=&quot;javascript:varwin=window.open('AgwayDetail_save.aspx?SeqNo={0}',null,'width=730,height=400,top=100,left=100,scrollbars=0');varwin.focus()&quot; DataTextField=&quot;SeqNo&quot;

The SeqNo is my link, so I pass it thru the url line to a stored procedure on the detail end, and it opens a new window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top