Reputation: 616
I need to run an ASP.NET page with some parameter.
For example :
When I run the project Default.aspx
opens in the browser.
I want to open Default.aspx?CONFERENCEID=3
Is this possible?
Upvotes: 1
Views: 6987
Reputation: 52366
This is how you do it in VS2015:
Right click on Project
Select Properties
Click on Web on the right menu
Select Start URL radio button
Enter your url: http://www.yoursite/Default.aspx?CONFERENCEID=3
Upvotes: 1
Reputation: 1838
Right click on the website project..Select Property pages..select Startup options.. Set specific page property as
Default.aspx?CONFERENCEID=3
Upvotes: 2
Reputation:
You can do it man
Add this code in your default screen pageload event
Page-load()//Point 1
{
if(string.IsNullorEmpty(Request.QueryString("CONFERENCEID").Tostring()))// Point 3
{
Response.Redirect("Default.aspx?CONFERENCEID="+ 3);
}
string value=Request.QueryString("CONFERENCEID").Tostring()//Point 2
}
Where,
When you run your application
The default screen pageload function will load
if the url have any (CONFERENCEID) query string then store the query string values into a variable
otherwise it's redirect to same page( like reload) with a query string.
Upvotes: 3
Reputation: 23093
You can set the startup page in the project properties:
Set it to Specific page
or Start URL
.
Upvotes: 1