RockOn
RockOn

Reputation: 197

Automatically generate a new page / URL in ASP.Net / C#

I want to generate a new URL and page when someone submits a form. Meaning when the button is clicked, a new asp.net page is added to a folder.

I think maybe Routing does this: https://msdn.microsoft.com/en-us/library/dd329551.aspx

But is this the way to do it or is there some other tutorial/way to be doing this?

Upvotes: 0

Views: 635

Answers (2)

virtouso
virtouso

Reputation: 569

basically generating a page is not something that can be done by a user. most of the time routing can be the answer of your question. the parameters that page recieves can have different content based on those parameters. like beliw: you send parameter by:

Redirect("page.aspx?name=john" );

recieve in other page:

string x= Request.queryString["name"];

it is mostly used in cms systems. for example you just have one news page but the prameter that page recieves says to show which news from database.

Upvotes: 1

Ahmad Harb
Ahmad Harb

Reputation: 615

It is not a good practice to create a new aspx page for each page submission.

But what you have to do is create an aspx page that handles these form submissions, each submission has a different URL or Query string.

You can use the IIS URL Rewrite module.

check this URL http://www.iis.net/learn/extensions/url-rewrite-module

Upvotes: 1

Related Questions