RE: What is Ispostback method in ASP.Net? Why do we us...
it's a property not a mether. It gets a value indicating whether the page is being loaded in response to a client postback or if it is being loaded and accessed for the first time.
RE: What is Ispostback method in ASP.Net? Why do we use that?How can we use pointers in ASP.Net?
Pointers can still be used by enclosing your code under unsafe section. However instead of pointers we can use referece variables and pointers to function can be achieved by using delegates
RE: What is Ispostback method in ASP.Net? Why do we use that?How can we use pointers in ASP.Net?
Basically Post back is an action performed by a interactive Webpage. When it goes to the server side for a non-client Operation Server again posts it back to the client and hence the name. Ex:
if(!IsPostBack)
will not allow the page to post back again n again bcoz it reduces the performance. With Regards Mr. Ravi More
RE: What is Ispostback method in ASP.Net? Why do we use that?How can we use pointers in ASP.Net?
IsPostBack is a property which returns boolean value. It checks weather the page is postedback or not. Note: Loading a page and Post Back is two different things. e.g Page_Load { if(!IsPostBack) {
SqlConnection con new SqlConnection(ConfigurationManager.ConnectionStrings[ TestConStr ].ConnectionString);
SqlDataAdapter da new SqlDataAdapter( Select * from TestTable con);
The above code will run only first time when the page is loaded. So within the code block we can write the code which shouldn't execute on post backs of the page. Still we can view the data in
Gridview because ViewState for GridView is enable [:)]. So we need not to run the code to populate the GridView every time. Hence performance gain.
Coming to Pointers We can use Pointers in .NET with the help of Unsafe Block. Just attach the unsafe keyword infront of method declaration and you are done. Now you can write pointer code inside that method. e.g.
unsafe public static void Main() { //Write code related to pointers.