开发者

How do I open a new window with POST data from a Gridview's onRowDataBound event, that must pass values from the other cells?

Okay the question is not exactly straightforward: let me explain.

I have a gridview, that I have hooked up to a datasource and all is peachy. I need to open a more detailed page for each row, so what would be the best way to do this? Currently I have something like this in the onRowDataBound function:

if (e.Row.RowType == DataControl开发者_运维问答RowType.DataRow)
    try
        e.Row.Cells[5].Text = "<input type='image' src='images/more.png' width='20' alt='More...' onClick='test(\"" + e.Row.Cells[1].Text + "\");' />";

The test function would take the parameter, plus use some values of some controls on the current page to cause a new window to open with data POSTed to it. Is this possible? Currently my test function doesn't do much:

function test() {
    var argv = test.arguments;
    window.open('Details.aspx', 'more', 'width=300,height=200,resizable=yes,toolbar=no');
}

I'd like it to open Details.aspx with argv data POSTed to it. Anyone?


There are two way to post data to server

1) Either put your data to url after "?" ( GET Request ) 2) Either Put data in body of your request ( POST/PUT/DELETE Request )

In your case you only have first one as your just opening a link in new page.

So just your data in the query string like

http://yourdomain.com?a=val_a&b=val_b

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜