Thursday, March 22, 2012

open a new window inside datagrid passing querystring? need info

i started with <a href=''../email/email.aspx?email=<%# DataBinder.Eval(Container.DataItem, "username") %>'><img src="http://pics.10026.com/?src=images/email.jpg" border="0" height="20" width="20"></a>

and im kinda stumped on how to open a new window including the querystring.

Please let me know how thanks

Write a javascript string using window.open method, passing in the value:

<a href="http://links.10026.com/?link=javascript:window.open('../email/email.aspx?email=<%# .. %>', 'name', 'attributes')">Link</a>

http://www.javascript-2.com/window-open.html
http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html


<a href="http://links.10026.com/?link=javascript:window.open('../email/email.aspx?user=<%# DataBinder.Eval(Container.DataItem, "username") %>')"</a>

thanks for the reply. Now how do i fix the error with quotes differ?


anyone i havent figured it out.

That should do it.
<a href='../email/email.aspx?email=<%# DataBinder.Eval(Container.DataItem, "username") %>' target='_blank'><img src="http://pics.10026.com/?src=images/email.jpg" border="0" height="20" width="20"></a>


simple as that. thanks pal
one more thing how do i resize that window? width 200px
Look at the syntax for my post above, I believe it is the width=200px attribute in the attributes section.
im usingSonuKapoorsexample since the quotes differ for yours since the databinder required double quotes around my database column name, and so im bot using javascript window open('')

0 comments:

Post a Comment