Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Transfer.Server

Reply
Thread Tools

Transfer.Server

 
 
Gary Paquette
Guest
Posts: n/a
 
      01-30-2004
How to I launch a new browser window when using Transfer.Server (or with
Response.Redirect)?
Code goes from a linkButton to a function to validate and add parameters to
the POST.

I can do this from a hyperlink - using hyperlink.Target="_new" - but
hyperlinks cannot support the external function.

Help!
Gary


------------------------------------------
Gary Paquette



 
Reply With Quote
 
 
 
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      01-31-2004
Hi Gary,

Thanks for posting in the group. We are currently researching on this issue
and will update your ASAP.

If there is anything unclear, please feel free to post in the community and
we will follow up.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
 
 
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      02-02-2004

Hi Gary,

Thank you for posting in the community!

Based on my understanding, when you click a link, you want to postback to
server side(Do validation and pass parameters), which need LinkButton. But
you did not figure out a way to open the navigation page in a new browser
window.

==============================================
For your passing parameters for POST, which page you want to POST to? POST
to your server side or POST to the navigation page?

I suppose you want to POST the web form data to your server side. (If I
misunderstand you, please feel free to tell me)

Asp.Net only encapsulate the client HTML and javascript code, so you still
need client side support to open a new browser window.

You can try the following 2 Solutions to see if it helps resolve your issue:
1). Open your navigate window in <a>'s onclick client javascript

First, add client javascript function:
<script language=javascript>
function navigation()
{
window.open("http://www.google.com");
}
</script>

Then, Register <a>'s client onclick event handler:
private void Page_Load(object sender, System.EventArgs e)
{
LinkButton1.Attributes.Add("onclick","navigation() ");
}

2). Register client javascript code to open a new window in LinkButton's
Server side click event:

First, make <body> as server side control:
<body runat=server id="bodycontrol">

Then, register javascript in LinkButton's server click event:
private void LinkButton1_Click(object sender, System.EventArgs e)
{
StringBuilder sb=new StringBuilder();
sb.Append("<script language=javascript>");
sb.Append("function navigation()");
sb.Append("{\n");
sb.Append("window.open(\"http://www.google.com\");");
sb.Append("\n}");
sb.Append("</script>");

this.Page.RegisterClientScriptBlock("navigationscr ipt",sb.ToString());
bodycontrol.Attributes.Add("onload","navigation()" );
}

================================================
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Have a nice day!!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      02-04-2004

Hi Gary,

Does my reply make sense to you?

If you still have anything unclear, please feel free to tell me, I will
work with you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments