opening parametrized window in asp.net without post back-Help required!

K

Keshav Gadia

Hi,
I am an ASP.net newbie.
I am writing a user control that is made up of datagrid with one of
the columns opening a new window to display some details on click of
the set image.
I have basically used ImageButton server control.
The problem is because I have used a server control with
runat="server",the parent page is posted back and even though the
window opens up,the focus gets set to the parent window.
What I want is,the new window should open and the focus should remain
on that window and not the parent window.

I have tried writing javascript to deal with the situation but wasn't
able to achieve what I wanted.

The only thing that comes to my mind is to avoid posting back onclick.

The trouble there is the URL to be used for opening the window has
three parameters and their values come from the server side code.


Please could somebody suggest what can be done so that the focus stays
on the newly opened window.


Many thanks in advance.

Keshav
 
S

SevDer

Keshav said:
Hi,
I am an ASP.net newbie.
I am writing a user control that is made up of datagrid with one of
the columns opening a new window to display some details on click of
the set image.
I have basically used ImageButton server control.
The problem is because I have used a server control with
runat="server",the parent page is posted back and even though the
window opens up,the focus gets set to the parent window.
What I want is,the new window should open and the focus should remain
on that window and not the parent window.

I have tried writing javascript to deal with the situation but wasn't
able to achieve what I wanted.

The only thing that comes to my mind is to avoid posting back onclick.

The trouble there is the URL to be used for opening the window has
three parameters and their values come from the server side code.


Please could somebody suggest what can be done so that the focus stays
on the newly opened window.


Many thanks in advance.

Keshav
If you really want to use image, then you need a template column and in
this template column put your image in a hyperlink and in this hyperlink
you can put your target as _new and "ta taaaa". The bottom line is,
don't use server control if you don't want to have this case.
 
K

Keshav Gadia

SevDer said:
If you really want to use image, then you need a template column and in
this template column put your image in a hyperlink and in this hyperlink
you can put your target as _new and "ta taaaa". The bottom line is,
don't use server control if you don't want to have this case.

Hi Ahmet,

many thanks for you suggestion.It worked.
Basically,image Button does an autopost whereas an hyperlink doesn't
post to the server.Nice one!

Thanks again.

Cheers
Keshav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top