current code: Response.Redirect("DeviceInformation.aspx?arg=" + e.CommandArgument); which redirects to a page with a data grid. The argument is passed into a stored proc on a database and the infor is returned in a grid.

What i want, is the same thing, but, open it in a new page.

So something like: Response.OpenNewDamnPage("DeviceInformation.aspx?arg=" + e.CommandArgument); but unfortunatly that does not exsist.

Thanks in advance for any help!

Recommended Answers

All 3 Replies

hi use window.open in ur script dont redirect that page. then it willopen a seperate window.

<script language="javascript" type="text/javascript">
        function btnWeek_onclick()
    {
          window.open("date.aspx");
    }
    </script>

<body>
<asp:Button ID="Button1" runat="server" OnClientClick ="return btnWeek_onclick()" Text="Button"  />
</body>

Let me know if u face any problem further

I currently have this code:

<asp:LinkButton  ID="Label3" CommandName = "AssetName" runat="server" CommandArgument='<%# Bind("AssetName") %>' Text='<%# Bind("AssetName") %>'></asp:LinkButton>

I could make this code as you suggest:

<asp:LinkButton  OnClientClick ="return btnWeek_onclick()" ID="Label3" CommandName = "AssetName" runat="server" CommandArgument='<%# Bind("AssetName") %>' Text='<%# Bind("AssetName") %>'></asp:LinkButton>

<script language="javascript" type="text/javascript">
        function btnWeek_onclick()
    {
          window.open("date.aspx");
    }
    </script>

but on the windows.open("date.aspx") line i need something like
windows.open("date.aspx?args=" + commandArgument");

becuase i need to create the dynamic qurey string... So i guess my question is how do i do this? and where do i put the javascript method?

Alright well someone on a differant thred suggested this:

Response.Write("<script type='text/javascript'>window.open('UsageInformation.aspx?arg=" + e.CommandArgument + "','_blank');</script>");

and this works... kinda. It opens a new windows with the correct url:

http://localhost:4513/WebSite2/UsageInformation.aspx?arg=XFM_UG:#306:100099462

But the datagrid does not load!
The data grid is connected to a sql data source that automatically gets the qurry string and runs a stored procedure with it and returns the rows into the grid.
Anything else on the page shows up, but it's like the datasource didn't get the string or something...

Thanks for any help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.