Thursday, April 12, 2012

Filing AZ Tax Online and Requesting for Extension

Filing AZ Tax Online and Requesting for Extension

Go to
https://www.aztaxes.gov/default.aspx
Click on Make Payment

Choose Payment Type as 204(This way you are Making Payment Rightaway however you will file your return within a period of 6 months nearly here we are requesting for an extension but not "extension of time to pay" so far i know w/o paying penalty extension of time to pay is not possible)

Choose Payment Method as "E-Check" if you choose Credit card you will have to pay ~ 14$ of fee.After above you should be good to paper file your AZ return with 6 months of extension.

Wednesday, March 7, 2012

Page.IsValid Property Returning False

If you have too many controls and validators(required field validator custom etc...) on your aspx page and you ever wondered which validator on your aspx page is causing Page.IsValid to return false or true This might come handy:) foreach (object o in Validators) { if (!((IValidator)o).IsValid) { Response.Write(((Control)o).ID + "
"); } }
Source:-http://forums.asp.net/t/1464738.aspx/1

Thursday, February 9, 2012

Enabling Disabling an Asp Label(which works in Chrome/firefox/IE) Without Using .disabled in JavaScript

Enabling and Disabling a label(sounds crazy right because Label has no functionality but still you will see that requirement from Business quite often)

So here we Go:-

By now You would have noticed that if you use below the label shows as disabled in IE but not in chrome and Firefox:
document.getElementById(CityLabel).disabled = true;

I use a way which worked for me across all browsers( and since we are not causing a post back or something on Label click) so we can USE css here to do our Job

document.getElementById(CityLabel).style.color = "#666";

(above will show the label as Grey or disabled in all browsers and that is what I needed)

Friday, January 6, 2012

Using Jquery Ajax to Call a WebService

MatheMatics WebService Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;

namespace MatheMatics
{
///
/// Summary description for Sample
///

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
[WebMethod()]
public string SquareOne(string x)
{
return (Convert.ToInt16(x) * Convert.ToInt16(x)).ToString();
}
}
}


Consumer of MatheMatics WebService
I have removed the greater than and less than sign from this .aspx page
@ Page Language="C#"
@ Import Namespace="System.Web.Services"

html
head id="Head1" runat="server"
title ASP.NET AJAX Web Services: Web Service Sample Page /title

script type="text/javascript" src="JS/jquery-1.7.1.min.js"


script type="text/javascript"
$(document).ready(function() {
jQuery.support.cors = true;
$("#sayHelloButton").click(function(event) {
$.ajax({
type: "POST",
url: "http://usphxawnr8a8tdc.aaaaa.edu:55637/Service1.asmx/SquareOne",
data: "{'x': '" + $('#Square').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
crossDomain: true,
success: function(msg) {
AjaxSucceeded(msg);
},
error: AjaxFailed
});
});
});
function AjaxSucceeded(result) {
alert(result.d);
}
function AjaxFailed(result) {
alert(result.status + ' ' + result.statusText);
}

head
body
form id="form1" runat="server"
h1 ASP.NET AJAX Web Services with jQuery

Enter your Number:
input id="Square" runat="server"

input id="sayHelloButton" value="Square Is: "
type="button" runat="server"
form

body
html

Wednesday, November 16, 2011

Calling Server Side Code from Client(AJAX)

Mark the ScriptManager as below:-
Source:-
Use PageMethods.Method(Server)
http://forums.asp.net/t/1323698.aspx/1

Assume Page is a.spx

1.(Removed the greater and less than signs...you need to append them) On a.spx
asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
/asp:ScriptManager

2. This is the Client Click Event of Button(on aspx page) from where you would like to Call Server Side Code.
input type="button" id="btnSend" onclick="Send('a','b','c')"

3. Client Method on Aspx Page
function Send(coursme, startme,isme) {

var btn = document.getElementById("btnSend");
btn.disabled = true;

//Server Side Code Call
PageMethods.Send(coursme, startme, isme, Succeeded, Failed);
}

4. You should have a method in a.aspx.cs
[WebMethod]
//public static string Send(string id, int courseRoleId)
public static string Send(string coursme, string startme, string isme)
{
.......................
.......................
Code to Execute on Server
.......................
.......................
}

5. Hopefully you are all set...This is just to give you an idea....

Handling Ajax Errors a Simple Sample

You need to Modify this sample as this was not getting rendered and i didn't had much time to look so i removed the brackets but the methods are intact mostly...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
script
void handleClick(object sender, EventArgs e)
{
int a = 0;
int res = 10 / a;
}
void HandleError(object sender, AsyncPostBackErrorEventArgs e)
{
//here we could log the error, and see which exception we're getting in order to set a specific error message
//in this case, I'm just returning the current date/hour back
ScriptManager1.AsyncPostBackErrorMessage = "Ooops...error occurred: " + e.Exception.Message +
DateTime.Now.ToString();
}
/script



form id="form1" runat="server"
asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="HandleError" /
asp:UpdatePanel runat="server" ID="panel"
contenttemplate
asp:Button runat="server" ID="bt" Text="gerar erro no servidor"
OnClick="handleClick" /
/ContentTemplate
/asp:UpdatePanel
/form

Tuesday, May 17, 2011

Is not a Microsoft .NET module While Adding AjaxControl Toolkit

I was trying to add Ajax control toolkit to my ToolBox in VS2008 and was not able to do that.
This post finally helped me out.I had to Turn my Mccafee OFF.
http://forums.asp.net/p/1598878/4061430.aspx