Developing pages for the IPAD ~fixing the postback issue

Today I will discuss and solve the challenges that an developer will face while creating aspx pages with master pages for the IPAD or IPAD 2. The obstacle that developers have is that when an aspx page is in full screen and the user does nothing for about two minutes all postbacks, but the first, that are not submits will fail to happen.  A postback example would be while selecting a new value on a dropdown the selected index changed event is supposed to fire when autopostback="true", assuming that there is a defined method in the code behind, which is wired-up to the event. A person only has search the net for the IPAD cache, viewstate and issues to find this problem.

With the popularity of the IPAD and the premium for real estate on a mobile device this is an option for .net developers not wanting to learn Objective-C.

                                                 JavaScript and Reflection to the rescue!

Add the following code to the masterpage or page with the issue

<input id="MethodX" name="MethodX" type="hidden" runat="server" />

<input id="SenderX" name="SenderX" type="hidden" runat="server" />


    <script type="text/javascript">

        function Xjump(sender, method) {         

            document.getElementById('<%=SenderX.ClientID %>').value = sender;

            document.getElementById('<%=MethodX.ClientID %>').value = method;




Call the following code during the page load, which is in the masterpage or a base page.

public partial class YourAspPage


        protected void Page_Load(object sender, EventArgs e)





 This code is assuming that the above code is in the masterpage hence, the Masterpage.findcontrol() .  






 protected virtual void Housekeaping()


   var senderX = this.MasterPage.FindControl("SenderX") as  HtmlInputHidden;

   var method = this.MasterPage.FindControl("MethodX") as HtmlInputHidden;

   if (!string.IsNullOrWhiteSpace(senderX.Value))


        CallBaseMethod(senderX.Value, method.Value);

        senderX.Value = string.Empty;

        method.Value = string.Empty;




The following code will execute the desired method


public void CallBaseMethod(string sender, string methodAndArgs)


  var oPage = this.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance |


            var obj = oPage.Where(w => w.Name == sender).FirstOrDefault().GetValue(this)

            List<object> lstO = new List<object>();

            lstO.Add(obj);  //sender

            var spl = methodAndArgs.Split(',').ToList();

            string method;

            if (spl.Count() > 1)


                method = spl[0];

                for (int i = 1; i < spl.Count(); i++)







                method = methodAndArgs;

                lstO.Add(null);  //args


        this.GetType().GetMethod(method, BindingFlags.NonPublic | BindingFlags.Instance |

                            BindingFlags.FlattenHierarchy).Invoke(this, lstO.ToArray());

  } code

  <asp:DropDownList ID="ddl" runat="server"  CausesValidation="false"

                    DataTextField="X" DataValueField="X"



Notice the onchange JavaScript  function, XJump's Parameter are the ID and the serverside method we want called, which has no parameters.

The following is an example with a server side method that has parameters.

Unfortunately in order to get sorting to work for a grid view, we need to use asp: TemplateFields instead of asp: BoundFields.     

<asp:TemplateField SortExpression="ColumnName">


<a id="Label1" runat="server" onclick="Xjump('CurrentGridView','Sort,ColumnName')" >

 Column Title </a>



<asp:Label ID="lblbla" runat="server" Text='<%#Bind("ColumnName") %>'  />



The Code Behind method for the sort

protected virtual void Sort(object sender, string Column)


     var gv = (GridView)sender;

     if (gv.SortDirection == SortDirection.Ascending)


        gv.Sort(Column, SortDirection.Descending);




        gv.Sort(Column, SortDirection.Ascending);



In conclusion, we end up manually doing some of what should do for us, but this is far better than having to write the pages in strait html and JavaScript.  



  • Hi, i believe that i noticed you visited my blog thus
    i came to return the want?.I am trying to to find
    issues to enhance my site!I guess its adequate to make use of
    a few of your ideas!!

  • Hello there, just became aware of your blog through Google, and found that it's really informative. I'm gonna watch out for
    brussels. I will be grateful if you continue this
    in future. Numerous people will be benefited from your writing.

  • Somebody necessarily lend a hand to make critically posts I would state.

    This is the first time I frequented your website page
    and up to now? I amazed with the research you made to make this actual post extraordinary.
    Fantastic task!

  • I don't even understand how I finished up here, but I assumed this publish was good. I don't know
    who you might be however certainly you're going to a well-known blogger in the event you aren't already.

  • Good day! Do you use Twitter? I'd like to follow you if that would be okay. I'm undoubtedly enjoying your blog and look forward to new updates.

  • For most recent information you have to pay a quick visit world-wide-web and on web I
    found this website as a most excellent web page for latest updates.

  • With its portability and all-day shelling animation, Ipad has on a
    bar with options at the top, one of which is the curving pointer.

  • I will right away grab your rss feed as I can't find your email subscription hyperlink or e-newsletter service. Do you've any?
    Please let me realize so that I could subscribe. Thanks.

  • Hi to all, how is everything, I think every one is getting more from this site, and
    your views are fastidious in favor of new people.

  • Whether you are searching for specialty styling products or specific Loreal
    hair products, you are sure to find what you need.
    Habits die hard and whatever your regime has been in the past,
    you do need to have a good look around at what is on offer for different hair types
    and textures. Its intention is to offer you ideal
    cosmetics which are safe and substantial in quality, all the way through the

  • What's up colleagues, how is the whole thing, and what you would like to say about this paragraph, in my view its truly remarkable in favor of me.

  • Magnificent items from you, man. I have take note your stuff prior to
    and you are just too excellent. I really like what you've acquired right here, certainly like what you are stating and the way in which in which you assert it. You're making it enjoyable and you continue to take care of to stay it smart.
    I cant wait to read far more from you. That is really a wonderful site.

  • Hola! I've been reading your weblog for some time now and finally got the bravery to go ahead and give you a shout out from Huffman Tx! Just wanted to mention keep up the fantastic work!

  • Do you have a spam problem on this website; I also am a blogger, and I was curious about your situation;
    many of us have developed some nice practices and we
    are looking to trade techniques with other folks, why not shoot me
    an e-mail if interested.

  • I was wondering if you ever thought of changing the layout of your site?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or
    two pictures. Maybe you could space it out better?

  • What kind of favorable publicity do you think you'd get from a once-a-month letter in your local publication. There were also interesting garden "flowers", made from tin cut into petal shapes, bolted together on an aluminum rod, with bottle caps as the center. How to Unlock the Egyptian Level in Golden - Eye 007 I know that too unlock the Egyptian level i have to complete the game on 00 agent but i was just wondering something. Connector: i - Phone 5 features built-in wireless syncing capabilities, inductive charging a la Palm Pre. Easter Island's 'why' question hasn't been satisfactorily answered yet IMHO.

  • These keys allow the user to be able to control the volume,
    pause, and play controls, as well as provide shortcuts to other functions.
    Skins allow you to personalize your cell too, and come in
    many different designs and colors. Additionally, it als.

  • That is really fascinating, You're an overly professional blogger. I've joined your rss feed and sit
    up for in quest of extra of your excellent post. Also, I have
    shared your site in my social networks

  • I am regular reader, how are you everybody? This piece of writing posted
    at this site is truly good.

  • Other FSX Virtual Airlines are based on real airlines, from major carriers to small operators.
    Now player can think that why they select this game.
    This game by Hexacto is simple, straightforward, and fun.
    Initially, it took a little while to go through the manuals and understand
    how it works, but once that was done, it was a breeze.
    Usually, would need to follow the entire startup
    sequence to start any of the airplanes, but FSP also has the auto start feature, to make it easier
    for newbie’s.

  • I have read so many content about the blogger lovers however
    this post is truly a fastidious article, keep it up.

  • Hello! Do you know if they make any plugins to assist with Search Engine Optimization?
    I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very
    good success. If you know of any please share. Appreciate it!

  • In the US, we still express this as cubic inches, feet, or yards.
    First, ready mixed concrete in Sunderland can help you
    get your construction job done faster. Repairing
    larger cracks or holes in driveways takes
    a little more time and preparation.

  • Someone essentially help to make seriously articles I would state.
    This is the first time I frequented your web page and thus far?
    I surprised with the research you made to create this particular publish
    extraordinary. Great job!

  • Generally speaking, there are several main techniques made use of by data mining software: clustering, distinction, regression and association approaches.
    Approach human resource professionals and companies and ask what skills and qualities
    they look for in staff and be able to tick all the boxes before
    applying. Once the timeframe reaches 0 to X minutes, the
    star is about to land.

  • You actually make it seem so easy with your presentation but I in finding this matter to be actually
    something which I think I would by no means understand.
    It seems too complicated and extremely vast for me. I am having
    a look forward to your subsequent submit, I will try to
    get the grasp of it!

  • This information is worth everyone's attention. How can I find out more?

  • You are a very clever person!

  • I really like looking through an article that will make people think.
    Also, thanks for permitting me to comment!

  • Amazing! Its in fact awesome paragraph, I have got
    much clear idea about from this article.

  • It's actually very complex in this busy life to listen news on Television, thus I just use internet for that reason, and get the most up-to-date information.

  • Thanks for another excellent article. The place else could anybody get that kind of information in
    such an ideal way of writing? I've a presentation next week, and I'm at the look for such information.

  • Since the program is based on a real time world, users would not only be able to
    choose the weather of their choice but also the scenery.
    When you decide to buy the Flight Simulator Game, then first you have to be sure that exactly what are you want.

    You can train up your hobo so that you can kill other hobos even more easily,
    and it is a very addicting game. In order to compete for market shares
    on routes you must have a virtual airline management game
    account. The instruments that lag in real life, lag correctly, gyro drift is modeled correctly, the magnetic compass is subject to aircraft body forces - all those things that make real
    world flying a challenge are present.

  • Personal opinion is generally exhibited in various types of
    editorial writings. Creating your own info or e-letter communication could
    also be considered. Today, Most of newspapers
    are offering their online editions. Newspaper companies should be
    seeking to have subscribers to their service where breaking news can
    be emailed and send to blackberries and cell-phones.
    Until I was five I lived with my mother's younger sister Dorothy and my grandmother, who told me before she died that my mother had received letters from my father for some years after bringing me to New York.

  • If you are like me and love garlic, you are already too late.
    When you're preparing your planting area, just mix the soil with about three inches of organic compost. In some cases, the quantity of materials for making compost in the amounts desired (an annual layer 2 inches deep across the garden) cannot be obtained.

  • Generally speaking, there are several main
    techniques made use of by data mining software: clustering, distinction, regression and association approaches.
    Some mining firms lost 30 per cent of their share values in the
    early August stock market meltdown. Thanks for reading this
    article about Oregon gem mining on Associatedcontent.

  • At that time, I was a very ordinary promoter at a small company, of course, I earned not much money which was just enough to support myself.
    Unlike many other medical facilities, the Fayette Chiropractic Center offers walk-in therapy.
    Also like many single parents, Sebastiao is hoping
    to share the bills with her former spouse. If the other
    driver makes any admissions of fault, write
    those down as well. The doctor will ask about symptoms of metabolic disorders such as
    fatigue, headaches, cramping, mood changes, shortness of breath, and chronic diarrhea.

  • This makes the mixing phase a lot easier, just put in your concrete and water,
    and off you go by the wheelbarrow load. Also, keep in mind that the ingredients for the mix
    should be bought from a home improvement store to insure quality.

    It is advantageous for the customer to compare the prices for an
    additional dumpster rental from the normal waste removal company against an offer made by a collector that will place a dumpster for a one-time pickup.

  • It is indeed possible to lower high blood pressure by only taking herbal medicines and vitamins
    and eating certain foods that can lower high blood pressure.
    Predominantly the computer software will endeavor to lure you into
    paying for non-existent software program to clear away the viruses
    that are infecting your Computer. A good personal injury
    lawyer can save you from making a great deal of mistakes
    and can shoulder much of the hassle of knowing what to do
    about car repairs, car rentals, medical treatment, witness statements
    and the like. Vu promises that you'll look forward to doing them as the results are well worth it. And just think how great you'll look and feel when
    you are consistently doing 100 ab exercises a day.

  • Wash your curly hair at the very least two days in a week.
    My hair doesn't always look good when I'm going to attend
    openings and red carpet events. Both brands are popular in known hair
    salons and spas.

  • Djelloul: The Mafia has been portrayed in many ways in books and movies, and I don't have a quarrel with these portrayals, because the Mafia is a work of many facets. Creating your own info or e-letter communication could also be considered. Information regarding different websites that contain large chunk of databases of unclaimed properties and money are also provided in different newspapers. However, the English newspapers are much central to urban areas. Just save your old newspapers, or get some from friends and neighbors and start packing.

  • Generally I don't learn article on blogs, but I would like to say that this write-up very pressured me to check out and do so! Your writing taste has been surprised me. Thanks, quite nice post.

  • Overall the times was a very exciting newspaper and one which is very insightful into its readers
    needs. E-papers are able to take advantage of story, sacrificing other,
    decidedly less important stories and giving as much detail about breaking news
    as possible. He quickly became a well known activist for Islamic revivalism calling for the ouster of pro-western governments using violent means
    if necessary. That’s why, while drafting ads for newspapers selling or buying a property, make your USP as your headline.

    Just save your old newspapers, or get some from friends and neighbors and start packing.

  • Very good written information. It will be useful to everyone who utilizes it,
    as well as me. Keep up the good work - looking forward to
    more posts.

  • Fastidious replies in return of this issue with genuine arguments and describing everything regarding that.

  • The hosts file is a popular, cross-platform way of blocking access to certain domains, such as ad-serving websites.
    Amla is used in the preparation of a highly effective natural shampoo by mixing 100 g
    each of amla, nuts and Shikakai soap in two quarts of water,
    the mixture is boiled for half an hour to simmer and then can be used
    as shampoo for one month for all hair treatment throughout the year.
    I confess that I was a little bit skeptical at initially. All-natural oils such as
    olive, coconut, and avocado oil can be used
    as wonderful hot oil treatments for hair. Exactly what
    the oil does is clean and exfoliate your hair follicles, help make your bloodstream circulate better all around your head
    and in return boosts the process involving hair growth and acts as being a supercharger for making
    your hair get bigger.

  • Thanks for the auspicious writeup. It in reality was a amusement account it.
    Glance complicated to more brought agreeable from you! By the
    way, how can we keep up a correspondence?

  • Thanks for your information on this blog.

    One particular thing I want to say is that purchasing gadgets items through the Internet is
    nothing new. In reality, in the past ten years alone,
    the market for online electronics has grown a great
    deal. Today, you will find practically vir electronic device
    and product on the Internet, which include cameras plus camcorders to computer
    components and game playing consoles.

  • I think the admin of this web site is genuinely working
    hard in support of his website, as here every material is quality based data.

  • Deciding to buy online can result in a huge cost savings while providing you the
    best options for your hair care needs today. Likewise, using imported shampoos and conditioners from a tropical country when your climate is cold and temperate
    is not such a good idea. It is designed for
    professionals so you know you're getting top performance.

  • Still the health concerns mar the overall positive sides
    of this economic growth as people take their health problems
    as the cost of development which is indeed pretty
    higher. For the thick and curly hair, it is best to use
    the Moroccan Oil. Though addressing these underlying causes is very important in order to prevent hair fall, coconut oil can also help to an extent.
    Ideally, prepare the day before dilution and in the evening, put the mixture in the palm of your hand and apply and hold your hair and scalp.
    Indeed, nourishing and conditioning the scalp
    using aromatherapy oils is one of the most
    basic and simplest ways to prevent further hair loss and stimulate
    healthier hair regrowth.

  • There could possibly be times when you'll want to send gift items in the mail to members of the family or friends. Another option which makes an excellent client appreciation gift is a nice pair of name brand pens with your logo on them. You will dsicover yourself perpetually looking at the newspapers and magazines, gathering all the stuff will give you a few dollars from the regular price, which certainly helps you with your quest for receiving the items that you desire or dependence on less, whatever that is.

  • Whenever in stress do try to eliminate or at least try
    to how to reduce. Gurmar extract may help lower blood sugar and protect kidneys.
    Once your reading goes over 140 systolic (top number), or 90 diastolic (bottom number),
    your risk of cardiovascular disease increase.

Comments have been disabled for this content.