this question is duplicated of Is postback works only in pageload? I want to post back page when i have value in my query string. see code
if (Request.QueryString["HotelID"] != null)
// here i want to post back
{
how i can post back page ?
this question is duplicated of Is postback works only in pageload? I want to post back page when i have value in my query string. see code
if (Request.QueryString["HotelID"] != null)
// here i want to post back
{
how i can post back page ?
You can use this:
if (Request.QueryString["HotelID"] != null)
{
Page_Load(sender, e);
}
Or this:
if (Request.QueryString["HotelID"] != null)
{
Response.Redirect(Page.AppRelativeVirtualPath.ToString());
}
Hope it helps:)
try this;
if(!String.IsNullOrEmpty(Request.QueryString["HotelID"]))
{
Response.Redirect(Request.UrlReferrer.ToString());
or
Response.Redirect("yourpagewithpath.aspx");
}