New Web Form from a button

  • Thread starter Thread starter Peter Walburn
  • Start date Start date
P

Peter Walburn

Hello,

I have developed a web application in VB .Net and ahev
things working fairly well. I have buttons which redirect
the output to pther web pages. One of my buttons is to
bring up a report and I would like this report to appear
in a new page. Normally the web page simply changes to
display the new data.

I know that if I use a hyperlink, I can make the output
appear in a new web page. Can this be done with a button?

Thanks,

Pete
 
Hi Peter

I think that it is posible.

You can either use a

response.redirect to a new page in your aspx.vb code

or if you use an older page by instance asp you can use the attributes to a
piece of java like in this examples

TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"

(The only strange thing is that you cannot disable the autopostback from a
button but nobody sees that I think)

I hope this helps,

Cor




"> I have developed a web application in VB .Net and ahev
 
Yes - I put this in the Click event of my button in the codebehind - think
you can also put it into the html itself as the previous person mentioned)

Response.Write("<script
language=javascript>window.open('MyNewPage.aspx?ID=1','_new')</script>")
 
Hi Dan,

What I did show was not in HTML, that was direct in VB.net language, because
this is a VB.net language newsgroup and therefore I did give an answer in
VB.net language, but of course you can also put it in HTML direct.

That "attributes" you cannot use in HTML than it becomes normaly something
as onclick=etc.


Cor
 
Hi Peter,

Seeing the message from Dan, I see that there can maybe a misunderstanding

I did give you only the aspx.vb posibilities but there are more.

And because Dan wrote the response.write I show you the same with
response.redirect as he did.

Response.redirect('MyNewPage.aspx?ID=1')

But this is a little bit old asp style, that was the reason I did give it
also more in VB.net language using the server side control..

Posibilities
1. HTML button with changing the HTML code (normal page and poppup)
2. Aspx.vb net code with a redirect as shown above
3. Aspx.vb net code with adding HTML attributes to the server side button
control. (normal page and poppup)

I thought the code from Dan was killing the current page, if not this it is
than an alternative to make a poppup page.
Response.Write("<script
language=javascript>window.open('MyNewPage.aspx?ID=1','_new')</script>")


I hope this makes it more clear?

Cor
 
Back
Top