0

I have a web application with two pages at the moment, The first page the user needs to complete some details, with a button that needs to open the second page with a list of buildings and the user needs to choose one of to populate a list of textboxes in the first form.

My question is, from a button on the first page. (CreateSurvey.aspx) I want to open the second page (Search_Property.aspx)

I have come across syntax like

Search_Property Search = new Search_Property();

        Search.open(); 

But the .open does not exist in this context.

Could someone help me please.

Regards

Rob

Rob
  • 59
  • 1
  • 12

2 Answers2

1

In Web forms, you open pages by redirecting to the new page. So, in your button click event, you would use:

Response.Redirect("Search_Property.aspx"); or Server.Transfer("Search_Property.aspx");

And of course there's the option to modify your button markup to post directly to Search_property.aspx as shown here:

<asp:Button ID="searchButton" runat="server" Text="Search" PostBackUrl="~/Search_Property.aspx" />

reckface
  • 5,678
  • 4
  • 36
  • 62
0

If you don't want to navigate to another page and then back again, there are several options. You can create HTML "dialogs" in your CreateSurvey.aspx page and show/hide them as necessary. You can also use an IFRAME on the CreateSurvey.aspx page to display the Search_Property.aspx page and then use some Ajax (HttpXmlRequest) to update the CreateSurvey.aspx page.

Jay Buckman
  • 581
  • 5
  • 18