What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 62356 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > How to stop Autopost back in pageload ...
Abhisekjani

How to stop Autopost back in pageload

Replies: 6 | Posted by: Abhisekjani on 6/29/2012 | Category: ASP.NET Forums | Views: 671 | Status: [Member] | Points: 10  


Hi
while i selected a gridrow in gridview the page will autoloaded and the control goes to first row ........
How to stop autopostback in page load


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Johnbhatt
Johnbhatt  
Posted on: 6/29/2012 1:11:56 PM
Level: Starter | Status: [Member] | Points: 25

Use below code On Page_Load event to avoid Postback everytime.

if (!IsPostBack)
{
GridView1Fill(); // Code to Bind Data to GridView.
}


John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Johnbhatt
Johnbhatt  
Posted on: 7/2/2012 12:04:07 AM
Level: Starter | Status: [Member] | Points: 25

Dear Abhisek,
If your query is solved please mark as answer and close forum post.

John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Abhisekjani
Abhisekjani  
Posted on: 7/2/2012 1:26:00 AM
Level: Starter | Status: [Member] | Points: 25

No its not working....while i select a row in gridview the focus goes to first row mean if i select a row the page got autopostback......i want if i select a row the focus should be at the selected row.........

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muralidosscm
Muralidosscm  
Posted on: 7/3/2012 8:14:17 AM
Level: Starter | Status: [Member] | Points: 25

protected void Page_Load(object sender, EventArgs e)
if (!IsPostBack)
{
}



Regards
Muralidoss M

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Abhisekjani
Abhisekjani  
Posted on: 7/4/2012 1:45:05 AM
Level: Starter | Status: [Member] | Points: 25

its not working...................

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Premalatha
Premalatha  
Posted on: 7/4/2012 4:22:09 AM
Level: Starter | Status: [Member] | Points: 25

Use a Flag, like IsPopUpShown and add it in the session.

like:


if(!Page.IsPostBack)
{
bool _isShownInSession = (null != Session["IsPopUpShown"])?Convert.ToBoolean(Session["IsPopUpShown"]) : false;

if(isShownInSession == false)
{
//Show PopUp
Session["IsPopUpShown"] = true;
}
}


Hope This helps :)

Premalatha
Software Engineer

Abhisekjani, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 8:57:13 AM