Thursday 17 May 2012

Android-How to navigate from one screen to another screen


  Button btn= (Button)findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {                  
            Intent inte=new Intent(TestActivity.this,second.class);
            startActivity(inte);

            }
        });

Wednesday 16 May 2012

Get QueryStrings using Javascript

function getQuerystring(key, default_) { if (default_==null) default_=""; key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var qs = regex.exec(window.location.href); if(qs == null) return default_; else return qs[1]; }
The getQuerystring function is simple to use. Let's say you have the following URL:

http://www.test.com?a=gopal
and you want to get the "a" querystring's value:
var author_value = getQuerystring('a');
Operation is not valid due to the current state of the object. System.InvalidOperationException: Operation is not valid due to the current state of the object.
at System.Web.HttpRequest.FillInFormCollection() at System.Web.HttpRequest.get_Form() at Rhino.Commons.LongConversationManager.LoadConversationFromRequest(Boolean& privateConversation) at Rhino.Commons.LongConversationManager.LoadConversation() at Rhino.Commons.HttpModules.UnitOfWorkApplication.UnitOfWorkApplication_BeginRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Cause:
Microsoft recently (12-29-2011) released an update to address several serious security vulnerabilities in the .NET Framework. MS11-100 was introduced just recently that handles potential DoS attacks.  
Unfortunately the fix has also broken page POSTs with very large amounts of posted data (form fields). MS11-100 places a limit of 500 on postback items. The new default max introduced by the recent security update is 1000.  
Adding the setting key to the web-config file overcomes this limitation, as in this example increases it to 2000.