I have two pages, how do I refresh (autopostback = "True") to the 1st page, but on the SUBMIT button
of page 2
I guess I have to right some VB code to Button_Click on page 2
page1.aspx = autopostback()
You could put this in your Button's Click event:
Response.Redirect("page1.aspx")
when the button (SUBMIT) is clicked on page2, the current does close, but i want page1 to autorefresh (autopostback).
Same question : http://forums.asp.net/t/1456113.aspx/2/10 , You can get answer here !
and Refer this :
Cross PostBack
you can have two options on button click event
1 Use responce.redirect() method
2. window.open () method like bellow
string url = "MyNewPage.aspx?ID=1&cat=test";
string fullURL = "window.open('" + url + "', '_blank', 'height=500,width=800,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
So there is no way of refreshing page1 (which is open in the background)? when the submit button is clicked?
if not, what other alternative i have of refreshing the URL, so the changes can be seen
sam233
So there is no way of refreshing page1 (which is open in the background)? when the submit button is clicked?
if not, what other alternative i have of refreshing the URL, so the changes can be seen
What you want ? you want to 1st page value's when second page submit button click ?
or Just refresh the 1st page ?
if you want to refresh the page like try this way
the page2 submit buttonclick event
void Submitbutton_onclick()
{
Response.Redirect("page1.aspx");
}
and add this way for page1
protected void Page_Load(objectsender, EventArgs e)
{
//Bind all page 1
//and finally call this line
if(Request.UrlReferrer.ToString().Contains("page2"))
{
Response.Redirect("page2.aspx");
}
}
It's just only for key , you can think and try yourself .
Hi sam,
Use below code in your button click event
Response.Write("")
and don't forget to use method="Post" in form tag.
Hope this will help you.
沒有留言:
張貼留言