www.webdeveloper.com
Results 1 to 5 of 5

Thread: How can i display a new page

  1. #1
    Join Date
    Mar 2006
    Posts
    37

    Unhappy How can i display a new page

    Sir,

    I am doing my in-house project.i want to know that, how can i display a new page while clicking a button say (WebForm1.aspx.cs), a page named (WebForm1.aspx.cs) should open? How can i do that? Please Help me.....
    Thanks in advance.....

  2. #2
    Join Date
    Oct 2005
    Posts
    189
    Hi There,

    simply add the code in button click function
    Response.Redirect("WebForm2.aspx");
    before doing this make sure that you have Webform2.aspx in your application

    if don't have go to solution explorer
    there right click to your project
    select new item ...........

    Hope this is enough
    Thanx
    Abhi
    www.handshakeit.com

  3. #3
    Join Date
    Mar 2006
    Posts
    37
    hi,

    Thanks for your response. but if i use the "Response.Redirect("WebForm2.aspx")" it loads in the same page itself not in a seperate page. i want that page should be as a seperate one. Plz help me...

    Thanks in advance!!!!

  4. #4
    Join Date
    Aug 2005
    Location
    Karachi, Pakistan
    Posts
    55
    If you want to open a new window, you have to write the right javascript for that.

    There are two ways:

    (1) on page load event put the code like this

    MyButton.Attributes.Add("onclick","window.open('WebForm2.aspx');")

    (2) Or write code like this in Button's Click event.

    Response.Write("<script>window.open('WebForm2.aspx');</script>")

  5. #5
    Join Date
    Oct 2005
    Posts
    189
    are u using "Response>redirect("WebForm2.aspx");"
    on the webform2.aspx itself
    then it will offcorse redirect tothe same page
    use this on some other page than webform2.aspx
    this will open webform2.aspx on response of your request in same window if you want to opwn new window then follow code given by sajjad27s

    Regards
    Abhi
    www.handshakeit.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles